Skip to content

[rustbuild] should not rollback the submodules most of the time #42404

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

Closed
nagisa opened this issue Jun 3, 2017 · 4 comments
Closed

[rustbuild] should not rollback the submodules most of the time #42404

nagisa opened this issue Jun 3, 2017 · 4 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@nagisa
Copy link
Member

nagisa commented Jun 3, 2017

Currently rustbuild unconditionally forcefully checks out all the modules before building. This clashes with the workflow that probably should just work:

  • Edit a submodule (could commit or not commit);
  • Compile;

[rustbuild] will wipe all the changes, potentially losing significant amount of work. I’ve seen this happen to multiple people over time. Instead you have to do this:

  • Edit a submodule;
  • Commit changes to the submodule;
  • Commit submodule update to the rustc repo;
  • Compile

Which is super unobvious and failure prone. Miss any of the steps and your changes are wiped. My proposal would be to not forcefully checkout the submodules if the following are true:

  • The working directory of the submodule is dirty;
  • Submodule is “ahead” of the commit that would otherwise be checked out;

Potentially printing a warning or whatever.

@nagisa nagisa added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jun 3, 2017
@ollie27
Copy link
Member

ollie27 commented Jun 4, 2017

You can add submodules = false to config.toml to disable the submodule handling. I assume the submodule handling is useful to someone but I just found it obnoxious and I'm perfectly capable of running git submodule update --init when I need to.

@nagisa
Copy link
Member Author

nagisa commented Jun 4, 2017

@ollie27 doesn’t help with rustbuild wiping out changes by default.

@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 27, 2017
@Mark-Simulacrum Mark-Simulacrum added this to the impl period milestone Sep 15, 2017
@aturon aturon removed this from the impl period milestone Sep 15, 2017
@Mark-Simulacrum
Copy link
Member

We need to remove/change these lines to do as @nagisa suggested above. I'm marking as needs-mentor, but if someone is familiar with git and would like to implement this, I'd be happy to review.

@jyn514
Copy link
Member

jyn514 commented Feb 3, 2023

Duplicate of #103485, which has been fixed :)

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. 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

5 participants