From e0532dd87c099ddfe20c53c8a2bc860ab6f90355 Mon Sep 17 00:00:00 2001 From: Et7f3 Date: Fri, 21 Oct 2022 11:17:11 +0200 Subject: [PATCH] ocamlPackages.carton: Tests require getconf https://github.com/mirage/ocaml-git/blob/471406dde6c3056ea49547de379fef12871da48b/bin/fiber/fiber.ml#L132 --- .../ocaml-modules/carton/carton-find-getconf.patch | 13 +++++++++++++ pkgs/development/ocaml-modules/carton/default.nix | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 pkgs/development/ocaml-modules/carton/carton-find-getconf.patch diff --git a/pkgs/development/ocaml-modules/carton/carton-find-getconf.patch b/pkgs/development/ocaml-modules/carton/carton-find-getconf.patch new file mode 100644 index 000000000000..8c7176ee16c8 --- /dev/null +++ b/pkgs/development/ocaml-modules/carton/carton-find-getconf.patch @@ -0,0 +1,13 @@ +diff --git a/bin/fiber/fiber.ml b/bin/fiber/fiber.ml +index 188a92cc9..6087a8687 100644 +--- a/bin/fiber/fiber.ml ++++ b/bin/fiber/fiber.ml +@@ -129,7 +129,7 @@ let worker pool = + + let get_concurrency () = + try +- let ic = Unix.open_process_in "getconf _NPROCESSORS_ONLN" in ++ let ic = Unix.open_process_in "@getconf@/bin/getconf _NPROCESSORS_ONLN" in + let close () = ignore (Unix.close_process_in ic) in + let sc = Scanf.Scanning.from_channel ic in + try diff --git a/pkgs/development/ocaml-modules/carton/default.nix b/pkgs/development/ocaml-modules/carton/default.nix index 13c5089d822b..5fd18d3752d0 100644 --- a/pkgs/development/ocaml-modules/carton/default.nix +++ b/pkgs/development/ocaml-modules/carton/default.nix @@ -3,6 +3,7 @@ , checkseum, logs, psq, fmt , result, rresult, fpath, base64, bos, digestif, alcotest , crowbar, alcotest-lwt, lwt, findlib, mirage-flow, cmdliner, hxd +, getconf, substituteAll }: buildDunePackage rec { @@ -16,6 +17,13 @@ buildDunePackage rec { sha256 = "sha256-7mgCgu87Cn4XhjEhonlz9lhgTw0Cu5hnxNJ1wXr+Qhw="; }; + patches = [ + (substituteAll { + src = ./carton-find-getconf.patch; + getconf = "${getconf}"; + }) + ]; + # remove changelogs for mimic and the git* packages postPatch = '' rm CHANGES.md