-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Handle git info in rustbuild differently #43771
Comments
What about not tracking git info for the dev profile? No git commit is better than a wrong one imo. |
@est31 oh that's an even better idea! I'm 👍 to doing that. |
My pull request with fixes to rustbuild has a flag (ignore-git) that just ignores git info; making it default to true is maybe not ideal, but seems fine for the dev profile. |
Oh right, awesome! Once that lands I'll tag this as E-easy. |
The relevant PR landed, so tagging this as E-easy and E-mentor. I believe what needs to happen is |
This commit automatically sets `ignore-git` to `true` in configuration if the configured channel is set to "dev" and otherwise no value for `ignore-git` has been specified. This'll help rebuilds locally whenever a new commit is made by ensuring that git information never makes its way to compiler crates in the first place. Closes rust-lang#43771
I would like to try to take this on, if that's OK. I have a question right out of the gate however; looking at these lines:
In the case It seems like either way I would add code to set |
Oh sorry about this @JeremySorensen, I think I made a PR just before you commented! That being said, @Mark-Simulacrum had some comments on that PR and it looks like what you're thinking is more along the lines of what he's thinking, so I'm gonna close that PR and let you take over if you'd like. I believe what you're thinking is spot on though! |
@alexcrichton Thanks for letting me take a crack at this! |
make ignore-git true by default when channel is dev Fixes #43771 (Handle git info in rustbuild differently)
Right now we encode git information directly into the rustc binary that we build during the normal build process, and this information powers
rustc -vV
and such. At this time, however, this git information is loaded from the git repository every time you execute./x.py build
. Consequently, whenever a new commit is made, lots of rustc libs need to be rebuilt!My personal workflow consists of making commits over time as I fix things (especially tests), and having everything get rebuilt every time I make a commit is a bit of a bummer! I think a better strategy here would be to cache git information from the first time of invocation of rustbuild into the out directory. That way we keep reporting the same commit (even though it may not exist or be the actual commit) when there's a persisted build directory.
I believe a strategy like this won't affect the builds on CI, but may hopefully improve the developer experience!
The text was updated successfully, but these errors were encountered: