trying to better understand the output of bazel mod grap --include_builtin --verbose

18 views
Skip to first unread message

Arndt

unread,
Nov 22, 2024, 11:16:51 AM11/22/24
to bazel-discuss
Hi
I used https://github.com/bazelbuild/examples/tree/main/cpp-tutorial/stage1 to better understand the built-in modules.
I'm getting this output:

> bazel mod graph --include_builtin --verbose
<root> (super-simple@1.0)
├───bazel_tools@_
│   ├───local_config_platform@_ (*)
│   ├───apple_...@1.5.0
│   │   ├───local_config_platform@_ (*)
│   │   ├───plat...@0.0.9 (*) (was 0.0.4, cause bazel_tools@_)
│   │   └───bazel_...@1.6.1 (was 1.3.0, cause bazel_f...@1.11.0, rules...@7.6.5)
│   │       ├───local_config_platform@_ (*)
│   │       └───plat...@0.0.9 (*) (was 0.0.4, cause bazel_tools@_)
│   ├───buil...@7.1.2
│   │   ├───local_config_platform@_ (*)
│   │   └───bazel_f...@1.11.0
│   │       ├───bazel_...@1.6.1 (*)
│   │       └───local_config_platform@_ (*)
and so on

I'm trying to understand the "(*)" and the "cause bazel_tools@_" term:
E.g. for apple_...@1.5.0 and its dependency plat...@0.0.9:
Originally, the dependency was 0.0.4, but bazel_tools has overruled it and the (*) is indicating such overruling?
Thx a lot

Xudong Yang

unread,
Nov 25, 2024, 2:58:55 PM11/25/24
to Arndt, bazel-discuss
The (*) means that the deps of this module are shown elsewhere in the output (this is a "tree" view of a graph, so nodes are going to be mentioned multiple times)

The "cause bazel_tools@_" part means that the dependency got upgraded because another module has a dependency on a higher version. In your example, apple_...@1.5.0 depends on plat...@0.0.4, but bazel_tools@_ depends on plat...@0.0.9. Bazel picks the highest specified version for `platforms`, which ends up being 0.0.9. There's no "overruling" happening here, at least not insofar as specifying any higher version counts as an overruling.

"  YÁNG Xùdōng (杨旭东)
#  SURNAME Givenname
=  Software Engineer
@  Google New York


--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bazel-discuss/4d2cb39e-0455-402a-8dfd-828c51ff690bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages