Skip to content
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 path mapping #3915

Merged
merged 3 commits into from
May 29, 2024
Merged

Add support for path mapping #3915

merged 3 commits into from
May 29, 2024

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Apr 8, 2024

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
Copy link
Collaborator Author

fmeum commented Apr 8, 2024

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

go/private/context.bzl Outdated Show resolved Hide resolved
@fmeum
Copy link
Collaborator Author

fmeum commented May 7, 2024

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

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.

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

See https://www.youtube.com/watch?v=Et1rjb7ixUU for more information on
path mapping.
@fmeum
Copy link
Collaborator Author

fmeum commented May 29, 2024

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

@fmeum fmeum enabled auto-merge (squash) May 29, 2024 08:05
@fmeum fmeum merged commit 6f206ad into master May 29, 2024
5 checks passed
@fmeum fmeum deleted the supports-path-mapping branch May 29, 2024 10:12
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.

None yet

2 participants