ocaml / dune

A composable build system for OCaml.
https://dune.build/
MIT License
1.62k stars 401 forks source link

Some alerts come with no location and point to file `_none_` #10776

Open Khady opened 2 months ago

Khady commented 2 months ago

Expected Behavior

The ocaml_deprecated_auto_include warning doesn't seem to get attached to anything. It shows the source as File "_none_", line 1 which makes it troublesome to fix (I have to dig in _build/log to find which file was being compiled, as part of which lib/exe, then the dune file, ...). Ideally dune should give me those information directly.

Actual Behavior

$ dune build
File "_none_", line 1:                        
Alert ocaml_deprecated_auto_include: 
OCaml's lib directory layout changed in 5.0. The unix subdirectory has been
automatically added to the search path, but you should add -I +unix to the
command-line to silence this alert (e.g. by adding unix to the list of
libraries in your dune file, or adding use_unix to your _tags file for
ocamlbuild, or using -package unix for ocamlfind).

Reproduction

Build a binary or a lib which uses Unix or Str without putting the corresponding library dependency in the dune file.

Specifications

nojb commented 2 months ago

This alert is generated by the compiler; there isn't much Dune can do about it. It may be worth reporting it upstream over at https://github.com/ocaml/ocaml.