-
Notifications
You must be signed in to change notification settings - Fork 406
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
Release profile documentation is unclear about exact effects #3359
Comments
Indeed. The doc should be clear about this. Additionally, this recent discussion makes me think that maybe we should indeed set |
Sorry if this is a bit of a tangent, but is it clear that this sort of thing should be handled at the dune level, or would it make sense to have a broader discussion of whether e.g. we should be setting |
@jberdine a typical workflow nowadays is to use dune to build and then publish packages to opam. So when you opam install a package, you're usually installing the build artifact i.e. the binaries. At least this is my understanding 🙂 |
@yawaramin Yes, but opam has to compile those binaries, and using dune to build your package in no way implies accepting dune's default compiler flags. In all of my code I override the dune defaults entirely. I'm don't know if it is common to just blindly use the defaults, especially when they are known to differ from the upstream compiler. On the other hand, telling dune to build with |
Maybe I'm misunderstanding but as far as I can tell, opam doesn't compile binaries. It runs whatever you define is the
Perhaps, but diml was talking about setting a default of |
Well, the scope of this discussion is definitely bigger that Dune and Dune shouldn't decide what to do on its own. I was thinking to start a thread on discuss. Regarding following the compiler defaults, given that the compiler doesn't have a notion of "release" and "development" mode, it seems expected to me that Dune doesn't follow the compiler defaults. For instance, maybe It seems that to me that any tool that people use to produce release binaries should be able to set such defaults. So opam and esy should probably be able to change the default globally. However, they shouldn't change it in the development environment. i.e. packages built by |
Opam has the Agree that opam should install optimized packages. I don't think opam has a notion of a 'default' build command though, from what I understand the build command for the package is whatever the 'build' config is in the opam file. Maybe if opam were to do project scaffolding it might set up a default build command but I think scaffolding is being handled by Dune, right? Esy's 'default' build config is |
I guess what I had in mind is that opam would tell Dune, or for what is worse any build system to compile OCaml code with |
To be honest I don't think opam will want to override the configured Edit: in any case I think no matter what opam and Dune decide to do in future, Dune will continue to have the |
I think that having opam communicate default flags to dune is a good idea, but using an environment variable is too coarse. That is, it seems that each opam switch ought to have its own default flags. When dune is building several contexts in parallel which are associated with different opam switches, the defaults for each switch should be communicated to dune for use in the corresponding contexts. |
We might need a file in the |
As per https://dune.readthedocs.io/en/stable/faq.html#how-to-make-warnings-non-fatal , using the
release
profile has certain specific effects:However, it's not clear exactly what the compilation options are. For example, do they include
-O2
? Or-O3
? Etc. I think these settings are important to know.The text was updated successfully, but these errors were encountered: