Implement "Locating runfiles with Bzlmod" proposal
See original GitHub issueThe “Locating runfiles with Bzlmod” proposal consists of the following individual steps:
- ~Add the
RunfilesLibraryInfo
provider (#16125)~ - Collect repository names and mappings of the transitive closure of a target (#16278)
- Emit a repository mapping manifest for every executable (#16321 and https://github.com/bazelbuild/bazel/pull/16652)
- Revert
RunfilesLibraryInfo
- Expose the current repository name in rules
- Bash (#16693)
- C++ (#16216)
- Java (#16534)
- Python (#16341)
- Parse and use the repository mapping manifest in runfiles libraries (https://github.com/bazelbuild/bazel/issues/15029)
- Bash (#16693)
- C++ (#16623 and https://github.com/bazelbuild/bazel/pull/16701)
- Java (#16549)
- ~Python~ will be updated in rules_python
- Use the Java runfiles library to make Stardoc work with repository mappings (https://github.com/bazelbuild/bazel/issues/14140)
Status of runfiles libraries in third-party rulesets:
- rules_go (https://github.com/bazelbuild/rules_go/pull/3347)
- rules_rust (???)
- rules_haskell (???)
Issue Analytics
- State:
- Created a year ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
[Proposal] Locating runfiles with Bzlmod - Google Groups
I submitted a draft of a proposal on how to locate runfiles with Bzlmod and ... repository (e.g. it implements a custom lookup...
Read more >Command-Line Reference | Bazel
Specifies the registries to use to locate Bazel module dependencies. The order is important: modules will be looked up in earlier registries ...
Read more >Why can't my programs find resource files when using bazel ...
Use the C++ runfiles library to find them. Add the dependency in your BUILD file: cc_binary( name = "lazy-foo-02", srcs = [ "main.cpp",...
Read more >CHANGELOG.md - Google Git
When Bzlmod is enabled, all Bzlmod-generated repos will have an extra '@' prepended to their ... Find runfiles in directories that are themselves...
Read more >Adopting Bazel's new package manager - Aspect Blog
You can read about the design of the feature in the Bzlmod User Guide ... Follow github.com/bazelbuild/bazel/issues/14013 to find out when ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The most likely future seems to be that we’ll standardize on Python imports not containing the repository name, in which case bzlmod is a no-op.
It’s not an optimal solution because it requires an entry in
$PYTHONPATH
for each repository in the transitive closure of the Python binary, but it’s the status quo and I’d much prefer thinking up a solution to that (e.g. binary-specific symlink trees that do not look like runfiles trees, dunno) than to standardize on having the repository names in imports because the concept of “repository” is specific to Bazel.Put differently: the only way for bzlmod to cause trouble for Python is if we decide to require repository names in imports, which seems to be unlikely and it looks like the decision on that will take a while and I prefer not blocking either Bazel 6.0 or the removal of bzlmod from the experimental domain to avoid an unlikely failure mode. And should that happen, we can always paper over it with some sort of import hook.
/cc @rickeylev
It’s the “To fix #NNN” line… GitHub trying to be clever here