Closed xclerc closed 4 years ago
Well, the build info are not filled during the build process. I.e. we just leave a blank in the executable and rewrite it at install time. So if we supported this, the lib would report dummy values. Though we could still support it just to avoid this error and so that you can use a library that depends on dune-build-info in a ppx.
Sorry, I am a bit confused: it looks like executables in the _build
directory do contain e.g. the version. I am pretty sure I have
seen it working for an executable depending on a library itself
depending on dune-build-info
.
Only if it is known statically, i.e. if you are building from a release tarball. If the version comes from git, it will be left blank inside _build
.
Thanks for the clarification.
Do you want to take a look at this BTW?
I am afraid my knowledge of dune's code base is wildly outdated...
I think that this issue is caused by the fact that we don't handle link time code gen when build ppx exe's.
@jeremiedimino I recall you explained to me once why we had a separate compilation pipeline for ppx drivers instead of reusing Exe
, but I wasn't entirely convinced. Do you mind explaining again? Exe
would handle link time code gen for us.
I can't remember either.
(note: I am not sure the use case below is supposed to be supported, as the documentation states that build info can be embedded in executables, but does not explicitly mention whether it can be embedded in libraries.)
Expected Behavior
Define a library depending on
dune-build-info
and have a ppx rewriter depending on said library.Actual Behavior
Dune fails with:
Reproduction
repro.zip
Specifications
dune
(output ofdune --version
): 2.4.0ocaml
(output ofocamlc --version
): 4.10.0