Skip to content

Commit

Permalink
cargo-raze: increase open file descriptors limits for tests on darwin
Browse files Browse the repository at this point in the history
https://hydra.nixos.org/build/239024688/nixlog/2
https://hydra.nixos.org/build/239009073/nixlog/2
```
thread '<unnamed>' panicked at 'Cannot build local tokio runtime: Os { code: 24, kind: Uncategorized, message: "Too many open files" }', /private/tmp/nix-build-cargo-raze-0.16.0.drv-0/cargo-raze-0.16.0-vendor.tar.gz/httpmock/src/lib.rs:1436:14
```

Seems to be a typical darwin failure, some packages already bump
file descriptors limit to 1024 (same as default in some Linux distros,
default darwin value seems to be 256 these days)

Also has a report upstream
google/cargo-raze#544

ZHF: NixOS#265948
  • Loading branch information
boltzmannrain committed Nov 13, 2023
1 parent 9ac9ea2 commit df4fef8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/development/tools/rust/cargo-raze/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ rustPlatform.buildRustPackage rec {
]
++ lib.optional stdenv.isDarwin Security;

preCheck = lib.optionalString stdenv.isDarwin ''
# Darwin issue: Os { code: 24, kind: Uncategorized, message: "Too many open files" }
# https://github.com/google/cargo-raze/issues/544
ulimit -n 1024
'';

__darwinAllowLocalNetworking = true;

meta = with lib; {
Expand Down

0 comments on commit df4fef8

Please sign in to comment.