Allow multiple versions of upstream patched packages#27
Allow multiple versions of upstream patched packages#27dra27 wants to merge 4 commits intooxcaml:mainfrom
Conversation
oxcaml-foo.guard ensures unpatched upstreams aren't available oxcaml-foo-patches.enabled depends on patched versions of the upstream package.
Two-fold reason: 1. Fully automates the generation of the infrastructure (because ocaml-variants.5.2.0+ox now always refers just to oxcaml-patch-guards) 2. Avoids a DNF explosion in opam
|
This is draft for two reasons - firstly, I expect that the changes made in the first two commits should be mechanically applied by a generator. Secondly, the process of doing this has revealed a possible problem with the Zarith 1.14 patches added in #14 and I'd like to investigate that further. |
|
Thanks @dra27! Approach looks sound to me, although I'm a bit worried that I've broken something with my Zarith 1.14 fix! |
|
See avsm/Zarith#1! |
There was a problem hiding this comment.
Does layout.sh have to be in this repo, instead of being inside our internal public release infra? I suppose it makes it easier for external contributors to add patched versions. Is that the motivation?
There was a problem hiding this comment.
It doesn't have to be in this repo, indeed - I was expecting either that we'd merge it with public release infra or that it would be replaced with something better and put properly in this repo (or both!). It is useful for contributors to be able to run it (the cherry-picked commits in unified all run it to update the guards as well)
sexplib0 is the actual released root package. basement and sexp_type are new with v0.18 and at present unreleased. This prevents any pre-0.18 JS libraries being installed with OxCaml.
layout.sh generates packages/oxcaml-* oxcaml-foo.guard ensures unpatched upstreams aren't available oxcaml-foo-patches.enabled depends on patched versions of the upstream package. The disjunction is chained across all the packages, rather than just having one set of disjunctions in oxcaml-patch-guards as this avoids a DNF explosion in opam. The compiler package itself just has to depend on oxcaml-patch-guards.
oxcaml-foo.guard ensures unpatched upstreams aren't available oxcaml-foo-patches.enabled depends on patched versions of the upstream package. The disjunction is chained across all the packages, rather than just having one set of disjunctions in oxcaml-patch-guards as this avoids a DNF explosion in opam. The compiler package itself just has to depend on oxcaml-patch-guards.
sexplib0 is the actual released root package. basement and sexp_type are new with v0.18 and at present unreleased. This prevents any pre-0.18 JS libraries being installed with OxCaml.
layout.sh generates packages/oxcaml-* oxcaml-foo.guard ensures unpatched upstreams aren't available oxcaml-foo-patches.enabled depends on patched versions of the upstream package. The disjunction is chained across all the packages, rather than just having one set of disjunctions in oxcaml-patch-guards as this avoids a DNF explosion in opam. The compiler package itself just has to depend on oxcaml-patch-guards.
oxcaml-foo.guard ensures unpatched upstreams aren't available oxcaml-foo-patches.enabled depends on patched versions of the upstream package. The disjunction is chained across all the packages, rather than just having one set of disjunctions in oxcaml-patch-guards as this avoids a DNF explosion in opam. The compiler package itself just has to depend on oxcaml-patch-guards.
|
A version of this has been pushed main |
This is an attempt to unblock #23.
There are various upstream packages which require patches for OxCaml. If a package has been patched, then switches based on OxCaml must use a patched version. At the moment, this is enforced in two ways:
The main idea behind this repo is that it's a "bleeding edge" repo, but #23 highlights that occasionally we're not in total agreement (between "JS OxCaml" and "Community OxCaml") as to which edge is the bleeding one.......
This PR proposes a different approach - we regard the compiler as the bleeding edge. That means that everything in this repo must be built with the single ocaml-variants.5.2.0+ox package in it. However, it relaxes that constraint for the upstream patched packages.
The first two commits restore the constraints on these packages to their "original" (or at least close to original) versions. For example, alcotest.1.9.0+ox now depends on uutf ≥ 1.0.1 instead of exactly depending on uutf.1.0.3+ox.
The third commit is where the magic happens. Instead of having a massive conflicts clause in ocaml-variants.5.2.0+ox:
we just have a single dependency on a new package oxcaml-patch-guards which is generated by
layout.shand consists of adependsfield:with one of these disjunctions for each patched upstream package.
layout.shalso generates all of these packages, with oxcaml-zarith containing a conflicts clause conflicting all versions of alcotest and also the oxcaml-zarith-patches package:and then oxcaml-zarith-patches conflicts the oxcaml-zarith package but then depends on the patched version(s) of zarith:
This somewhat convoluted (but fully automated) set-up means that when an OxCaml switch is created, a whole load of dummy oxcaml- packages now get added. However, those packages prevent un-patched versions of dependencies from being installed, for example:
It's now possible to reformulate @avsm's #23 as a much simpler PR which:
and this can be seen previewed in dra27#2 and then allows:
The only snag is for packages which packages which actually refer to an OCaml version - see ocaml-index and ocaml-lsp-server, for example. Fortunately, this should be quite rare, since most packages which depend on an exact version tend to be structured to use
{= version}-style constraints instead.