Skip to content

Commit

Permalink
fix(boot): fix env vars when finding out concurrency
Browse files Browse the repository at this point in the history
We were passing an empty enviornment to Unix.open_process_full_cmd
before. We now pass the full available UNix.environment since we are
only querying the concurrency by calling nproc or getconf.

On NixOS this was causing the bootstrap to default to a single
processor since nproc wasn't available in the empty environment.

Signed-off-by: Ali Caglayan <[email protected]>

<!-- ps-id: d620baf8-5e58-4212-8f30-df69780a614b -->
  • Loading branch information
Alizter committed Mar 11, 2023
1 parent 82df8da commit 2af6b80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Unreleased
----------

- Fix the detection of the number of processors in a clean enviornment when
bootstrapping (#7272, @Alizter)

- Speed up file copying on macos by using `clonefile` when available
(@rgrinberg, #7210)

Expand Down
2 changes: 1 addition & 1 deletion boot/duneboot.ml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ let exe = if Sys.win32 then ".exe" else ""

let concurrency =
let try_run_and_capture_line cmd =
let ic, oc, ec = Unix.open_process_full cmd [||] in
let ic, oc, ec = Unix.open_process_full cmd (Unix.environment ()) in
let line =
match input_line ic with
| s -> Some s
Expand Down

0 comments on commit 2af6b80

Please sign in to comment.