-
Notifications
You must be signed in to change notification settings - Fork 371
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
Error-free opam root changes #4638
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dra27
reviewed
Apr 21, 2021
|
dra27
reviewed
May 6, 2021
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 looking great, thanks! Various comments (sometimes on comments) and suggestions.
Do you have a "story" for being able to do this on 2.0 without API changes?
dra27
reviewed
May 18, 2021
dra27
reviewed
May 18, 2021
AltGr
reviewed
May 19, 2021
AltGr
reviewed
May 19, 2021
AltGr
approved these changes
May 19, 2021
All green, all conversations resolved, some commits to squash and it's good to merge! |
…from undefined one
…fined in the fields record)
…mat version field `opam-version' from the opam root version.
They provide reading function that don't error are reading, do no show/stop at erros (unless strict mode is enabled)
… light upgrade from 2.0, using `opam_root_version'
permit read only loading, with best effort on file reading. This is handled by function in `OpamStateConfig' that permit to load state files: config, switch-config, switch-state, and repos-config.
…t also add an internal virtual version `2.1~~previous' that is its value for older config files when the field is undefined
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Permit a non blocking call from older versions of opam binary or lib.
On files, it adds
opam-root-version
field in rootconfig
file to discriminate root version and opam file version. The fieldopam-version
is theopam-file-format
version of the file. InOpamFile
modules,format_version
field is set on some modules to specify the file format version (eg. new field), andopam_file_format
theopam-file-format
version. An internalOpamFile.Config.root_version
permit to determine the current root version of the binary. it need to be bumped at eachopam_file_format
bump (regardless of the file), according opam binary version.opam-root-version
is checked for all states loading, and for most state files reading. Also for root format upgrade mechanism.The check/printing on the
opam-version
field is updated too. It must be printed on all files, and it is checked that it will be printed (OpamFormat.opam_version
).On format upgrade, latest compatible hard upgrade is still 2.0
beta5, but intermediate roots (from 2.1alpha's) are set as hard upgrade: all files withopam-version: 2.1
downgraded to2.0
.On state files should no more use
OpamFile
to read them outside state loading, there is functions to safely read them inOpamStateConfig
. It concernsconfig
,switch-config
,switch-state
, andrepos-config
.Fixes #4636