-
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
Introduce 'default-invariant' besides 'default-compiler' #4607
Conversation
ad65ce5
to
95c0a03
Compare
Ok, so apparently this works... but the perf is not acceptable at the moment :/ |
Ok, tests added, and now reasonably performant |
80b78b3
to
179a58d
Compare
179a58d
to
08f5950
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, apart from the interactive prompt at opam init
.
What happens if there's no installable compiler (e.g. because the user points at an empty repo or something like that)? Is it a reasonable error message or does opam explode? 🙂
if config_files = [] then | ||
OpamConsole.msg "No configuration file found, using built-in defaults.\n" | ||
else | ||
OpamConsole.msg "Configuring from %sbuilt-in defaults.\n" others; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice 🙂
OpamFormula.Atom (OpamPackage.Name.of_string "ocaml-system", | ||
OpamFormula.Empty); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the user has an old system compiler (e.g. they happen to be on a really old Ubuntu)? Does it quietly ignore it and move on to ocaml-base-compiler, or should we duplicate the >= "4.05"
constraint here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The former: this is in the tests here: https://github.com/ocaml/opam/pull/4607/files#diff-b3f6abdb5ab3eb6c5612e441c0709542022442b9cc6f47b5eae75bc5aa85799cR36-R54
(fun st -> | ||
(), | ||
OpamSwitchCommand.install_compiler st | ||
~additional_installs:default_compiler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes an interactive prompt in OpamSwitchCommand.install_compiler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, well spotted, indeed that's unfortunate.
compared to 2.0, this just adds the new 'default-invariant', and keeps similar semantics for 'default-compiler', which is only used for 'opam init' (but must now be compatible with the invariant). previously the 2.1 branch completely replaced the older meaning of 'default-compiler', using it as 'default-invariant' instead, but the order of priority was lost.
This can happen with a bad URL, or if the network is down. I state you end up in is pretty confusing for users: opam considers it's initialised, but you get no packages and no switch, and it's unclear what to do.
it was completely silent, which could be confusing.
e9437f0
to
e8a4d16
Compare
and disable the confirmation in all cases, it doesn't make much sense anymore on 2.1.
to make it follow the documented behaviour: `Without arguments, an invariant is chosen automatically.` previous version just emptied it.
e8a4d16
to
23f1e86
Compare
Hopefully that fixes the testsuite on AppVeyor. The problem was twofold:
|
ow thanks ! |
(todo: add tests)
compared to 2.0, this just adds the new 'default-invariant', and keeps
similar semantics for 'default-compiler', which is only used for 'opam
init' (but must now be compatible with the invariant).
previously the 2.1 branch completely replaced the older meaning of
'default-compiler', using it as 'default-invariant' instead, but the order
of priority was lost.