Description
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!