Skip to content

Apply tar remap_paths to runfiles full paths#812

Merged
cgrindel merged 2 commits intobazelbuild:mainfrom
dieortin:tar-runfile-mapping
Feb 1, 2024
Merged

Apply tar remap_paths to runfiles full paths#812
cgrindel merged 2 commits intobazelbuild:mainfrom
dieortin:tar-runfile-mapping

Conversation

@dieortin
Copy link
Contributor

This modifies the way remap_paths works on pkg_tar when using include_runfiles so that remapping is performed on the full path of each runfile, instead of just in the base folder (foo.runfiles)

This should be backwards compatible with the current behavior, and only affect those that specify runfiles paths in their mappings. For example, for the following path foo.runfiles/some/folder/file.txt:

remap_paths: {
    "/foo": "/bar", # Still yields the same result as before (bar.runfiles/some/folder/file.txt)
    "/foo.runfiles/some/folder": "/bar", # Now works and yields bar/file.txt
}

I have implemented some tests that demonstrate this behaviors.

Resolves #790

@dieortin dieortin requested a review from cgrindel as a code owner January 16, 2024 21:39
@cgrindel
Copy link
Collaborator

@aiuto This looks reasonable to me. I noticed that you started a dialogue with the author. Perhaps you should review it.

@cgrindel cgrindel merged commit 3a2508f into bazelbuild:main Feb 1, 2024
@dieortin dieortin deleted the tar-runfile-mapping branch February 6, 2024 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remap_paths from pkg_tar should apply to runfiles

2 participants