From 0b06a1734d283424f9c99009c5c76de1022121f6 Mon Sep 17 00:00:00 2001 From: Alistair Date: Tue, 24 Sep 2024 20:36:48 +0100 Subject: [PATCH] fixup! --- flake.nix | 12 +++++++++- .../0001-fix-octez-rust-deps-for-nix.patch | 23 +++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 nix/patches/0001-fix-octez-rust-deps-for-nix.patch diff --git a/flake.nix b/flake.nix index 4cbc453f..50d3010a 100644 --- a/flake.nix +++ b/flake.nix @@ -61,7 +61,17 @@ }; # Build octez release for this system - octez = octez-v21.packages.${system}.default; + octez = octez-v21.packages.${system}.default.overrideAttrs (old: { + patches = + (old.patches or []) + ++ [ + # The rust_deps library relies on `/bin/bash` (via the `dune` `bash` action) + # which is not available in Nix, so instead we rely on the `run` action with + # the shebang provided bash interpreter which Nix happily patches to use the + # Nix bash path for us. + ./nix/patches/0001-fix-octez-rust-deps-for-nix.patch + ]; + }); clangNoArch = if pkgs.stdenv.isDarwin diff --git a/nix/patches/0001-fix-octez-rust-deps-for-nix.patch b/nix/patches/0001-fix-octez-rust-deps-for-nix.patch new file mode 100644 index 00000000..651b040e --- /dev/null +++ b/nix/patches/0001-fix-octez-rust-deps-for-nix.patch @@ -0,0 +1,23 @@ +diff --git a/manifest/product_octez.ml b/manifest/product_octez.ml +index f4336a077a..5dc09607d9 100644 +--- a/manifest/product_octez.ml ++++ b/manifest/product_octez.ml +@@ -522,7 +522,7 @@ let octez_rust_deps = + [S "source_tree"; S "../riscv"]; + [S "source_tree"; S "../kernel_sdk"]; + ]; +- [S "action"; [S "no-infer"; [S "bash"; S "./build.sh"]]]; ++ [S "action"; [S "no-infer"; [S "system"; S "bash ./build.sh"]]]; + ]; + ] + +diff --git a/src/rust_deps/dune b/src/rust_deps/dune +index de48dbfde8..41c538cdd2 100644 +--- a/src/rust_deps/dune ++++ b/src/rust_deps/dune +@@ -22,4 +22,4 @@ + (source_tree src) + (source_tree ../riscv) + (source_tree ../kernel_sdk)) +- (action (no-infer (bash ./build.sh)))) ++ (action (no-infer (system "bash ./build.sh"))))