-
Notifications
You must be signed in to change notification settings - Fork 399
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
modes not respected in combination with library with public_name #3467
Comments
Try writing an empty mil for your executable. Does it fix the problem? |
It already has one. :-) |
It's the same problem as described in #3182. Adding a public name pulls in the cmt files since they are installed, and cmt files are produced by ocamlc. Also, this time I'm really adding the topic to the next meeting (I forgot it last time): https://github.com/ocaml/dune/wiki/dev-meeting-next |
Ah, I see, thanks. For context, in the actual usage this example is reduced from, the library is 'public' just so that a directory of the repo can be used from several others. That is, the 'install' that we rely on is only within dune-land, and need not make it to opam-land. In case that helps or is relevant. Also, the motivation for not compiling with ocamlc is one to reduce build times, but mostly to avoid getting duplicate warnings from both ocamlc and ocamlopt. Turning off warnings in |
Hmm, if you only use the public library only inside the workspace but don't install it, then the cmt files shouldn't be pulled in 🤔 |
Ah, but a dune "install" is needed to version-stamp the binaries, so that is always done (except in watch mode). |
Note that you can also version-stamp the binaries by promoting them to the source tree via:
That only works if you are using a single build context though. |
Interesting. I don't know if I always see potential duplicate messages, but I definitely started out hunting this due to seeing duplicated messages in practice. There might be something nontrivial in the definition of "duplicated" though, I'm not sure. Is the scope of the cache the whole workspace? The duplicates I saw may have been coming from different contexts (with different ppx configs leading to different preprocessed code). Is there any info on the caching mechanism that you can point me to that would help me to find a small repro more efficiently than a monkey at a keyboard? :-) |
Just the code really, the caching is done there: dune/src/dune_util/report_error.ml Lines 87 to 88 in d629481
If one message as one more trailing whitespace, they won't be deduplicated. |
Expected Behavior
With a
dune
file such as:I expect that executing
dune build
will not runocamlc
on implementation files. I realize that it might compile interface files with ocamlc even when building for native code only.Actual Behavior
In the case above,
dune build
does runocamlc
on implementation files. Curiously, if(public_name test_package.test_lib)
is removed, it does not.Reproduction
Here is a small project that shows this: dune-bc-test.tar.gz
Specifications
dune
(output ofdune --version
): 2.5ocaml
(output ofocamlc --version
): 4.08.1The text was updated successfully, but these errors were encountered: