bazelbuild / rules_pkg

Bazel rules for creating packages of many types (zip, tar, deb, rpm, ...)
Apache License 2.0
221 stars 174 forks source link

Apply tar remap_paths to runfiles full paths #812

Closed dieortin closed 8 months ago

dieortin commented 8 months ago

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

cgrindel commented 8 months ago

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