-
Notifications
You must be signed in to change notification settings - Fork 176
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 support for repo mapping #878
Conversation
Esp. when include_runfiles = True Closes bazelbuild#769 Signed-off-by: Thomas Lam <thomaslam@canva.com>
target[DefaultInfo].files_to_run.repo_mapping_manifest != None | ||
): | ||
repo_mapping_manifest = target[DefaultInfo].files_to_run.repo_mapping_manifest | ||
dest_path = paths.join(src_dest_paths_map[src] + ".runfiles", "_repo_mapping") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only adds example.runfiles/_repo_mapping
-- example.repo_mapping
is still missing.
Signed-off-by: Thomas Lam <thomaslam@canva.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I will wait to merge it so that @tonyaiuto can take a look.
@aiuto can you PTAL? |
Signed-off-by: Thomas Lam <thomaslam@canva.com>
@@ -122,5 +122,7 @@ def get_repo_mapping_manifest(src): | |||
""" | |||
files_to_run_provider = get_files_to_run_provider(src) | |||
if files_to_run_provider: | |||
# repo_mapping_manifest may not exist in older Bazel versions (<7.0.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now "that" is a comment which makes it clear why you are doing something specal. Thanks.
Context
When a binary is packaged with
pkg_*
rules, the repo_mapping manifest file is not included in the archive. For exampleThe above generates an archive that does not have
_repo_mapping
under runfiles directory even when bzlmod is enabled, and therefore runfiles libraries are not able to convert apparent repo names into canonical repo names.Changes
Patch
rules_pkg
such that wheninclude_runfiles = True
it copies the repo mapping manifest into the archive at the correct location
i.e.
Closes #769