Skip to content

bootstrap submodule sync overwrites local changes #103485

Closed
@Aaron1011

Description

@Aaron1011

When bootstrap updates a submodule, it performs a hard reset, discarding all local changes:

rust/src/bootstrap/lib.rs

Lines 631 to 632 in 1481fd9

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));

This was a nasty surprise when I was editing my local src/llvm-project, and then did a git pull and ./x.py build.
Fortunately, I only had some extra debugging prints added, but there was no indication that my local changes would be overwritten.

We should require explicit confirmation before potentially deleting local changes like this.

Metadata

Metadata

Assignees

Labels

A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions