dune
dune copied to clipboard
-opaque option breaks equivalence between release and dev compilation in presence of [@inline always]
Expected Behavior
dune build and dune build --release should both work or both fail
Actual Behavior
If the code contains [@inline always], dune build may fail with error File "test.ml", line 12, characters 18-52: 12 | module FloatMat = Mat.Make [@inlined always] (Float) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error (warning 55): Cannot inline: Unknown function
because of the -opaque option, while dune build --release succeed.
Reproduction
Easy!
- Proposed solution remove warn_error for warning 55 and maybe others when compiling in dev mode.
- Other possible solution: do not use -opaque is [@inline always] and similar appears in the code (if the user thinks inlining is really important, one should not use -opaque.
- PR with a reproducing test:
- Create a first file with a functor or funciton
- Ask to inline this in another file with [@inline always]
Specifications
- Version of
dune
(output ofdune --version
): 2.7.1 - Version of
ocaml
(output ofocamlc --version
): 3.11.1 and 3.11.1+flambda - Operating system (distribution and version): debian testing
Additional information
- Link to gist with verbose output (run
dune
with the--verbose
flag):