Open TheButlah opened 2 years ago
Transferred to rust-lang/rust as this appears to be an error originating in rustc during linking.
Some environments set a fairly low (1024) soft ulimit for open files while having a higher hard limit, you can try bumping it
# check current soft limit
ulimit -n
# check hard limit
ulimit -Hn
# set new soft limit
ulimit -n 4096
@TheButlah does the above suggestion work?
I am not able to test unfortuantely - I no longer work on that codebase. However, the code became available here: https://github.com/tomthecarrot/constellation/.
The ulimit fix sounds quite likely to resolve it. It would be nice however, if rustc could detect the limit and not try to open more files than that.
I am not able to test unfortuantely - I no longer work on that codebase.
:+1:
It would be nice however, if rustc could detect the limit and not try to open more files than that.
Or alternatively raise the limit to match the hard limit. The soft limit only exists for compatibility with programs that use the select
syscall which fails for fd's higher than 1023. Systemd raises the hard limit to a very high number (1048576) by default to allow programs that don't use select
to raise their soft limit as necessary.
Problem
I was compiling my code with
cargo test name_of_test
, and got the following error:I did a
cargo clean
and rebuilt, and it happened again. Then I just did a regularcargo test name_of_test
and it succeeded.Steps
I cannot post the original code or the full dependency tree, as it is proprietary. However, here is the dependency tree with closed source crates redacted:
Possible Solution(s)
No response
Notes
Version
Running inside of WSL2 on build 19044.1706 of windows 10 pro.
My CPU has 12 cores/24 threads