NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.58k stars 13.74k forks source link

Build of `rustup` fails in tests: Text file busy #142629

Open ivan opened 2 years ago

ivan commented 2 years ago

Describe the bug

I am unable to build rustup (in nixpkgs master) on a NixOS 21.05 machine running Linux 5.10.75-hardened1 and btrfs. I reproduced this on a second machine with the same kernel and use of btrfs.

The official Hydra does not have any problems building it: https://hydra.nixos.org/jobset/nixpkgs/trunk#tabs-jobs

When I build it, the tests fail with:

     Running tests/cli-self-upd.rs (target/x86_64-unknown-linux-gnu/release/deps/cli_self_upd-deeedca270fb782c)

running 45 tests
test as_rustup_setup ... FAILED
test install_but_rustup_sh_is_installed ... ok

[...]

failures:

---- as_rustup_setup stdout ----
inprocess: true
status: Some(0)
----- stdout

----- stderr

inprocess: true
status: Some(0)
----- stdout

----- stderr
info: auto-self-update mode set to 'disable'

thread 'as_rustup_setup' panicked at 'Unable to run test command: Os { code: 26, kind: ExecutableFileBusy, message: "Text file busy" }', tests/mock/clitools.rs:685:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    as_rustup_setup

test result: FAILED. 44 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 21.54s

error: test failed, to rerun pass '--test cli-self-upd'
builder for '/nix/store/0znfz3hpvmbvhal5gdvxx77phhcwmaxd-rustup-1.24.3.drv' failed with exit code 101

or


failures:

---- set_nightly_toolchain stdout ----
inprocess: true
status: Some(0)
----- stdout

----- stderr

inprocess: true
status: Some(0)
----- stdout

----- stderr
info: auto-self-update mode set to 'disable'

thread 'set_nightly_toolchain' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 26, kind: ExecutableFileBusy, message: "Text file busy" }', tests/cli-inst-interactive.rs:39:33
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    set_nightly_toolchain

test result: FAILED. 29 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 18.32s

error: test failed, to rerun pass '--test cli-inst-interactive'

Some full build logs:

I believe this is a regression in master from NixOS 21.05, where I did not have problems building rustup.

Notify maintainers

@Mic92

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.10.75-hardened1, NixOS, 21.05.git.4f613b46c63 (Okapi)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.16`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
Mic92 commented 2 years ago

Can someone else confirm that the rustup build breaks on btrfs?

symphorien commented 2 years ago

Builds for me (at da675ab0ef8ac399a2c022bbfaf7931b18b86831) on btrfs but non-hardened kernel:

ivan commented 2 years ago

Also, I don't know if parallelism matters, but both of my builds were done on 8+ core machines.

symphorien commented 2 years ago

I built on a 12-core machine.

stale[bot] commented 2 years ago

I marked this as stale due to inactivity. → More info

ivan commented 2 years ago

This is still happening for me on NixOS 21.11 on Ryzen 5950X + btrfs + regular (not hardened) kernel.

test updater_is_deleted_after_running_rustc ... ok
test update_installs_clippy_cargo_and ... ok
test updater_is_deleted_after_running_rustup ... ok
test updater_leaves_itself_for_later_deletion ... ok

failures:

---- as_rustup_setup stdout ----
inprocess: true
status: Some(0)
----- stdout

----- stderr

inprocess: true
status: Some(0)
----- stdout

----- stderr
info: auto-self-update mode set to 'disable'

thread 'as_rustup_setup' panicked at 'Unable to run test command: Os { code: 26, kind: ExecutableFileBusy, message: "Text file busy" }', tests/mock/clitools.rs:685:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    as_rustup_setup

test result: FAILED. 44 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 26.55s

error: test failed, to rerun pass '--test cli-self-upd'