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

Dune reports warnings twice #2452

Closed
copy opened this issue Jul 25, 2019 · 5 comments
Closed

Dune reports warnings twice #2452

copy opened this issue Jul 25, 2019 · 5 comments

Comments

@copy
Copy link

copy commented Jul 25, 2019

For example:

% cat dune
(executable
 (name test)
 (flags :standard -warn-error -26))
% cat test.ml
let () = let y = 6 in ()
% dune build test.exe          
File "test.ml", line 1, characters 13-14:
Warning 26: unused variable y.
File "test.ml", line 1, characters 13-14:
Warning 26: unused variable y.
@nojb
Copy link
Collaborator

nojb commented Jul 26, 2019

The reason is that test.ml does not have a .mli which causes test.ml to be compiled twice; once with ocamlc (to produce the .cmi) and once with ocamlopt (to produce the .cmx) needed for test.exe.

@nojb
Copy link
Collaborator

nojb commented Aug 12, 2019

Closing as this behaviour is expected.

@nojb nojb closed this as completed Aug 12, 2019
@copy
Copy link
Author

copy commented Aug 12, 2019

That's unfortunate. Couldn't dune add -w -a to the invocation of ocamlc?

@ghost
Copy link

ghost commented Aug 13, 2019

This is a bit tedious, for instance if you only ask for the bytecode then we do need to display the warnings for the bytecode. Doing something different depending on what set of things are needed seems complicated to support and could hurt performance of incremental builds.

@ghost
Copy link

ghost commented Aug 13, 2019

The best is to always have a .mli file

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

2 participants