Skip to content

thread 'main' panicked at src/bootstrap/src/utils/helpers.rs:441:5 #135041

Closed

Description

@psumbera

Build on Solaris fails with:

Submodule path 'src/doc/rust-by-example': checked out '093397535b48ae13ec76bc526b7e6eb8c096a85c'
thread 'main' panicked at src/bootstrap/src/utils/helpers.rs:441:5:
std::fs::read_dir(dir) failed with No such file or directory (os error 2)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:03:34

MIght be related to #134967 ?!

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 2, 2025
  2. added
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    on Jan 2, 2025
  3. jieyouxu commented on Jan 2, 2025

    @jieyouxu
    Member

    @psumbera does it repro if you git submodule deinit -f -all then try running the doc step again? Sometimes submodule checkouts can become funky, and the submodule can somehow become in a limbo state.

  4. onur-ozkan commented on Jan 2, 2025

    @onur-ozkan
    Contributor

    I assume you don't have some paths from .gitmodules file, which is not usual for building from source.

  5. added
    S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jan 2, 2025
  6. psumbera commented on Jan 3, 2025

    @psumbera
    ContributorAuthor

    I normally do just:
    git clone https://github.com/rust-lang/rust.git /builds/rust-lang
    Now when I do also:
    cd /builds/rust-lang && git submodule update --init --recursive
    it seems to build just fine...

    Is there documentation how to properly clone Rust for build? So far my way was working...

  7. jieyouxu commented on Jan 3, 2025

    @jieyouxu
    Member

    You should just be able to git clone without having to manually init submodules. ./x.py should automatically manage it for you, but sometimes submodule states can somehow become corrupted...

  8. added
    C-discussionCategory: Discussion or questions that doesn't represent real issues.
    and removed
    C-bugCategory: This is a bug.
    S-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.
    on Jan 3, 2025
  9. jieyouxu commented on Jan 3, 2025

    @jieyouxu
    Member

    FTR, I tried a fresh clone, and I wasn't able to repro (e.g. just ./x doc src/doc/rust-by-example, without manually init-ing submodules). I suspect you just got very unlucky with the submodule checkout. I'm going to close this as inactionable because we can't repro, but please re-open if this is still problematic for you.

  10. psumbera commented on Jan 3, 2025

    @psumbera
    ContributorAuthor

    Ok, it may be difference too. For historical reasons I'm still using:
    ./configure --default-linker=gcc --release-channel=$RELEASE --enable-extended --tools="cargo,rustfmt"
    gmake dist

  11. 1 remaining item

  12. joshtriplett commented on Jan 4, 2025

    @joshtriplett
    Member

    I'm encountering this issue as well, in a fresh Rust clone. Happy to try any diagnostic steps that might help.

    I wrote #135094 to make the error message more specific.

    With that, I see:

    std::fs::read_dir(dir) failed with No such file or directory (os error 2) ("/home/josh/src/rust2/src/tools/cargo/src/doc")
    
  13. joshtriplett commented on Jan 4, 2025

    @joshtriplett
    Member

    If I manually git submodule init src/tools/cargo and git submodule update, and then run ./x test again, it no longer hits this error.

  14. added
    C-bugCategory: This is a bug.
    and removed
    C-discussionCategory: Discussion or questions that doesn't represent real issues.
    on Jan 4, 2025
  15. jieyouxu commented on Jan 4, 2025

    @jieyouxu
    Member

    That is weird...

  16. joshtriplett commented on Jan 4, 2025

    @joshtriplett
    Member

    Any chance the mechanism added for #134967 is failing to handle the Cargo repository?

    If that isn't straightforward to debug, could we revert that until it's no longer causing this issue?

  17. jieyouxu commented on Jan 4, 2025

    @jieyouxu
    Member

    It's possible. @onur-ozkan do you know if we could somehow be not checking out the doc submodules I wonder?

  18. added
    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to Rust
    on Jan 4, 2025
  19. jieyouxu commented on Jan 4, 2025

    @jieyouxu
    Member

    Oh wait I see why, the submodule path can diverge with the primary path provided in doc step, I missed that during review. I'll send a PR after I cromch dinner.

    -    CargoBook, "src/tools/cargo/src/doc", "cargo", &[], submodule = "src/tools/cargo";
    +    CargoBook, "src/tools/cargo/src/doc", "cargo", &[];

    The filter logic tries to query src/tools/cargo/src/doc instead of src/tools/cargo.

  20. self-assigned this
    on Jan 4, 2025
  21. jieyouxu commented on Jan 4, 2025

    @jieyouxu
    Member

    I'm encountering this issue as well, in a fresh Rust clone. Happy to try any diagnostic steps that might help.

    I wrote #135094 to make the error message more specific.

    With that, I see:

    std::fs::read_dir(dir) failed with No such file or directory (os error 2) ("/home/josh/src/rust2/src/tools/cargo/src/doc")
    

    @joshtriplett I have a candidate fix, but could you spell out which exact invocation you used on the fresh checkout?

  22. jieyouxu commented on Jan 4, 2025

    @jieyouxu
    Member

    Actually nevermind I can on master:

    [19:11] Joe:rust (fresh) | ./x doc src/tools/cargo/src/doc
    Building bootstrap
        Finished `dev` profile [unoptimized] target(s) in 0.01s
    Updating submodule library/backtrace
    Submodule 'library/backtrace' (https://github.com/rust-lang/backtrace-rs.git) registered for path 'library/backtrace'
    Submodule path 'library/backtrace': checked out '4d7906bb24ae91ee6587127020d360f5298f9e7e'
    Updating submodule library/stdarch
    Submodule 'library/stdarch' (https://github.com/rust-lang/stdarch.git) registered for path 'library/stdarch'
    Submodule path 'library/stdarch': checked out '684de0d6fef708cae08214fef9643dd9ec7296e1'
    thread 'main' panicked at src/bootstrap/src/utils/helpers.rs:441:5:
    std::fs::read_dir(dir) failed with No such file or directory (os error 2)
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    Build completed unsuccessfully in 0:00:00
    
  23. jieyouxu commented on Jan 4, 2025

    @jieyouxu
    Member

    Any chance the mechanism added for #134967 is failing to handle the Cargo repository?

    If that isn't straightforward to debug, could we revert that until it's no longer causing this issue?

    I have a candidate fix in #135096.

  24. added a commit that references this issue on Jan 4, 2025
    ead4a8f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions