I’m trying to build one C++ based flake (“hello”) that depends on another (“TVM”) (both local to my file system). The parent flake (TVM) installs several sub directories of header files from several locations in it’s directory tree in $out/include/{tvm,dlpack} when built. But when building the dependent flake, nix build .
complains that a header file can’t be found:
> building
> In file included from ./test.cc:1:
> /nix/store/wd1dbrznwz1pqkmz8zrwkil0n70yxgl6-source/include/tvm/runtime/c_runtime_api.h:72:10: fatal error: 'dlpack/dlpack.h' file not found
> #include <dlpack/dlpack.h>
> ^~~~~~~~~~~~~~~~~
> 1 error generated.
For full logs, run 'nix log /nix/store/bw9zga4mq6qxga66hpmr1al37rfczy53-hello.drv'.
And when looking into that /nix/store/<nar>-source directory
, it looks like that is a ‘raw’ (unbuilt) directory tree of TVM (which doesn’t have all the right paths in ./include
instead of a built version of that flake (which I’ve confirmed has the right includes in $out/include/{dlpack,tvm}
).
Questions:
- Why is Nix trying to build the child flake using include paths into a raw,
/nix/store/<nar>-source
tree of an input flake, rather than the built resulting flake output like/nix/store/<nar>-tvm
? - Is there any way to tell it to use the built flake instead for include paths?
- I’m also even having trouble figuring out what a
/nix/store/<nar>-source
path even is? Is this type of source output/intermediary called something specific so I can research it further?
I’ve uploaded the child (libgen) and parent (TVM) flake.nix here with the test.cc file. And for full context, here’s the TVM flake in it’s full repository.
Any help much appreciated! Had a devil of a time googling breadcrumbs on this one.