Skip to content

Bootstrap fails to build when switching between submodule and subtree #72104

Open
@jethrogb

Description

@jethrogb

When switching between git trees where one contains clippy as a submodule and one contains clippy in tree, x.py fails to initialize the submodule correctly in some cases, resulting in a failed build. For example:

git clone https://github.com/jethrogb/rust/ -b clippy-submodule
cd rust
./x.py help
git checkout -f clippy-tree
./x.py help
git checkout -f -
./x.py help
error: failed to read `/tmp/rust/src/tools/clippy/Cargo.toml`

Caused by:
  No such file or directory (os error 2)
failed to run: /tmp/rust/build/x86_64-unknown-linux-gnu/stage0/bin/cargo build --manifest-path /tmp/rust/src/bootstrap/Cargo.toml

Full output: xpy-clippy.txt

/tmp/rust/src/tools/clippy/Cargo.toml should be in the clippy submodule but it's not checked out correctly. If I do git reset --hard inside the submodule, it works fine.

related #63964

@rustbot modify labels +A-rustbuild

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-dev-toolsRelevant to the dev-tools subteam, 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