Dune not passing -opaque in dev?

Dune 1.1 release notes say that -opaque flag is used for dev profile. However, it is not passed to the compiler (checked by using --verbose). Here’s the output of dune printenv:

$ dune printenv --profile dev .
Done: 0/0 (jobs: 0)(flags
 (-w @1..3@5..28@30..39@43@46..47@49..57@61..62-40 -strict-sequence
   -strict-formats -short-paths -keep-locs))
(ocamlc_flags (-g))
(ocamlopt_flags (-g))
 (-nologo -O2 -Gy- -MD))
 (-nologo -O2 -Gy- -MD))
(menhir_flags ())

Is this expected?

1 Like

For me the -opaque is used only for commands with a -impl for things like linking of libraries or binaries that doesn’t happen. And printenv show only your env as I know, not the complete env. Checked that with --verbose


Hi Vladimir,

-opaque is treated specially as is only passed when compiling .cmx and .cmi. Have you checked whether it is actually passed when looking at the verbose log?


1 Like

Thanks, @EduardoRFS and @nojb, that explains it. Didn’t realize it’s only relevant for .cmx and .cmi.

(Porting some projects from OMake to Dune and, it turns out, in the previous setup the -opaque flag was used slightly wrong: passed all the time.)