ocurrent / obuilder

Experimental "docker build" alternative using btrfs/zfs snapshots
Apache License 2.0
60 stars 17 forks source link

Opam-specific functionality for Obuilder spec files #146

Closed benmandrew closed 10 months ago

benmandrew commented 1 year ago

OCaml-CI and opam-repo-ci share a lot of platform-specific code for generating OBuilder spec files. This PR is a work-in-progress to extract some of that shared opam-related code out, in a similar manner to ocaml-dockerfile-opam in ocurrent/ocaml-dockerfile.

benmandrew commented 1 year ago

This PR contributes towards https://github.com/ocurrent/ocaml-ci/issues/682.

benmandrew commented 1 year ago

Side-note: distro.ml is mostly copied from dockerfile-opam as it felt wrong for an OBuilder spec library to depend on the Dockerfile library! This file accounts for well over half of the new LOC, so it may be useful to extract this redundancy out at some point in the future.

MisterDA commented 1 year ago

While I understand the reason behind the duplication, it is already cumbersome to keep the distro list in sync with the real-world. Unless we extract it from dockerfile-opam, I'm afraid duplication will introduce more problems that it's trying to solve.

benmandrew commented 1 year ago

The difficulty is that dockerfile-opam does not have any consideration for MacOS. Adding support was attempted but there was some reasonable pushback here — https://github.com/ocurrent/ocaml-dockerfile/pull/118#issuecomment-1280839961.

@tmcgilchrist do you think this warrants extraction of the shared distro information, with MacOS added, into some 'opam-distro' project? It no longer seems only relevant to Docker; increasingly many projects now are using the Distro module alone.

benmandrew commented 10 months ago

This is no longer planned for the time being.