Allow multiple versions of upstream patched packages #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.