Skip to content

thread 'main' panicked at 'rustc not found in /scratch/rustc/build/sparcv9/build/bootstrap/debug/deps, run cargo build --bins before cargo run', lib.rs:415:13 #112785

Closed
@psumbera

Description

@psumbera
Contributor

Rust 1.70 build on Solaris sometimes files on some machines:

Building tool rustfmt (stage2 -> stage3)
   Compiling cc v1.0.77
   Compiling camino v1.0.9
   Compiling rustfmt-nightly v1.5.2 (/scratch/psumbera/userland-test/components/rust/rustc/rustc-1.70.0-src/src/tools/rustfmt)
   Compiling yansi-term v0.1.2
   Compiling getopts v0.2.21
   Compiling unicode_categories v0.1.1
   Compiling unicode-segmentation v1.10.0
   Compiling diff v0.1.13
   Compiling bytecount v0.6.2
   Compiling dirs-sys-next v0.1.2
   Compiling dirs-sys v0.3.6
   Compiling rustfmt-config_proc_macro v0.3.0 (/scratch/psumbera/userland-test/components/rust/rustc/rustc-1.70.0-src/src/tools/rustfmt/config_proc_macro)
   Compiling derive-new v0.5.8
   Compiling env_logger v0.9.0
   Compiling cargo-platform v0.1.2
   Compiling toml v0.5.7
   Compiling dirs-next v2.0.0
   Compiling dirs v4.0.0
   Compiling annotate-snippets v0.9.1
   Compiling term v0.7.0
   Compiling cargo_metadata v0.14.0
   Compiling libz-sys v1.1.3
   Compiling rustc-workspace-hack v1.0.0 (/scratch/psumbera/userland-test/components/rust/rustc/rustc-1.70.0-src/src/tools/rustc-workspace-hack)
    Finished release [optimized] target(s) in 2m 41s
Build completed successfully in 2:11:14
Building bootstrap
    Finished dev [unoptimized] target(s) in 1.38s
warning: file locking not supported for target, not locking build directory
thread 'main' panicked at '`rustc` not found in /scratch/psumbera/userland-test/components/rust/rustc/build/sparcv9/build/bootstrap/debug/deps, run `cargo build --bins` before `cargo run`', lib.rs:415:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:02
make[1]: *** [Makefile:13: all] Error 1
make[1]: Leaving directory '/scratch/psumbera/userland-test/components/rust/rustc/build/sparcv9'
'/usr/gnu/bin/make' failed with error code 2!
Running a cleanup program to restore the state.
gmake[1]: Entering directory '/scratch/psumbera/userland-test/components/rust/rustc/build/sparcv9'
Building bootstrap
    Finished dev [unoptimized] target(s) in 1.25s
warning: file locking not supported for target, not locking build directory
thread 'main' panicked at '`rustc` not found in /scratch/psumbera/userland-test/components/rust/rustc/build/sparcv9/build/bootstrap/debug/deps, run `cargo build --bins` before `cargo run`', lib.rs:415:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:01
gmake[1]: *** [Makefile:25: clean] Error 1
gmake[1]: Leaving directory '/scratch/psumbera/userland-test/components/rust/rustc/build/sparcv9'
Failed to run cleanup program, terminating prematurely...

I wonder whether it can do something with: warning: file locking not supported for target, not locking build directory?!

Activity

jyn514

jyn514 commented on Jun 19, 2023

@jyn514
Member

are you running make in parallel? that's not supported on solaris (you made the PR removing the build locking IIRC).

added
T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
O-solarisOperating system: Solaris
on Jun 19, 2023
psumbera

psumbera commented on Jun 19, 2023

@psumbera
ContributorAuthor

I see it does: /usr/gnu/bin/make -j 16 -l 32.

I think I should look once again if it's possible make fd-lock to use fcntl locking (as it's now in `rustix...

You can close the bug. Thank you!

psumbera

psumbera commented on Jun 21, 2023

@psumbera
ContributorAuthor

Adding reference to main proble - fd-lock isn't supported on Solaris due missing flock() syscall).
#103630

psumbera

psumbera commented on Jun 21, 2023

@psumbera
ContributorAuthor

@jyn514 I'm confused now. I have seen the same error even with make -j 1 (just one ocurance, not two as mentioned above).

Also tried to dig closely how locking works and put into fd-lock some debug prints with process id and lock file name. But later when I was inspecting still running process it didn't have any lock file open. No file descriptor no lock?!

jyn514

jyn514 commented on Jun 21, 2023

@jyn514
Member

@psumbera did you clear the cache before running make -j1? if the build directory gets into an inconsistent state we don't recover it automatically.

i don't know what's going on with fd-lock, but the file that bootstrap locks is build/lock.

psumbera

psumbera commented on Jun 21, 2023

@psumbera
ContributorAuthor

@psumbera did you clear the cache before running make -j1? if the build directory gets into an inconsistent state we don't recover it automatically.

Everything is removed before new build...

jyn514

jyn514 commented on Jun 21, 2023

@jyn514
Member

exactly what command are you running and what is your config.toml?

reopened this on Jun 21, 2023
psumbera

psumbera commented on Jun 21, 2023

@psumbera
ContributorAuthor

i don't know what's going on with fd-lock, but the file that bootstrap locks is build/lock.

If I see it right, lock file is created/opened here:

build_lock = fd_lock::RwLock::new(t!(std::fs::File::create(&path)));

and the file descriptor for the lock file is closed on block exit here:

Isn't it mean that locking isn't working even on Linux?

jyn514

jyn514 commented on Jun 21, 2023

@jyn514
Member

no, it's declared outside the block

let _build_lock_guard;

psumbera

psumbera commented on Jun 21, 2023

@psumbera
ContributorAuthor

no, it's declared outside the block

let _build_lock_guard;

Right. Unfortunatelly version 1.70.0 hasn't fix for this (my) regression. And the declaration is still insde the block.

15 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-solarisOperating system: SolarisS-needs-reproStatus: This issue has no reproduction and needs a reproduction to make progress.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

      Participants

      @psumbera@jyn514@jieyouxu

      Issue actions

        thread 'main' panicked at '`rustc` not found in /scratch/rustc/build/sparcv9/build/bootstrap/debug/deps, run `cargo build --bins` before `cargo run`', lib.rs:415:13 · Issue #112785 · rust-lang/rust