[Discussion] New compiler flag scheme #16753
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This draft PR attacks several issues in how OCaml compilers are defined in opam-repository:
base-<flag>
(e.g.base-flambda
) is added. Which allows people to either request or conflict with particular variant of the compiler. cc @emillonocaml-variant.<ver>+<flag1>+<flag2>
package. Given the number of available combinations, this can be tedious and unmaintainable. To fix that, the newbase-<flag>
meta-packages become a optional dependencies of theocaml-base-compiler
package. This way, one could request a new custom variant this way:opam switch create --packages=ocaml-base-compiler.4.10.0,base-flambda,base-spacetime 4.10+flambda+spacetime
. This could be improved in opam itself by adding an optional argument of some kind; something of the sortopam switch create --extra-packages=base-flambda 4.10 4.10.0
.ocaml-variants
packages is hard to maintain, this PR or similar would make them obsolete and only to be used for bigger compiler variants/changes such as metaocaml, betas or 32bits variants.Currently this PR is only a place for discussion, in no way something ready to be merged.
The current issues with this approach is that I couldn't find a way to add the lack of an optional dependency to the switch invariant, so with this one could install
base-flambda
without realizing and the next thing they know their whole switch is being recompiled... This is less than ideal. I'd be happy to know if there is any ways of doing something like this while keeping the current behaviour of opam. Maybe this could be done by creating aocaml-base-compiler.config
file, then make the newbase-<flag>
packages available only ifocaml-base-compiler:<flag-name>
is set totrue
. I'm not sure this works, I'll investigate later. cc @rjbou @AltGr @thomasblanc