-
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
x.py
submodule handling breaks when tracking upstream as upstream
#101144
Comments
Additional info: switching to a new branch that is not tracking upstream succeeds, so it is the upstream tracking that's messing something up: terminal session
|
My current working theory is that this is a git bug (maybe we can work around it though).
I think this is because git has created the submodule with a remote of I'm not sure what we should be doing to avoid this -- my guess is a proper fix would be in git itself... it might be that we can try to workaround it somehow, but I'm not seeing an obvious hook for us to attach to. |
Can we report this bug upstream to git? I think they use a mailing list? |
I was not able to reproduce this locally :/ I tried
and it checked out the submodules successfully. I'm using
|
For me this happens only sometimes. Most of the time when I checkout an old branch. I think I've got a reproduction (by checking out an old commit and pushing a branch to my fork), probably has unnecessary steps, but it seems to be "working" for me. ; git clone [email protected]:rust-lang/rust.git git-bug
; cd git-bug
; git remote add fork [email protected]:WaffleLapkin/rust.git # replace with your own fork
; x setup compiler
; x c compiler # (optionally) cancel after all submodules are fetched
; git checkout HEAD~5000
; git switch -c new_test_branch_so_maybe_the_bug_will_show_up
; git commit --allow-empty -m "it's a commit, nothing more, nothing less"
; git push -u fork
; x c compiler
Updating only changed submodules
Updating submodule src/tools/rust-installer
fatal: 'fork' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: Fetched in submodule path 'src/tools/rust-installer', but it did not contain d66f476b4d5e7fdf1ec215c9ac16c923dc292324. Direct fetching of that commit failed.
Traceback (most recent call last):
File "/home/waffle/projects/repos/git-bug/x.py", line 11, in <module>
bootstrap.main()
File "/home/waffle/projects/repos/git-bug/src/bootstrap/bootstrap.py", line 1009, in main
bootstrap(help_triggered)
File "/home/waffle/projects/repos/git-bug/src/bootstrap/bootstrap.py", line 969, in bootstrap
build.update_submodules()
File "/home/waffle/projects/repos/git-bug/src/bootstrap/bootstrap.py", line 845, in update_submodules
self.update_submodule(module[0], module[1], recorded_submodules)
File "/home/waffle/projects/repos/git-bug/src/bootstrap/bootstrap.py", line 797, in update_submodule
run(update_args, cwd=self.rust_root, verbose=self.verbose, exception=True)
File "/home/waffle/projects/repos/git-bug/src/bootstrap/bootstrap.py", line 143, in run
raise RuntimeError(err)
RuntimeError: failed to run: git submodule update --init --recursive --progress src/tools/rust-installer
git version: ; git --version --build-options
git version 2.37.3
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh |
To make @WaffleLapkin's steps reproducible - HEAD is currently 750bd1a |
Oh lol, I just ran into this today. A bit more info:
|
On the bright side, this means it's easy to work around the bug.
|
ah hmm, after doing that I can no longer reproduce the bug ... I think this might only happen on the very first submodule we try to clone? git is acting so strangely ... this happens even in a fresh worktree, it's only when it's a fresh clone it hits this problem, which makes no sense to me since submodules aren't shared between worktrees. Anyway, here's a minimal reproduction that doesn't depend on exactly which commit you're using, or
I'll put up a PR shortly. |
This works around a bug in git itself; see rust-lang#101144.
This works around a bug in git itself; see rust-lang#101144.
…ark-Simulacrum Pass `branch.{branch}.remote=origin` to `git submodule update` This works around a bug in git itself. Fixes rust-lang#101144.
git --version --build-options
Example:
D:\tmp〉git clone [email protected]:rust-lang/rust.git -o upstream
D:\tmp〉cd rust
〉master:rust〉python ./x.py setup
(continued)
〉master:rust〉git show-ref HEAD
@rustbot label +C-bug +A-bootstrap
The text was updated successfully, but these errors were encountered: