Closed locallycompact closed 1 year ago
I was able to hack this by doing this:
wrapDhallEnvironment = name: { dependencies }: script:
let
cache = ".cache";
cacheDhall = "${cache}/dhall";
in
writeBashBin name
''
mkdir -p ${cacheDhall}
for dependency in ${builtins.toString dependencies}; do
${pkgs.xorg.lndir}/bin/lndir -silent $dependency/${cacheDhall} ${cacheDhall}
done
export XDG_CACHE_HOME=$PWD/${cache}
${script}
'';
horizon-spec-tests-wrapper = wrapDhallEnvironment "horizon-spec-tests-wrapper" { dependencies = dhall-prelude; } ''${legacyPackages.horizon-spec}/bin/horizon-spec-tests'';
It's good enough for now.
If you use the Nixpkgs support for Dhall, it will handle this automatically for you:
This only works for dhall dependencies of a dhall project. Not calling dhall decode from a haskell executable at runtime.
Hi, I can not seem to get dhall-nixpkgs to work. Here is my reproduction:
https://gitlab.homotopic.tech/horizon/horizon-spec/-/tree/9c2d4b55991c2424df81b1b585d3c6678237cdb7
The problem is the test does not find a cache hit no matter what I try.
I've generated a nix expression like so
I tried to add the dhall package as a runtime input. I've also tried endless combinations of buildInputs in various places - at the check site, at the script site - nothing seems to pick up the cache. I've tried without the FOD flag and passing in the Prelude manually. I'm just stumped.
What has to happen for scripts to pick up the cached dhall packages?