debug wip

This commit is contained in:
George Thomas 2026-04-14 01:31:27 +01:00
parent ce742e4763
commit 346e558e0a
3 changed files with 13 additions and 0 deletions

2
build
View File

@ -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')

View File

@ -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

View File

@ -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