dune icon indicating copy to clipboard operation
dune copied to clipboard

Error: Reference to undefined global `Build_info__Build_info_data'

Open mthl opened this issue 3 years ago • 5 comments

Expected Behavior

I would like to be able to load dune-build-info inside an Ocaml top level which is a dependency of Ocaml-RDF

Actual Behavior

When I am trying to load "_opam/lib/dune-build-info/build_info.cma"

I get the following error :

Error: Reference to undefined global `Build_info__Build_info_data'

Reproduction

  1. opam switch create . --empty
  2. opam install dune-build-info=3.0.3
  3. eval $(opam env)
  4. ocaml
  5. # #directory "_opam/lib/dune-build-info";;
  6. # #load "_opam/lib/dune-build-info/build_info.cma";;

Specifications

  • Version of dune (output of dune --version): 3.0.3
  • Version of ocaml (output of ocamlc --version) 4.14.0
  • Operating system (distribution and version): Debian GNU/Linux 11

mthl avatar Apr 09 '22 20:04 mthl

What are you trying to do? Build_info_data is a module that is generated by Dune at link-time of executables that make use of build-info library.

nojb avatar Apr 09 '22 20:04 nojb

I am trying to run an OCaml top level with rdf modules loaded. So I have made a dune project with rdf=0.13.0 as a dependency and when I am trying to run ocaml and invoke #use_output "dune ocaml top" to load the every modules, the following outputted line is leading to the described error

...
#load ".../_opam/lib/dune-build-info/build_info.cma";;
...

My understanding is that this line is appearing on dune ocaml top output because ocaml-rdf is depending on the dune-build-info package. Is that correct ?

Thanks for your quick reply

mthl avatar Apr 09 '22 21:04 mthl

My understanding is that this line is appearing on dune ocaml top output because ocaml-rdf is depending on the dune-build-info package. Is that correct ?

Yes. I don't see a way to make this work at the moment, but perhaps I am missing something. @rgrinberg do see how to make this work?

nojb avatar Apr 09 '22 21:04 nojb

I suppose it's the same issue with loading virtual libraries into the toplevel. We should generate this module when trying to load it into the toplevel.

rgrinberg avatar Apr 10 '22 02:04 rgrinberg

I also got the same error message (also with rdf lib).

I get that errmsg from within utop, but also when just compiling my code and not using utop - no toplevel involved.

When I remove the -linkpkg option from my compilation, the error disappears, but then I can't load Submodules like Term for example.

klartext avatar Jul 10 '22 19:07 klartext