-
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
Format upgrade fix: remove missing switches from config file #4715
Conversation
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.
Possible message tweaks
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.
Nice, thanks!
I am not sure about the unrecorded switches part though, we'd need to scan the whole disk for it to be consistent.
| exception (OpamPp.Bad_version _ as e) -> | ||
match OpamFile.Config.raw_root_version (OpamPath.config root) with | ||
| None -> raise e | ||
| Some _ -> |
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.
Should it be constrained to root version 2.1~rc/2.1
?
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.
I think so - doesn't this become a problem in future if it gets opam-root-version: "2.2"
?
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.
With a 2.2
opam root, the local switch upgrade won't be triggered, yes.
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, of course, the whole thing is in the exception for an incorrect version.
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.
Since this fix is only necessary for intermediate dev versions, I'd say we remove it from 2.2 or at least 2.3: it'll keep the upgrade code more maintainable and we can reasonably assume anyone who tried one of the affected versions switched to the release in the meantime ?
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.
it's unregistered local switch, they can stay around for a while without noticing
… to this new version
…h only with a write lock
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.
Only minor (mostly style and code doc) comments
| exception (OpamPp.Bad_version _ as e) -> | ||
match OpamFile.Config.raw_root_version (OpamPath.config root) with | ||
| None -> raise e | ||
| Some _ -> |
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.
Since this fix is only necessary for intermediate dev versions, I'd say we remove it from 2.2 or at least 2.3: it'll keep the upgrade code more maintainable and we can reasonably assume anyone who tried one of the affected versions switched to the release in the meantime ?
@@ -476,6 +484,65 @@ let run_test ?(vars=[]) ~opam t = | |||
List.fold_left | |||
(fun vars (v, r) -> (v, r) :: List.filter (fun (w, _) -> v <> w) vars) | |||
vars bindings | |||
| Cat files -> | |||
let print_opamfile header file = |
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 probably deserves to be a top-level function 😁
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.
it will be removed from run.ml
to be an outside program
fix The layout update should not fail even if the installed-switches are incorrect #4713