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

rustbuild: Add a tidy check to ensure Cargo.lock updates are checked in #32901

Closed
alexcrichton opened this issue Apr 12, 2016 · 3 comments
Closed
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@alexcrichton
Copy link
Member

Right now we don't have the majority of devs using rustbuild, so it's easy to modify Cargo.toml but forget to generate a new lock file. This in turns leads to messy diffs after the change has landed because anyone working on rustbuild will start seeing that diff.

Let's get the bots to fail the build if Cargo.toml is updated and Cargo.lock does not reflect that change. Essentially, after building all Cargo.lock files should remain unchanged. I would propose doing this by tracking the git status of Cargo.lock via these steps:

  1. If the source is not a repository, bail out (e.g. this is a from-source build)
  2. Run git diff-index --quiet HEAD 'src/**/Cargo.lock'
  3. If the exit code is 0, we're good, if 1 then they're changed and error out

The make tidy message should be a nice error message like:

dirty lock file found at src/rustc/Cargo.lock, please run:

    cargo update --manifest-path src/rustc/Cargo.lock -p rustc

(or something like that)

This should be pretty easy to implement once #32590 lands (it'll just be adding a new check in our tidy tool). Another good way to jump into rustbuild if you're interested!

@alexcrichton alexcrichton added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 12, 2016
@gsquire
Copy link
Contributor

gsquire commented Apr 22, 2016

I would like to try and tackle this. Is this the home of the tidy checks?
https://github.com/rust-lang/rust/tree/a43eb4e774f6d51b7012bba3d25212819ab0e3dc/src/tools/tidy

@alexcrichton
Copy link
Member Author

@gsquire Awesome! That is indeed where they all live

Manishearth added a commit to Manishearth/rust that referenced this issue May 8, 2016
Manishearth added a commit to Manishearth/rust that referenced this issue May 8, 2016
@alexcrichton
Copy link
Member Author

Fixed in #33404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

No branches or pull requests

2 participants