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

rust-1.74.0-beta fails to execute x.py install with: thread 'main' panicked at install.rs:59:17 - Failed the write access check for the current user. No such file or directory #117203

Closed
stefson opened this issue Oct 26, 2023 · 16 comments · Fixed by #117383
Assignees
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@stefson
Copy link

stefson commented Oct 26, 2023

hey everyone, I get this message from x.py when install is executed:


       Fresh bootstrap v0.0.0 (/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/src/bootstrap)
    Finished dev [unoptimized] target(s) in 0.50s
running: /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/bootstrap/debug/bootstrap install -vv --config=/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/config.toml -j12
warning: x.py has made several changes recently you may want to look at
help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`
note: to silence this warning, add `changelog-seen = 2` at the top of `config.toml`
finding compilers
CC_x86_64-gentoo-linux-musl = "x86_64-gentoo-linux-musl-gcc"
CFLAGS_x86_64-gentoo-linux-musl = ["-ffunction-sections", "-fdata-sections", "-fPIC", "-m64", "-pipe"]
CXX_x86_64-gentoo-linux-musl = "x86_64-gentoo-linux-musl-g++"
CXXFLAGS_x86_64-gentoo-linux-musl = ["-ffunction-sections", "-fdata-sections", "-fPIC", "-m64", "-pipe"]
AR_x86_64-gentoo-linux-musl = "x86_64-gentoo-linux-musl-ar"
running sanity check
learning about cargo
> Assemble { target_compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl } }
  > Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
    > Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
    < Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
    > Rustc { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, crates: [] }
      > Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
        > StartupObjects { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        < StartupObjects { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
        > Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
          > Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage0-sysroot to avoid caching bugs
          < Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage0-sysroot/lib/rustlib/x86_64-gentoo-linux-musl/lib to avoid caching bugs
          c Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
        < Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
        c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
        > StdLink { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
          c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
          c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        < StdLink { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
      < Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
      c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
      c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
      c Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
      c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
      > Llvm { target: x86_64-gentoo-linux-musl }
      < Llvm { target: x86_64-gentoo-linux-musl }
      c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
      > RustcLink { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [] }
        c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      < RustcLink { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [] }
    < Rustc { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, crates: [] }
    > Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage1 to avoid caching bugs
    < Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    > Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage1/lib/rustlib/x86_64-gentoo-linux-musl/lib to avoid caching bugs
    < Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    c Llvm { target: x86_64-gentoo-linux-musl }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
  < Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
  > Rustc { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [] }
    > Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
      > StartupObjects { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      < StartupObjects { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
      c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
      c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
      c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
      c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
      > StdLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
        c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      < StdLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
    < Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
    c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
    c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
    c Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
    c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Llvm { target: x86_64-gentoo-linux-musl }
    c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
    > RustcLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [] }
      c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    < RustcLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [] }
  < Rustc { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [] }
  > Sysroot { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage2 to avoid caching bugs
  < Sysroot { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, force_recompile: false }
  c Sysroot { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, force_recompile: false }
  c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
  > Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    c Sysroot { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage2/lib/rustlib/x86_64-gentoo-linux-musl/lib to avoid caching bugs
  < Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
  c Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
  c Llvm { target: x86_64-gentoo-linux-musl }
  c Sysroot { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, force_recompile: false }
< Assemble { target_compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl } }
> Std { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
  > Std { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    > Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
      > StartupObjects { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      < StartupObjects { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
      c Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
      c Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      > StdLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
        c Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      < StdLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
    < Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
    c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
    c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
    > RustInstaller { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      > ToolBuild { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, tool: "rust-installer", path: "src/tools/rust-installer", mode: ToolBootstrap, is_optional_tool: false, source_type: InTree, extra_features: [], allow_features: "" }
        c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
        c Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
      < ToolBuild { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, tool: "rust-installer", path: "src/tools/rust-installer", mode: ToolBootstrap, is_optional_tool: false, source_type: InTree, extra_features: [], allow_features: "" }
    < RustInstaller { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
  < Std { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
thread 'main' panicked at install.rs:59:17:
Failed the write access check for the current user. No such file or directory (os error 2)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/./x.py", line 50, in <module>
    bootstrap.main()
  File "/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 1121, in main
    bootstrap(args)
  File "/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 1097, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 187, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/bootstrap/debug/bootstrap install -vv --config=/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/config.toml -j12

It seems there are some backports still missing for beta, since I can fix this by reverting #116127 locally, and there are some subsequent fixes in nightly who seemed to have fixed the issue for good.

So, is there somewhere a list of the nightly backports needed to fix this problem? Thanks.

@stefson stefson added the C-bug Category: This is a bug. label Oct 26, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Oct 26, 2023
@stefson
Copy link
Author

stefson commented Oct 27, 2023

@nikic can I ping you on this? Beta is not compiling on gentoo, I assume at least one patch from nightly still needs to be backported to beta.

@saethlin saethlin added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Oct 29, 2023
@onur-ozkan
Copy link
Member

onur-ozkan commented Oct 29, 2023

There is #116349 that should have fixed that and it's beta-nominated.

@stefson
Copy link
Author

stefson commented Oct 30, 2023

Hi, I'm on latest beta from last week. If I apply #116349 locally and compile, I get access denied error:

running: /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/bootstrap/debug/bootstrap install -vv --config=/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/config.toml -j12
warning: x.py has made several changes recently you may want to look at
help: consider looking at the changes in `src/bootstrap/CHANGELOG.md`
note: to silence this warning, add `changelog-seen = 2` at the top of `config.toml`
finding compilers
CC_x86_64-gentoo-linux-musl = "x86_64-gentoo-linux-musl-gcc"
CFLAGS_x86_64-gentoo-linux-musl = ["-ffunction-sections", "-fdata-sections", "-fPIC", "-m64", "-pipe"]
CXX_x86_64-gentoo-linux-musl = "x86_64-gentoo-linux-musl-g++"
CXXFLAGS_x86_64-gentoo-linux-musl = ["-ffunction-sections", "-fdata-sections", "-fPIC", "-m64", "-pipe"]
AR_x86_64-gentoo-linux-musl = "x86_64-gentoo-linux-musl-ar"
running sanity check
learning about cargo
> Assemble { target_compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl } }
  > Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
    > Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
    < Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
    > Rustc { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, crates: [] }
      > Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
        > StartupObjects { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        < StartupObjects { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
        > Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
          > Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage0-sysroot to avoid caching bugs
          < Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage0-sysroot/lib/rustlib/x86_64-gentoo-linux-musl/lib to avoid caching bugs
          c Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
        < Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
        c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
        > StdLink { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
          c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
          c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        < StdLink { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
      < Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
      c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
      c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
      c Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
      c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
      > Llvm { target: x86_64-gentoo-linux-musl }
      < Llvm { target: x86_64-gentoo-linux-musl }
      c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
      > RustcLink { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [] }
        c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      < RustcLink { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [] }
    < Rustc { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, crates: [] }
    > Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage1 to avoid caching bugs
    < Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    > Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage1/lib/rustlib/x86_64-gentoo-linux-musl/lib to avoid caching bugs
    < Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    c Llvm { target: x86_64-gentoo-linux-musl }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
  < Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
  > Rustc { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [] }
    > Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
      > StartupObjects { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      < StartupObjects { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
      c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
      c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
      c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
      c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
      > StdLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
        c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      < StdLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
    < Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
    c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
    c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
    c Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
    c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Sysroot { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, force_recompile: false }
    c Llvm { target: x86_64-gentoo-linux-musl }
    c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
    > RustcLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [] }
      c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    < RustcLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [] }
  < Rustc { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [] }
  > Sysroot { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage2 to avoid caching bugs
  < Sysroot { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, force_recompile: false }
  c Sysroot { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, force_recompile: false }
  c Libdir { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
  > Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    c Sysroot { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, force_recompile: false }
Removing sysroot /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/x86_64-gentoo-linux-musl/stage2/lib/rustlib/x86_64-gentoo-linux-musl/lib to avoid caching bugs
  < Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
  c Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
  c Llvm { target: x86_64-gentoo-linux-musl }
  c Sysroot { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, force_recompile: false }
< Assemble { target_compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl } }
> Std { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
  > Std { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    > Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
      > StartupObjects { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      < StartupObjects { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
      c Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
      c Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      > StdLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
        c Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Libdir { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      < StdLink { compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl }, target_compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, crates: [], force_recompile: false }
    < Std { target: x86_64-gentoo-linux-musl, compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, crates: [], force_recompile: false }
    c Assemble { target_compiler: Compiler { stage: 1, host: x86_64-gentoo-linux-musl } }
    c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
    > RustInstaller { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
      > ToolBuild { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, tool: "rust-installer", path: "src/tools/rust-installer", mode: ToolBootstrap, is_optional_tool: false, source_type: InTree, extra_features: [], allow_features: "" }
        c Libdir { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
        c Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
        c Sysroot { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, force_recompile: false }
      < ToolBuild { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl, tool: "rust-installer", path: "src/tools/rust-installer", mode: ToolBootstrap, is_optional_tool: false, source_type: InTree, extra_features: [], allow_features: "" }
    < RustInstaller { compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
    c Assemble { target_compiler: Compiler { stage: 0, host: x86_64-gentoo-linux-musl } }
  < Std { compiler: Compiler { stage: 2, host: x86_64-gentoo-linux-musl }, target: x86_64-gentoo-linux-musl }
 * ACCESS DENIED:  mkdir:              /usr/lib/rust/1.74.0_beta
thread 'main' panicked at install.rs:78:5:
User doesn't have write access on `install.prefix` path in the `config.toml`.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/./x.py", line 50, in <module>
    bootstrap.main()
  File "/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 1121, in main
    bootstrap(args)
  File "/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 1097, in bootstrap
    run(args, env=env, verbose=build.verbose, is_bootstrap=True)
  File "/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/src/bootstrap/bootstrap.py", line 187, in run
    raise RuntimeError(err)
RuntimeError: failed to run: /var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/build/bootstrap/debug/bootstrap install -vv --config=/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc-beta-src/config.toml -j12

@onur-ozkan
Copy link
Member

onur-ozkan commented Oct 30, 2023

 * ACCESS DENIED:  mkdir:              /usr/lib/rust/1.74.0_beta
thread 'main' panicked at install.rs:78:5:
User doesn't have write access on `install.prefix` path in the `config.toml`.

Logs says you don't have permission to put files into install.prefix path from your build configuration. Without #116349 you would still get permission error.

@stefson
Copy link
Author

stefson commented Oct 30, 2023

I believe this is a sandbox error, so x.py install tries to write to / instead of it's prefix, and this is caused either by #116349 or it was already introduced by the older #116127

If I revert them both locally, I get a working x.py install

@onur-ozkan
Copy link
Member

Interesting 🤔 Can you share your build configuration?

@stefson
Copy link
Author

stefson commented Oct 30, 2023

it basically does this:

DESTDIR="${D}" "${EPYTHON}" ./x.py install -vv --config="${S}"/config.toml -j$(makeopts_jobs) || die

which translates to:

DESTDIR="/var/tmp/portage/dev-lang/rust-1.74.0_beta/image/" python3.11 ./x.py install -vv --config="/var/tmp/portage/dev-lang/rust-1.74.0_beta/work/rustc_beta-src/config.toml" -j12 || die

and the patch seems to make x.py ignore the DESTDIR="" command

In the rust context, the build config you asked me to share is the config.toml? Have it attached for you, please feel free to ask for any additional information.
config.toml.gz

also I can provide you with the full build log: build.log.gz

@onur-ozkan
Copy link
Member

If I revert them both locally, I get a working x.py install

Did you wait for whole process(x.py install) to be finished? I don't understand how mkdir gets you into access denied error for /usr/lib/rust/1.74.0_beta path while you can actually create dirs/files in it..

@stefson
Copy link
Author

stefson commented Oct 30, 2023

Maybe there is some confusion about relative and absolute path? The access denied error is valid, as x.py never should mess with /usr/lib/ in install, but use /var/tmp/portage/dev-lang/rust-1.74.0_beta/image/ as it's prefix, if you want to name it like that.

@onur-ozkan onur-ozkan self-assigned this Oct 30, 2023
@onur-ozkan
Copy link
Member

True, there is a confusion between prefix and DESTDIR right now. I will fix it today.

@stefson
Copy link
Author

stefson commented Oct 30, 2023

Thank you, I'm happy to test any patch before you commit it to master.

@onur-ozkan
Copy link
Member

Thank you, I'm happy to test any patch before you commit it to master.

You can test #117383

@stefson
Copy link
Author

stefson commented Oct 30, 2023

yes this works for me, please also beta nominate

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 30, 2023
…larsan68

improve and fix `x install`

Fix: Write access check of `prefix` and `sysconfdir` when DESTDIR is present.

Improvement: Instead of repeatedly reading `DESTDIR` within each `fn prepare_dir` usage, read it once and pass it to the `fn prepare_dir`.

Fixes rust-lang#117203
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 30, 2023
…larsan68

improve and fix `x install`

Fix: Write access check of `prefix` and `sysconfdir` when DESTDIR is present.

Improvement: Instead of repeatedly reading `DESTDIR` within each `fn prepare_dir` usage, read it once and pass it to the `fn prepare_dir`.

Fixes rust-lang#117203
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Oct 30, 2023
…larsan68

improve and fix `x install`

Fix: Write access check of `prefix` and `sysconfdir` when DESTDIR is present.

Improvement: Instead of repeatedly reading `DESTDIR` within each `fn prepare_dir` usage, read it once and pass it to the `fn prepare_dir`.

Fixes rust-lang#117203
@bors bors closed this as completed in c994bdb Oct 30, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Oct 30, 2023
Rollup merge of rust-lang#117383 - onur-ozkan:fix-x-install, r=albertlarsan68

improve and fix `x install`

Fix: Write access check of `prefix` and `sysconfdir` when DESTDIR is present.

Improvement: Instead of repeatedly reading `DESTDIR` within each `fn prepare_dir` usage, read it once and pass it to the `fn prepare_dir`.

Fixes rust-lang#117203
@stefson
Copy link
Author

stefson commented Nov 6, 2023

@onur-ozkan has this been beta-nominated? I'm new to this process, it's just I can't see a rollup pullrequest anywhere and the release of 1.74.0 is coming closer every day.

@onur-ozkan
Copy link
Member

@onur-ozkan has this been beta-nominated? I'm new to this process, it's just I can't see a rollup pullrequest anywhere and the release of 1.74.0 is coming closer every day.

It is #117383 (comment).

cc @rust-lang/release

@cuviper
Copy link
Member

cuviper commented Nov 6, 2023

@onur-ozkan for backport, the PR's responsible team (T-bootstrap) also needs to label it beta-accepted. Once it has both labels, the release team will handle the actual backport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants