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

bootstrap core::builder::tests::dist::dist_only_cross_host fails locally #133729

Closed
jieyouxu opened this issue Dec 2, 2024 · 1 comment
Closed
Labels
A-git Area: `git`-related shenanigans (usually bootstrap related) T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jieyouxu
Copy link
Member

jieyouxu commented Dec 2, 2024

EDIT: I figured it out, it's because my local src/tools/cargo submodule was very corrupted, I had to rm -rf the submodule's .git folder and config and also remove a lock on .gitignore because yeah. Opening an issue in case someone else ever runs into this so it shows up in search results.


I'm on x86_64-unknown-linux-gnu (wsl), and this bootstrap unit tests seemingly failed locally (I am working on unrelated changes AFAIK):

---- core::builder::tests::dist::dist_only_cross_host stdout ----
thread 'core::builder::tests::dist::dist_only_cross_host' panicked at src/lib.rs:1567:20:
fs::read_to_string(toml_file_name) failed with No such file or directory (os error 2)
stack backtrace:
   0: rust_begin_unwind
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/core/src/panicking.rs:76:14
   2: bootstrap::Build::release_num
             at ./src/utils/helpers.rs:37:23
   3: bootstrap::utils::tarball::OverlayKind::version
             at ./src/utils/tarball.rs:84:54
   4: bootstrap::utils::tarball::Tarball::run
             at ./src/utils/tarball.rs:316:65
   5: bootstrap::utils::tarball::Tarball::generate
             at ./src/utils/tarball.rs:244:9
   6: <bootstrap::core::build_steps::dist::Cargo as bootstrap::core::builder::Step>::run
             at ./src/core/build_steps/dist.rs:1120:14
   7: bootstrap::core::builder::Builder::ensure
             at ./src/core/builder/mod.rs:1455:23
   8: <bootstrap::core::build_steps::dist::Cargo as bootstrap::core::builder::Step>::make_run
             at ./src/core/build_steps/dist.rs:1092:9
   9: bootstrap::core::builder::StepDescription::maybe_run
             at ./src/core/builder/mod.rs:388:13
  10: bootstrap::core::builder::StepDescription::run
             at ./src/core/builder/mod.rs:438:21
  11: bootstrap::core::builder::Builder::run_step_descriptions
             at ./src/core/builder/mod.rs:1167:9
  12: bootstrap::core::builder::tests::run_build
             at ./src/core/builder/tests.rs:58:5
  13: bootstrap::core::builder::tests::dist::dist_only_cross_host
             at ./src/core/builder/tests.rs:444:25
  14: bootstrap::core::builder::tests::dist::dist_only_cross_host::{{closure}}
             at ./src/core/builder/tests.rs:437:30
  15: core::ops::function::FnOnce::call_once
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/core/src/ops/function.rs:250:5
  16: core::ops::function::FnOnce::call_once
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.


failures:
    core::builder::tests::dist::dist_only_cross_host
@jieyouxu jieyouxu added A-git Area: `git`-related shenanigans (usually bootstrap related) T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Dec 2, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 2, 2024
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Dec 2, 2024
@jieyouxu
Copy link
Member Author

jieyouxu commented Dec 2, 2024

Documented in dev-guide via rust-lang/rustc-dev-guide#2152: https://rustc-dev-guide.rust-lang.org/git.html#overcoming-fatal-not-a-git-repository-submodulegitmodulessubmodule

Sometimes, for some forsaken reason, you might run into

fatal: not a git repository: src/gcc/../../.git/modules/src/gcc

In this situation, for the given submodule path, i.e. <submodule_path> = src/gcc in this example, you need to:

  1. rm -rf <submodule_path>/.git
  2. rm -rf .git/modules/<submodule_path>/config
  3. rm -rf .gitconfig.lock if somehow the .gitconfig lock is orphaned.

Then do something like ./x fmt to have bootstrap manage the submodule checkouts for you.

@jieyouxu jieyouxu closed this as completed Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: `git`-related shenanigans (usually bootstrap related) 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

2 participants