-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add --incompatible_compact_repo_mapping_manifest
#24809
base: master
Are you sure you want to change the base?
Conversation
2601e43
to
9b3e9fc
Compare
@Wyverald Should we ask runfiles libraries to perform a linear match on all lines with prefixes? That's |
@Wyverald Friendly ping |
Before we commit to introducing a new manifest format, could you briefly explain to me why we're recording so many entries in the manifest? I vaguely remember that we try to trim entries down to just the ones that we actually include runfiles for. Does that actually end up being every single repo generated by the extension? (Is it because of Python source files?) I really wish this was something that could transparently be taken care of by compression, but I guess that's a bit of a pipe dream. |
We are trimming down the target repos to those that provide runfiles, but for NPM and Python that's typically every extension repo. Most of those won't use a runfiles library, so if we tracked that (my original proposal had something like this, but we decided against it for being too complicated), we could potentially trim down the source repos. But if a ruleset for a dynamic language ever adopts repo mapped language imports using the runfiles library (rules_python has been discussing this at some point), even that wouldn't help. Compression is a good fix for remote execution. I have a change out that lazily streams these files to the executor with BwoB, but that doesn't help for local builds. |
I see. It somehow escaped me, but thinking about it again, for a top-level binary that depends on a lot of Python code, there's basically no way to "trim" anything here for any meaningful measure. We should definitely tread carefully here -- changing the manifest format can be rather disruptive, especially since it's not versioned (so it basically always has to be forwards-compatible). |
src/main/java/com/google/devtools/build/lib/analysis/config/CoreOptions.java
Outdated
Show resolved
Hide resolved
src/test/java/com/google/devtools/build/lib/analysis/RunfilesRepoMappingManifestTest.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/analysis/RepoMappingManifestAction.java
Outdated
Show resolved
Hide resolved
Could you elaborate a bit what "a linear match on all lines with prefixes" means? |
Runfiles libraries have essentially two ways to look up mappings in the presence of wildcards. First, try to look up an exact match for the source repo in some equivalent of
|
I see. I would like to avoid encoding any knowledge about the repo name format whatsoever (you'd probably expect that from me at this point :)). On the runfiles library side, some tricks can be done to speed up the lookup (e.g. constructing a trie), so performance should still be good enough. |
--incompatible_compact_repo_mapping
--incompatible_compact_repo_mapping_manifest
9b3e9fc
to
5e9644b
Compare
The equivalent of a |
Regarding comment from @fmeum
Right now we are also researching ways to lay out the files in a way that would not require this (i.e. create a virtual env and put the files in a way that is natural to Python). Right now no one is pursuing reading the runfiles manifest to implement an The virtual env approach is being researched here: bazel-contrib/rules_python#2617 |
5e9644b
to
f6bf303
Compare
@Wyverald I resolved the conflicts, this should be good for another review. |
# Conflicts: # src/test/java/com/google/devtools/build/lib/analysis/RunfilesRepoMappingManifestTest.java # Conflicts: # src/main/java/com/google/devtools/build/lib/rules/python/PyBuiltins.java # src/test/java/com/google/devtools/build/lib/analysis/BUILD # Conflicts: # src/main/java/com/google/devtools/build/lib/rules/python/BUILD
3185548
to
83f4865
Compare
@Wyverald Friendly ping, let's merge this so that runfiles library work can start :-) |
With the flag enabled,
<binary>.repo_mapping
containsinstead of
for the
deps
module extension.Runfiles libraries have to be updated to find entries using the new format.
Work towards #24808