Skip to content
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

Bump to opam-file-format 2.1.3 #4639

Merged
merged 2 commits into from
May 27, 2021
Merged

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Apr 21, 2021

Needs opam-file-format 2.1.3 to be released first (and src_ext/Makefile.sources updated with it).

This then automatically closes #4394. If you put opam-version: "2.1" as the second line of an opam file instead of:

    error  2: File format error: unsupported or missing file format version; should be 2.0 or older

you now get the correct:

    error  2: File format error at line 2, column 0: Parse error

@dra27 dra27 added the PR: WIP Not for merge at this stage label Apr 21, 2021
@dra27 dra27 added this to the 2.1.0~rc milestone Apr 21, 2021
@dra27 dra27 added this to PR in Progress in Opam 2.1.x via automation Apr 21, 2021
@dra27
Copy link
Member Author

dra27 commented Apr 23, 2021

Updated to reflect the changes in ocaml/opam-file-format#44 - OpamFile.SyntaxFile knows the expected format version of the file it's parsing, and can therefore process the # sentinel group returned by an older opam-file-format when parsing an opam file newer than itself.

I tested this by changing OpamBaseParser.version to default to opam 1.9 and then added syntax errors in an opam file with opam-version: "2.0" and it's working beautifully

@dra27 dra27 force-pushed the opam-file-format-upgrade branch 4 times, most recently from c2cfa16 to ff20731 Compare May 24, 2021 09:14
@dra27 dra27 removed the PR: WIP Not for merge at this stage label May 24, 2021
@dra27 dra27 moved this from PR in Progress to PR To review in Opam 2.1.x May 24, 2021
@dra27 dra27 closed this May 25, 2021
Opam 2.1.x automation moved this from PR To review to Done May 25, 2021
@dra27 dra27 reopened this May 25, 2021
Opam 2.1.x automation moved this from Done to PR in Progress May 25, 2021
@rjbou
Copy link
Collaborator

rjbou commented May 25, 2021

Just a note: now (in root version PR) we have the exception Bad_version in OpamFormat, it is raised by check_opam_version (the same function that prints the error above)

dra27 added 2 commits May 25, 2021 16:35
The sentinel group of kind `#` is now processed correctly in
OpamFile.SyntaxFile. This allows, for example, opam 2.2 to use
opam-file-format 2.1 and still have `opam-version: "2.2"`.
@dra27 dra27 force-pushed the opam-file-format-upgrade branch from d4511a5 to 18ac026 Compare May 25, 2021 15:35
@dra27 dra27 moved this from PR in Progress to PR To review in Opam 2.1.x May 26, 2021
@dra27
Copy link
Member Author

dra27 commented May 26, 2021

This one's finally ready!

@dra27 dra27 moved this from PR To review to PR Finalised in Opam 2.1.x May 27, 2021
@dra27 dra27 merged commit c7cd0fa into ocaml:master May 27, 2021
Opam 2.1.x automation moved this from PR Finalised to Done May 27, 2021
@dra27 dra27 deleted the opam-file-format-upgrade branch May 27, 2021 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Opam 2.1.x
  
Done
Development

Successfully merging this pull request may close these issues.

Enforce opam-version as first non-comment line for > 2.0
2 participants