# Dune not passing -opaque in dev?

**URL:** <https://discuss.ocaml.org/t/dune-not-passing-opaque-in-dev/6528>\
**Category:** Learning\
**Created:** [September 30, 2020, 5:59pm UTC](https://discuss.ocaml.org/t/dune-not-passing-opaque-in-dev/6528 "2020-09-30T17:59:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![keleshev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/keleshev/32/3779_2.png) [@keleshev](https://discuss.ocaml.org/u/keleshev)\
**Post date:** [September 30, 2020, 5:59pm UTC](https://discuss.ocaml.org/t/dune-not-passing-opaque-in-dev/6528/1 "2020-09-30T17:59:24Z")

</div>

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`:

```auto
$ 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))
(c_flags
 (-nologo -O2 -Gy- -MD))
(cxx_flags
 (-nologo -O2 -Gy- -MD))
(menhir_flags ())

```

Is this expected?

---

<div class="post-metadata">

**Author:** ![EduardoRFS](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/eduardorfs/32/2259_2.png) [@EduardoRFS](https://discuss.ocaml.org/u/EduardoRFS)\
**Post date:** [September 30, 2020, 6:26pm UTC](https://discuss.ocaml.org/t/dune-not-passing-opaque-in-dev/6528/2 "2020-09-30T18:26:42Z")

</div>

> [@keleshev](#):
>
> that -opaque flag is used for dev profile

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`

---

<div class="post-metadata">

**Author:** ![nojb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/nojb/32/519_2.png) [@nojb](https://discuss.ocaml.org/u/nojb)\
**Post date:** [September 30, 2020, 10:09pm UTC](https://discuss.ocaml.org/t/dune-not-passing-opaque-in-dev/6528/3 "2020-09-30T22:09:38Z")

</div>

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?

Cheers,  
Nicolas

---

<div class="post-metadata">

**Author:** ![keleshev](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/keleshev/32/3779_2.png) [@keleshev](https://discuss.ocaml.org/u/keleshev)\
**Post date:** [October 1, 2020, 7:36am UTC](https://discuss.ocaml.org/t/dune-not-passing-opaque-in-dev/6528/4 "2020-10-01T07:36:25Z")

</div>

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.)
