ocaml / opam-file-format

Parser and printer for the opam file syntax
Other
15 stars 23 forks source link

2.1 readiness #23

Closed dra27 closed 4 years ago

dra27 commented 4 years ago

A slew of housekeeping:

I have used the version number 2.1, however we might want to consider whether that's correct - opam 2.0 should be updated to build with this (as it will allow opam-repository to benefit from the fix for strings containing newlines)

dra27 commented 4 years ago

Oops - the src/META file was still committed, which I've updated.

Most of this is of course just text and formatting. Some detail on the actual changes.

Generating src/META

This stops duplication of the version number which is already in the opam file. This will always work because the opam file is included in the release tarball. The opam package supports installation on systems without the native code compiler, but technically we generate an invalid META file at this point, since it includes archive(native) = "opam-file-format.cmxa" even though it wasn't built. That gets fixed by compiling src/META after everything is built.

Just to show my local testing:

( make clean; make byte ) &>/dev/null; cat src/META
version = "2.1.0"
description = "Parser and printer for the opam file syntax"
archive(byte) = "opam-file-format.cma"

and

( make clean; make all ) &>/dev/null; cat src/META
version = "2.1.0"
description = "Parser and printer for the opam file syntax"
archive(byte) = "opam-file-format.cma"
archive(native) = "opam-file-format.cmxa"

Changes to the opam file

The remove field is gone, falling back to relying on opam's file tracking instead (that means that the downstream flags: light-uninstall could go when it's next released too). dune is now listed as a depopt so that opam-file-format builds with Dune if it's available and, more importantly, is rebuilt if Dune is added to a switch. This is important for Dune as it means that the dune-package file for opam-file-format gets generated and installed.

rjbou commented 4 years ago

Thanks! & sorry for dropped comments