camlzip icon indicating copy to clipboard operation
camlzip copied to clipboard

build with dune

Open olafhering opened this issue 4 years ago • 11 comments

also make use of stdlib-shims, but this is of course optional IMHO.

olafhering avatar Mar 03 '20 09:03 olafhering

Not sure if an opam environment requires an additional dependency to some sort of pkg-config

olafhering avatar Mar 03 '20 09:03 olafhering

conf-pkg-config indeed exists in opam. If @xavierleroy is interested in this MR, it could be improved by updating the Makefile so that the usual make, make install works. Moreover the META files in the repository can be removed. Finally if camlzip is a deprecated name (or the new one?) it could be specified in the dune file.

bobot avatar May 18 '20 13:05 bobot

@olafhering this is an invalid opam package, leading your opam file to be invalid, it should be dune-configurator instead https://github.com/olafhering/ocaml-camlzip/blob/dune-master/dune-project#L21

EduardoRFS avatar May 31 '21 09:05 EduardoRFS

I'm not convinced that there is any benefit to switching Camlzip to Dune. Maybe you could enlighten me? At any rate, the two ocamlfind package names "zip" and "camlzip" are here to stay.

xavierleroy avatar Jun 02 '21 14:06 xavierleroy

Mature packages that doesn't change much have less incentive to move to dune, and adding problems because of the transition would be sad, but:

  • It reduces maintenance cost; changes like #33 would not be needed since dune handles change in conventions of OCaml librairies
  • It is easier to test and develop modifications of camlzip for other projects which use dune because it is sufficient to add camlzip as a subdirectory for dune to use this version

To reduce breaking changes:

  • if moving to wrapped is wanted: (wrapped (transition <message>)) can be used to generate the unwrapped version alongside the wrapped version
  • I don't know which is the new library and the old one, in any case deprecated-library-name can be used to indicate an alias and generate the needed META file.

bobot avatar Jun 03 '21 10:06 bobot

The main benefit that I see is having the wrapper, currently camlzip fails to build with zlib.

EduardoRFS avatar Jun 03 '21 13:06 EduardoRFS

currently camlzip fails to build with zlib.

I'm not aware of this issue. Can you elaborate?

xavierleroy avatar Jun 03 '21 16:06 xavierleroy

@xavierleroy module name conflict, camlzip has a module called zlib, zlib is a library called zlib, so it will fail at link time because camlzip is not wrapped. Of course making it wrapped is also a breaking change on the API but we can have both for now, wrapped and non wrapped.

http://opam.ocaml.org/packages/zlib

EduardoRFS avatar Jun 04 '21 09:06 EduardoRFS

I recently worked on an update of this port for opam-monorepo. I believe it addresses some of the original issues that were mentioned here. I'd be happy to submit a PR if you are interested.

The port is available here: https://github.com/dune-universe/camlzip/tree/dune-universe-v1.11. The strategy is described in the first section of the README there.

NathanReb avatar Mar 11 '22 14:03 NathanReb

For the deprecated names, neither deprecated-library-names and deprecated_package_names were satisfying?

bobot avatar Mar 11 '22 17:03 bobot

I didn't use these features because the dune-universe ports aim is to strictly stick to build system changes and remain as close as possible to the upstream version. I assumed they would trigger warnings which is what I wanted to avoid. If I assumed wrong, I'd be happy to use them instead!

It also seems that @xavierleroy has no intention to deprecate either library names.

If the maintainers wish to switch to dune, I'm more than happy to open a PR and adapt it however they see fit, including deprecating one of the lib name or wrapping the library to avoid modules clashes!

NathanReb avatar Mar 14 '22 11:03 NathanReb