Skip to content

Handle git info in rustbuild differently #43771

Closed
@alexcrichton

Description

@alexcrichton

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions