I am trying to follow these instructions https://github.com/ocaml/dune/blob/c8974099a47e1cff50c8ff0f7fff8ce601661d28/doc/sites.rst#id8 but getting
Error: Unknown constructor generate_module. Does anyone know what it means?
Another observation (bug?) that
sites stanza in
package does not allow to specify a single site. It expects a list and does not accept a single element one :)
(generate_module (name mysites) (sites share))
ah, I see. Now it is called 'generate_sites_module' :)
And I was wondering if the docs were up-to-date, but the newer docs are: https://github.com/ocaml/dune/blob/2.9/doc/sites.rst.
there is still a problem I am trying to solve: in my case the site is associated with library, not with exectuable. The executable is using library which is using files from site. (it is all in one project). I am trying
generate_sites_module in dune file for the library but when I query it at runtime later the site object (similar to
Mysites.Sites.themes in the docs) returns empty list.
install stanza seems to be working and files are installed. Sites ML file has
~encoded field which contains:
~encoded:(Sys.opaque_identity "%%DUNE_PLACEHOLDER:4096:location:share:10:myproject followed by repeating % characters.
It could be related to this sentence from the documentation: "For promotion it works only if the generated modules are only in the executable (or library statically linked) promoted; generated modules in plugins will not work." but I am unsure how to fix it. Should I somehow "promte the library which contains module generated by
generate_sites_module ? How?
Fixed it! It was due to missing
@Vadim Zaliva don't hesitate to give feedback about sites in the Dune bugtracker, if you feel something should be improved
will do. so far everything worked out and just required more careful reading of documentation :)
Last updated: Jan 30 2023 at 17:03 UTC