-
Notifications
You must be signed in to change notification settings - Fork 368
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
Next: ocaml-version not updated with ocaml's version #2537
Comments
Ah, this part is lacking documentation, and there may be some rough edges yet to polish, so let me explain how it works at the moment (on next). And thanks again for testing ☺ How it worksSo, compilers now being in packages, compiler-specific variables (like typically The idea, then, to keep compatibility with the previously global It could be much simpler to define these values in the compiler's In your case, Now let's get to the funny details...The reason to re-export in the global scope rather than use the variable directly (after all, we could replace uses of
Obviously, What this implies, however, is that it's inconsistent to change your compiler and non-compiler packages in the same set of actions:
I have a plan to solve this situation, which requires solving once, limiting the actions to the removals and compiler change, processing them, then re-running the solver in the new environment to complete the expected actions. It's a bit complex to my taste, however, and means that, by design, the user must validate (and start removing packages) before being able to know what the expected end state will be. May be acceptable for a compiler change, though, in In the current state, the reinstallation of packages following the switch change could be tried on package unavailable for the new version and fail, and the user will need to re-run opam with a proper request to get a correct solution and retry to install them. Another solution (or not)Now, if you expected something simpler, you can skip this. More elegant, maybe, but not simpler. Also (spoiler), this doesn't actually solve the problem of dynamic system packages. Generally speaking, it would be nicer to be able to write, instead of This allows to pass all the details to the solver, and gets rid of these annoying package/global variables needed for The idea here is to rely on the Using this, we could have the variants defined in different packages (e.g. What this doesn't solve at all, however, is the system compiler issue, since these Dynamic packagesWe've drifted a bit, but the bulk of the issue actually boils down to this: dynamic packages, and in particular, definition of the system compiler.
There may be middle-grounds or alternate solutions:
Note that having the system package in the repository has some benefits; for example, in 1.2.2, it is impossible to change its set of base packages, which raised some difficulties when Ok, this got quite long, I am sure you didn't expect that in your report. I'll forward to the ML since there is worthwile design discussions to be had. |
(answering here, https://lists.ocaml.org/ is down)
As a user, I wouldn't like that. I know it sounds a bit greedy, but if compilers are packages, I want my compiler upgrade to be like a package upgrade. Consider the recent move to 4.03.0: If I decide to upgrade from 4.02.3 to 4.03.0 (with "opam upgrade ocaml"), but I see that this upgrade will remove batteries and oasis, I can decide not to upgrade just yet. It's an important information.
Is it already possible to write I have no proposal to solve the issue with
This is also something that I find desirable, to handle the various alternative compilers, such as metaocaml. A package could depend on |
In agreement with @Drup and the idea of not making compiler package too different from other packages and avoiding having many ways of specifying the same thing. Regarding the A possible solution to retain the possibility of having a |
We seem to have the same feeling about this... Having a package that has an effect on the set of available packages that can't be determined before the package is actually installed is indeed incredibly awkward, and that's also true from opam's point of view. A compromise, related to what @dbuenzli suggests, and that I failed to mention above, would be to have a variant of ocaml "system" compilers for every major version, avoiding the dynamic aspect, e.g. It's not best, but this doesn't have any of the drawbacks mentioned above.
Yes. The current scheme is |
The one very important use-case we have and that this would break is actually quite simple: I think that if we find any way to handle it it's ok:
(and similarly for other distributions / OSes ?)
And the problem of dynamic packages isn't really closed for e.g. |
I'm not sure I understand the problem here. What is this supposed to do ? Does it already create a switch with OCaml installed ? If that's the case, it should simply be deprecated. For me if compiler become packages, creating a switch should always result in creating an empty shell or universe (see #2532 (comment)) --- we can have switch
|
I don't think that's a good idea. Beginners don't know about switches, and I don't think exposing them to that concept directly is a great idea. @AltGr's scenario seems desirable.
Note that llvm is not really dynamic, and it pretty much implements your solution for system: multiple packages, and each does polling at configure time. |
I disagree. First it's better not to have beginners use the system switch. Second it seems that most people coming from other environments are actually surprised by OPAM's global switch behaviour and do expect a notion of switch --- albeit a local (per directory) one. Do not try to hide things from beginners, it's contra-productive. See also my proposals in #2532. |
I agree with @dbuenzli on the usefulness of empty setups and switches, and that's why I spent some efforts to make sure they were possible (opam 1.2.2 simply can't work without at least one switch, and without a compiler in every switch). Regarding beginners, there are actually two separate issues:
On using the system switch by default, I don't have a strong opinion: it could also be the latest official release. There is a cost in build time, but system switch install can fail (already) if there is no OCaml installed on the system. And not relying on the system switch automatic detection for init removes a lot of weight from the decisions to be taken regarding the conversation above and dynamic packages. I believe @avsm, @samoht, @OCamlPro-Henry should have a say in this. |
This could be rather useful. Here's a situation that came up recently that seems tricky to solve with current OPAM:
(Advice on how best to encode this set of constraints with OPAM 1.2.2 is welcome.) With compilers-as-packages, perhaps it could be written like this:
|
Something that I forgot to mention earlier: you can actually easily set the switch-global variable @yallop the The best way to handle this at the moment, imho, is to disable support of
What was missing from this experiment was the ability to then depend on the feature (#2499), since depending on both In 1.2.2, you may be able to get the above without using
¹ like expressing conflicts in depends through a virtual |
(for the hack in the conflicts, see how we use the ugly My only worry about that discussion is that I'd like to keep a fast way to install and run opam and ocaml, and that's usually a job that binary distributions do very well -- hence the need of the system switch. They are other means to do that properly (e.g. not the way |
Package variables like `conf-ios:arch` don't work in the `available` field. See the "Now let's get to the funny details..." section in ocaml/opam#2537 (comment). The limitation is also mentioned in the opam docs: https://opam.ocaml.org/doc/Manual.html#opamfield-available. I'm not sure of the right fix but here's an idea. Change `available` field to rely on a global variable rather than a package variable. I defined a global variable `conf-ios-arch` at my command line like this: ``` opam config set conf-ios-arch "amd64" ```
Package variables like `conf-ios:arch` don't work in the `available` field. See the "Now let's get to the funny details..." section in ocaml/opam#2537 (comment). The limitation is also mentioned in the opam docs: https://opam.ocaml.org/doc/Manual.html#opamfield-available. I'm not sure of the right fix but here's an idea. Change `available` field to rely on a global variable rather than a package variable. I defined a global variable `conf-ios-arch` at my command line like this: ``` opam config set conf-ios-arch "amd64" ```
Package variables like `conf-ios:arch` don't work in the `available` field. See the "Now let's get to the funny details..." section in ocaml/opam#2537 (comment). The limitation is also mentioned in the opam docs: https://opam.ocaml.org/doc/Manual.html#opamfield-available. I'm not sure of the right fix but here's an idea. Change `available` field to rely on a global variable rather than a package variable. I defined a global variable `conf-ios-arch` at my command line like this: ``` opam config set conf-ios-arch "amd64" ```
Package variables like `conf-ios:arch` don't work in the `available` field. See the "Now let's get to the funny details..." section in ocaml/opam#2537 (comment). The limitation is also mentioned in the opam docs: https://opam.ocaml.org/doc/Manual.html#opamfield-available. I'm not sure of the right fix but here's an idea. Change `available` field to rely on a global variable rather than a package variable. I defined a global variable `conf-ios-arch` at my command line like this: ``` opam config set conf-ios-arch "amd64" ```
HO w about a package.env/include/ etc like gentoo ? |
I created an empty switch
last
and installed ocaml in it manually. It seemsocaml-version
is not udpated.The text was updated successfully, but these errors were encountered: