rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

Add support for path mapping

Open fmeum opened this issue 1 year ago • 2 comments

What type of PR is this?

Feature

What does this PR do? Why is it needed?

Path mapping improves disk/remote cache hit ratio by automatically removing the configuration-specific path segments (e.g. k8-fastbuild-ST-12345678) from action command lines before staging them for execution.

This commit makes the stdlib, compilepkg (assuming no cgo) and gentestmain actions compatible with path mapping, which is mostly automatic except that GOROOT now needs to be passed in via a flag rather than an environment variable.

See https://www.youtube.com/watch?v=Et1rjb7ixUU for more information on path mapping.

Which issues(s) does this PR fix?

Other notes for review

Can be tested via --experimental_output_paths=strip with Bazel last_green.

fmeum avatar Apr 08 '24 10:04 fmeum

@linzhp @tyler-french Would be interested in hearing your thoughts on this, let me know if you want more context.

fmeum avatar Apr 08 '24 11:04 fmeum

I fixed the merge conflict and added comments to explain why these slightly more convoluted Args constructions are necessary.

fmeum avatar May 07 '24 10:05 fmeum

I removed the workaround for the Bazel bug that has now been fixed in last_green and 7.2.0.

fmeum avatar May 29 '24 08:05 fmeum