rust-lang / rust-lang/rust

`tests/ui/process/nofile-limit.rs` always fails locally for me

Open
#141,631 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-testsuite C-bug O-NixOS T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I'm not entirely sure if this is just a NixOS issue, but this is what I get every time when I try to run tests:

failures:

---- [ui] tests/ui/process/nofile-limit.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/beef/develop/rust1/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/beef/develop/rust1/tests/ui/process/nofile-limit.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/beef/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/beef/develop/rust1/vendor" "--sysroot" "/home/beef/develop/rust1/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-o" "/home/beef/develop/rust1/build/x86_64-unknown-linux-gnu/test/ui/process/nofile-limit/a" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/beef/develop/rust1/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Ctarget-feature=+crt-static" "-Crpath=no" "-Crelocation-model=static"
stdout: none
--- stderr -------------------------------
error: linking with `cc` failed: exit status: 1
   |
   = note:  "cc" "-m64" "/tmp/rustcx6Qynm/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*}.rlib" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-lgcc_eh" "-lgcc" "-lc" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{liballoc-*,librustc_std_workspace_core-*,libcore-*,libcompiler_builtins-*}.rlib" "-L" "/tmp/rustcx6Qynm/raw-dylibs" "-Wl,-Bdynamic" "-B<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,-znostart-stop-gc" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/beef/develop/rust1/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/beef/develop/rust1/build/x86_64-unknown-linux-gnu/test/ui/process/nofile-limit/a" "-Wl,--gc-sections" "-static" "-no-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
   = note: some arguments are omitted. use `--verbose` to show all linker arguments
   = note: rust-lld: error: unable to find library -lutil
           rust-lld: error: unable to find library -lrt
           rust-lld: error: unable to find library -lpthread
           rust-lld: error: unable to find library -lm
           rust-lld: error: unable to find library -ldl
           rust-lld: error: unable to find library -lc
           rust-lld: error: unable to find library -lc
           collect2: error: ld returned 1 exit status
           

error: aborting due to 1 previous error
------------------------------------------



failures:
    [ui] tests/ui/process/nofile-limit.rs

test result: FAILED. 18994 passed; 1 failed; 178 ignored; 0 measured; 0 filtered out; finished in 88.69s

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Build completed unsuccessfully in 0:02:35

This is my system information:

$ uname -a
Linux uwu 6.14.7 #1-NixOS SMP PREEMPT_DYNAMIC Sun May 18 06:26:10 UTC 2025 x86_64 GNU/Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/ui/process/nofile-limit.rs and the compiletest UI failure shown in the report. Reproduce the test on the reported NixOS environment, then trace the linker invocation and missing system libraries; done means the environment-specific cause and an actionable resolution are established.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, rust
Domain
build-system, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.