rust-lang / rust-lang/rust

`x setup` doesn't actually need to store hashes of the configuration files

Open
#145,098 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-git C-bug T-bootstrap
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Summary

right now, bootstrap stores a list of all historical hashes of all configuration files:

https://github.com/rust-lang/rust/blob/2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a/src/bootstrap/src/core/build_steps/setup.rs#L578

this is a lot of overhead for people contributing to bootstrap itself. it also is duplicating work that git already does for you. instead, you could do something like this to calculate it on-demand, or perhaps as a build.rs step:

git log --pretty=format:%h src/etc/rust-analyzer* | xargs -i git ls-tree -r '--format=%(path) %(objectname)'  {} -- src/etc/rust-analyzer*
HEAD

2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a

Additional context

context is uh. complicated. i am trying to apply this pattern in a program other than bootstrap and realized i was rewriting most of a VCS.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/bootstrap/src/core/build_steps/setup.rs around line 578 and trace how bootstrap stores and checks historical configuration-file hashes. Compare that flow with the issue's Git-based lookup, then verify the x setup flow still detects configuration changes without maintaining the stored hash history.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.