Skip to content

Commit

Permalink
Reduce timeout passed to repository_ctx.execute
Browse files Browse the repository at this point in the history
The old value was 2^30, the new value is 100 days.

On macOS a too large timeout can lead to the error

```
ERROR: An error occurred during the fetch of repository 'node_nix':
   Traceback (most recent call last):
        File "/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 149
                _execute_or_fail(repository_ctx, <3 more arguments>)
        File "/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 318, in _execute_or_fail
                fail(<1 more arguments>)

Cannot build Nix attribute 'nodejs'.
Command: [/Users/runner/.nix-profile/bin/nix-build, /private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/node_nix/nix/bazel.nix, "-A", "nodejs", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/private/var/tmp/_bazel_runner/17d2b3954f1c6dcf5414d5453467df9a/external/nixpkgs/nixpkgs"]
Return code: 1
Error output:
src/main/tools/process-tools.cc:173: "setitimer": Invalid argument
```

See tweag#92
  • Loading branch information
aherrmann committed Oct 24, 2019
1 parent 546aa58 commit 0167ef5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nixpkgs/nixpkgs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ def _nixpkgs_package_impl(repository_ctx):

# Large enough integer that Bazel can still parse. We don't have
# access to MAX_INT and 0 is not a valid timeout so this is as good
# as we can do.
timeout = 1073741824
# as we can do. The value shouldn't be too large to avoid errors on
# macOS, see https://github.com/tweag/rules_nixpkgs/issues/92.
timeout = 8640000
exec_result = _execute_or_fail(
repository_ctx,
nix_build,
Expand Down

0 comments on commit 0167ef5

Please sign in to comment.