-
Notifications
You must be signed in to change notification settings - Fork 13k
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
bootstrap submodule sync overwrites local changes #103810
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon. Please see the contribution instructions for more information. |
r? @jyn514 @pratushrai0309 how have you tested this change? |
@jyn514 Can you explain what's the intended result should be? |
@jyn514 After adding the git commands I run x.py build and my local changes to bootstrap/lib.rs were not overwritten |
Can you test with changes to the llvm-project submodule as well? |
Ok |
@jyn514 I tried to add few debug messages in few llvm-project submodule files and when I run |
@nagisa @Aaron1011 can you cherry-pick these commits and see if it behaves about how you'd expect when modifying llvm? |
src/bootstrap/lib.rs
Outdated
@@ -628,8 +628,10 @@ impl Build { | |||
self.run(&mut update(false)); | |||
} | |||
|
|||
self.run(Command::new("git").args(&["stash", "save"]).current_dir(&absolute_path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider using git stash push
instead of get stash save
. From the manual:
save [-p|--patch] [-S|--staged] [-k|--[no-]keep-index] [-u|--include-untracked] [-a|--all] [-q|--quiet] []
This option is deprecated in favour of git stash push. It differs from "stash push" in that it cannot take pathspec. Instead, all non-option arguments are concatenated to form the stash message.
src/bootstrap/lib.rs
Outdated
self.run(Command::new("git").args(&["reset", "-q", "--hard"]).current_dir(&absolute_path)); | ||
self.run(Command::new("git").args(&["clean", "-qdfx"]).current_dir(absolute_path)); | ||
self.run(Command::new("git").args(&["clean", "-qdfx"]).current_dir(&absolute_path)); | ||
self.run(Command::new("git").args(&["stash", "apply"]).current_dir(absolute_path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess git stash pop
is more useful here:
apply [--index] [-q|--quiet] []
Like pop, but do not remove the state from the stash list. Unlike pop, may be any commit that looks like a commit created by stash push or stash create.
I don't want to have a new stash item whenever running x.py
. When it as applied successfully, it should be removed.
Please also keep in mind that applying a stash can fail due to merge conflicts!
I tried this out. Couple examples:
Overall, after these experiments I’m not entirely sure if stash-pop are the right way to go. In particular, it seems to me that we could just drop the Unfortunately there are no comments to explain the purpose of I think what we may want to do is instead adding an option to the configuration file that would enable/disable the
Perhaps? It is pretty clear to me that we need to figure out what we really want the behaviour to be, because the current list of wants and needs is somewhat ill-defined. |
What would be the purpose of the option? What advantage is there to using reset?
👍 That makes sense to me - do you have time to try out that change? No worries if not, the commands you posted here are very helpful to replicate your testing :) |
I’m not actually sure what the I would also say that in practice the local changes only make sense to preserve if they were made recently. If I pull out my experiments checkout from 3 months ago, and attempt to build master, various changes made back then are probably gonna be a pain. Having a shortcut to clean up the checkout would be nice too. Maybe it could be an |
@nagisa I want to avoid expanding the scope here too much. I agree with all the things you mentioned but I'm not sure how common they are in practice; I want to be respectful of @pratushrai0309's time and I certainly don't have time to work on them myself. @pratushrai0309 if you change the commands here to use |
This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri A change occurred in the Ayu theme. cc @Cldfire Some changes occurred in compiler/rustc_codegen_gcc cc @antoyo Some changes occurred in src/librustdoc/clean/types.rs cc @camelid Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred in HTML/CSS themes.
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @Folyd, @jsha Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
Some changes occurred in const_evaluatable.rs cc @lcnr Some changes occurred in src/tools/cargo cc @ehuss The Miri subtree was changed cc @rust-lang/miri Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki These commits modify compiler targets. rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
Fixes #103485