diff --git a/build b/build index 4d4e404..d8ff44c 100755 --- a/build +++ b/build @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -euo pipefail +# generate this file from Nix config for now to avoid duplication? + cargo build --manifest-path ./rust/Cargo.toml BUNDLED_LIB_DIR=$(cabal list-bin . | sed -e 's=x/garnet/build/garnet/garnet=build=g') diff --git a/flake.nix b/flake.nix index 7f9080f..6666890 100644 --- a/flake.nix +++ b/flake.nix @@ -49,6 +49,7 @@ }; packages.garnet.components.library = { preBuild = addLibcIncludeDir; + # try removing? preConfigure = '' mkdir -p rust/target/debug ln -s ${garnet-rs}/include/garnet_rs.h rust/target/debug/garnet_rs.h diff --git a/garnet.cabal b/garnet.cabal index c30432f..e03988e 100644 --- a/garnet.cabal +++ b/garnet.cabal @@ -14,6 +14,14 @@ extra-source-files: -- extra-tmp-files: -- rust/target/debug/garnet_rs.h +-- actually maybe this is pointless given we always need debug path anyway in `extra-source-files` +-- plus we have it in `Raw.hs` +flag dev + default: + False + manual: + True + common common default-language: GHC2024 default-extensions: @@ -50,6 +58,8 @@ library GarnetRs.Raw GarnetRs.Wrapped hs-source-dirs: lib + -- if flag (dev) + -- include-dirs: rust/target/debug include-dirs: rust/target/debug -- HLS gives up entirely when the header is malformed if we do this -- and anyway, I don't think it gives us dependency tracking like `extra-source-files` does