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

x.py could handle submodule checkout failure more gracefully #80498

Closed
matthiaskrgr opened this issue Dec 30, 2020 · 3 comments
Closed

x.py could handle submodule checkout failure more gracefully #80498

matthiaskrgr opened this issue Dec 30, 2020 · 3 comments
Assignees
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-bug Category: This is a bug. 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

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Dec 30, 2020

If x.py can't check out the right commit of a submodule because the submodule has local edits that would be overwritten by the checkout, it crashes:


Updating only changed submodules
Updating submodule src/tools/rls
error: Your local changes to the following files would be overwritten by checkout:
	.dependabot/config.yml
Please commit your changes or stash them before you switch branches.
Aborting
Unable to checkout '2cf84baa5e3c55ac02f42919e67440acb5417125' in submodule path 'src/tools/rls'
Traceback (most recent call last):
  File "./x.py", line 11, in <module>
    bootstrap.main()
  File "/home/matthias/vcs/github/rust/src/bootstrap/bootstrap.py", line 1094, in main
    bootstrap(help_triggered)
  File "/home/matthias/vcs/github/rust/src/bootstrap/bootstrap.py", line 1060, in bootstrap
    build.update_submodules()
  File "/home/matthias/vcs/github/rust/src/bootstrap/bootstrap.py", line 924, in update_submodules
    self.update_submodule(module[0], module[1], recorded_submodules)
  File "/home/matthias/vcs/github/rust/src/bootstrap/bootstrap.py", line 866, in update_submodule
    run(update_args, cwd=self.rust_root, verbose=self.verbose, exception=True)
  File "/home/matthias/vcs/github/rust/src/bootstrap/bootstrap.py", line 153, in run
    raise RuntimeError(err)
RuntimeError: failed to run: git submodule update --init --recursive --progress src/tools/rls

Perhaps this could be handled more gracefully (with some hints on how to revert the changes to the submodule, perhaps?)

@matthiaskrgr matthiaskrgr added the C-bug Category: This is a bug. label Dec 30, 2020
@jyn514 jyn514 added A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Dec 30, 2020
@akshatagarwl
Copy link

@rustbot claim

@yuvaldolev
Copy link
Contributor

@rustbot claim

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 1, 2021
…t-more-gracefully, r=Mark-Simulacrum

Handling submodule update failures more gracefully from x.py

Addresses rust-lang#80498

Handling the case where x.py can't check out the right commit of a submodule, because the submodule has local edits that would be overwritten by the checkout, more gracefully.
The error is printed in detail, with some hints on how to revert the local changes to the submodule.
@TmLev
Copy link
Contributor

TmLev commented Dec 3, 2021

Should this be closed now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-bug Category: This is a bug. 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

6 participants