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

missing usage with dune #270

Open
mimoo opened this issue Jan 18, 2023 · 5 comments
Open

missing usage with dune #270

mimoo opened this issue Jan 18, 2023 · 5 comments

Comments

@mimoo
Copy link

mimoo commented Jan 18, 2023

listing qcheck within my dune file's libraries didn't work, I ended up realizing that I need to instead list qcheck-core. I suggest adding this to the README. Also, do I need to opam install qcheck if I'm not importing it and just importing qcheck-core?

@c-cube
Copy link
Owner

c-cube commented Jan 18, 2023 via email

@jmid
Copy link
Collaborator

jmid commented Jan 18, 2023

First off: yes, the documentation could certainly be improved (PRs welcome!)

I cannot recreate the problem you experienced. Below follows my attempt at a minimal repro which works fine.
As @c-cube mentions, this is using the qcheck compatibility package, so it needs to be adapted to use qcheck-core instead.

dune-project:

(lang dune 3.0)

dune:

(test
 (name test)
 (modules test)
 (libraries qcheck)
)

test.ml:

open QCheck

let t = Test.make ~name:"float test" float (fun f -> floor f <= f)

let _ = QCheck_runner.run_tests ~verbose:true [t]

@Gbury
Copy link
Collaborator

Gbury commented Jan 18, 2023

I guess that setting (implicit_transitive_deps false) in the dune-project file might be what triggers the bug and make it require qcheck-core ?

@jmid
Copy link
Collaborator

jmid commented Jan 18, 2023

Indeed! I can confirm that after adding that line to dune-project I get the following error message:

$ dune build test.exe
File "test.ml", line 1, characters 5-11:
1 | open QCheck
         ^^^^^^
Error: Unbound module QCheck

This is confusing to a new-comer and documentation could help here, e.g., by pointing them to use qcheck-core instead.

@mimoo
Copy link
Author

mimoo commented Jan 18, 2023

yes we use implicit_transitive_deps false (which really should be default for all projects :D)

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

No branches or pull requests

4 participants