Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual: can't repeat an example about dune-sites #4320

Closed
Kakadu opened this issue Mar 6, 2021 · 4 comments · Fixed by #4326
Closed

Manual: can't repeat an example about dune-sites #4320

Kakadu opened this issue Mar 6, 2021 · 4 comments · Fixed by #4326

Comments

@Kakadu
Copy link
Contributor

Kakadu commented Mar 6, 2021

I'm trying to follow an example from https://dune.readthedocs.io/en/stable/dune-files.html#generate-sites-module-since-2-8 I created a repo https://github.com/Kakadu/dune-sites-demo where I have not yet working example. Remarks

  1. !C_register.todo should be C_register.todo
  2. Directory structure is not obvious from the manual. For now I put three files about plugin into plugin/.
  3. It's not obvious how to run this. dune exec ./c.exe doesn't compile a plugin (and it isn't loaded because of that). The subsection before that says that dune install should put everything into right places, but is is unlikely that I need that for developer build.
@bobot
Copy link
Collaborator

bobot commented Mar 8, 2021

Thank you for reporting those issues and testing this experimental features. Indeed the first point is clearly wrong. I hope that we would have soon the framework in place for testing the examples in the manual. For the second point it should be indeed made clearer perhaps by adding the following before the examples (using the structure of your repository):

.
├── c.ml
├── c_register.ml
├── dune
├── dune-project
└── plugin
    ├── b.ml
    ├── b.opam
    ├── dune
    └── dune-project

For the third point dune build @install build everything locally in a way that make dune exec ./c.exe (or dune exec c) see the plugins. It should be mentioned in the manual. However there is a little bug when the plugin has the same name than a library that I need to fix, but for now:

diff --git a/plugin/dune b/plugin/dune
index 305ada0..baf2383 100644
--- a/plugin/dune
+++ b/plugin/dune
@@ -3,6 +3,6 @@
  (libraries c.register))
 
 (plugin
- (name b)
+ (name b_foo)
  (libraries b)
  (site (c plugins)))

Finally I must warn you that there is a problem with installation with opam that I haven't yet fixed #4212.

Do you think you can propose a PR that fix the manual? I will take care of the other problem of the site feature.

Kakadu added a commit to Kakadu/dune that referenced this issue Mar 8, 2021
Signed-off-by: Kakadu <Kakadu@pm.me>
Kakadu added a commit to Kakadu/dune that referenced this issue Mar 8, 2021
Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
Kakadu pushed a commit to Kakadu/dune that referenced this issue Mar 9, 2021
Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
bobot pushed a commit that referenced this issue Mar 9, 2021
Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
@Kakadu
Copy link
Contributor Author

Kakadu commented Mar 12, 2021

@bobot What do you think: should manual say something about adding dependencies to plugins? I tried to add Stdio dependency and right now I'm getting Fatal error: exception Dynlink.Error (Dynlink.Cannot_open_dll "Dynlink.Error (Dynlink.Cannot_open_dll \"Failure(\\\"/home/kakadu/.opam/4.10.1+fp+flambda/lib/sexplib0/sexplib0.cmxs: undefined symbol: camlStdlib__stream__Pmakeblock_1071\\\")\")") and I'm a bit puzzled what to do....

@bobot
Copy link
Collaborator

bobot commented Mar 12, 2021

Except for the thread library (which should be present in the binary), it should work with any dependencies. The problem is that the -linkall flags is not added even if it should be automatically. Thanks for finding this new bug, but I don't understand why it doesn't also break in the Why3 and Frama-C branch which uses dune-site, the binaries must use all the modules. Can I copy your repository as tests in dune?

Kakadu pushed a commit to Kakadu/dune that referenced this issue Mar 12, 2021
For now this test gives a dynlink error about missiing library. See also
ocaml#4320

Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
Kakadu pushed a commit to Kakadu/dune that referenced this issue Sep 1, 2021
For now this test gives a dynlink error about missiing library. See also
ocaml#4320

Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
bobot pushed a commit to Kakadu/dune that referenced this issue Sep 29, 2021
For now this test gives a dynlink error about missiing library. See also
ocaml#4320

Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
bobot pushed a commit to Kakadu/dune that referenced this issue Sep 29, 2021
For now this test gives a dynlink error about missiing library. See also
ocaml#4320

Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
bobot pushed a commit to Kakadu/dune that referenced this issue Oct 1, 2021
For now this test gives a dynlink error about missiing library. See also
ocaml#4320

Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
bobot pushed a commit to Kakadu/dune that referenced this issue Nov 18, 2021
For now this test gives a dynlink error about missiing library. See also
ocaml#4320

Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
bobot pushed a commit that referenced this issue Nov 18, 2021
For now this test gives a dynlink error about missiing library. See also
#4320

Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
ejgallego pushed a commit to ejgallego/dune that referenced this issue Jan 21, 2022
For now this test gives a dynlink error about missiing library. See also
ocaml#4320

Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
ejgallego pushed a commit that referenced this issue Jan 22, 2022
For now this test gives a dynlink error about missiing library. See also
#4320

Signed-off-by: Dmitrii Kosarev <Dmitrii.Kosarev@pm.me>
@Lelio-Brun
Copy link

@bobot What do you think: should manual say something about adding dependencies to plugins? I tried to add Stdio dependency and right now I'm getting Fatal error: exception Dynlink.Error (Dynlink.Cannot_open_dll "Dynlink.Error (Dynlink.Cannot_open_dll \"Failure(\\\"/home/kakadu/.opam/4.10.1+fp+flambda/lib/sexplib0/sexplib0.cmxs: undefined symbol: camlStdlib__stream__Pmakeblock_1071\\\")\")") and I'm a bit puzzled what to do....

I have exactly the same problem (with dune 2.9.3) when trying to add z3 (either 4.8.11 and 4.8.17) as a dependency. What should I do ?
I tried to add (link_flags -linkall) to an env stanza, without success, the field is not recognized...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants