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

Use a path instead of a string for emit in rustc command-line arguments. #2445

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

matts1
Copy link
Contributor

@matts1 matts1 commented Jan 25, 2024

This can improve the cache hit rate, as it will work with path mapping.

Also generate the emit path unconditionally, as this works better with the binary_ext parameter better (as it guarantees that you won't get an error where the file names don't match).

This can improve the cache hit rate, as it will work with path mapping.

Also generate the emit path unconditionally, as this works better with the `binary_ext` parameter better (as it guarantees that you won't get an error where the file names don't match).
@matts1 matts1 marked this pull request as ready for review January 30, 2024 02:59
@krasimirgg
Copy link
Collaborator

Looks good!

This can improve the cache hit rate, as it will work with path mapping.

Could you go into more detail what's path mapping?

@krasimirgg krasimirgg self-requested a review February 15, 2024 12:50
@matts1
Copy link
Contributor Author

matts1 commented Feb 16, 2024

Suppose you enter a transition from foo=False to foo=True, and foo doesn't affect a rust binary you're building.

Bazel will still have to rebuild, because when entering a transition it changes the output path from bazel-out/k8-fastbuild/... to bazel-out/<hash>. However, with path mapping, you can tell bazel that these are equivalent, and that one of these paths maps to another in the action key.

Copy link
Collaborator

@krasimirgg krasimirgg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks good!

@krasimirgg krasimirgg enabled auto-merge (squash) February 16, 2024 11:16
@krasimirgg krasimirgg merged commit a4b1a1b into bazelbuild:main Feb 16, 2024
3 checks passed
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