Thicket data repository for the EEG
at main 41 kB view raw
1{ 2 "id": "https://ryan.freumh.org/2025-02-17.html", 3 "title": "17 Feb 2025", 4 "link": "https://ryan.freumh.org/2025-02-17.html", 5 "updated": "2025-02-17T00:00:00", 6 "published": "2025-02-17T00:00:00", 7 "summary": "<div>\n <span> Previous: <a href=\"2025-02-10.html\">10 Feb 2025</a> </span>\n <span> Next: <a href=\"2025-02-25.html\">25 Feb 2025</a> </span>\n </div>\n \n \n\n <ol>\n<li><p><span>Babel: opam repository with <a href=\"https://github.com/RyanGibb/pubgrub-opam\">pubgrub-opam</a></span></p>\n<ol>\n<li><p><span><span>X</span> <a href=\"https://github.com/RyanGibb/pubgrub-opam/tree/main/example-repo\">tests</a></span></p></li>\n<li><p><span><span>X</span> <a href=\"https://crates.io/crates/pubgrub/0.3.0-alpha.1\">PubGrub\n0.3.0</a></span></p>\n<ul>\n<li><a href=\"https://github.com/astral-sh/uv\">Uv</a> is using the\ndevelopment branch of PubGrub.</li>\n<li>There’s a lot of improvements to be had since the last release was 4\nyears ago.\n<ul>\n<li>The new version bounds will cleanly express version constraints,\ne.g. stop converting <code>&lt;= 1.0.0</code> to <code>&lt; 1.0.0.1</code></li>\n<li>It looks like we might be able to manually add conflicts with <a href=\"https://github.com/pubgrub-rs/pubgrub/blob/23357967c6473b358ffb7c0092e9c3fc4e4c972b/src/internal/core.rs#L94\"><code>add_incompatibility</code></a>\n<ul>\n<li>Ah, actually this is an internal thing.</li>\n</ul></li>\n</ul></li>\n<li>Completed <a href=\"https://github.com/RyanGibb/pubgrub-opam/commit/d67fcfcfd02fc1e5fb720d5f89986d895693dce4\">here</a>.</li>\n</ul></li>\n<li><p><span><span>X</span> conjunctions\nand disjunctions in filtered package formula</span></p>\n<p><span>Take <code>\"D\" { test &amp; &gt; \"2.0.0\"}</code> as an example. We\nencode this as,</span></p>\n<pre><code>(filtered-package-formula-variable-version, 1.0.0) -&gt; (D {(test &amp; = &gt;2.0.0)}, *)\n(D {(test &amp; = &gt;2.0.0)}, false) -&gt; (`test`, false)\n(D {(test &amp; = &gt;2.0.0)}, true) -&gt; (`test`, true), (A, &gt;1.0.0)\n(`test`, false)\n(`test`, true)\n(A, 2.0.0) -&gt; ...\n</code></pre>\n<p><span>Note we introduce a proxy package that depends on\neither the filter being false (with versions stripped out), or the\nfilter being true (with versions part of the equation, taking the union\non conjunctions and intersection on disjunctions).</span></p>\n<p><span>Take <code>\"A\" { test | !test }</code> as an example. We encode\nthis as,</span></p>\n<pre><code>(filtered-package-formula-or, 1.0.0) -&gt; (A {(test | !test)}, *)\n(A {(test | !test)}, false) -&gt; (`test`, ∅)\n(A {(test | !test)}, true) -&gt; (A {(test | !test)}, *)\n(A {(test | !test)}, lhs) -&gt; (`test`, true), (A, *)\n(`test`, true)\n(A, 1.0.0) -&gt; ...\n</code></pre>\n<p><span>Note we combine the versions of the variable <code>test</code> with an intersection which leads to the\nempty set.</span></p></li>\n<li><p><span><span>X</span> comparison of\nbooleans</span></p>\n<p><span>done <a href=\"https://github.com/RyanGibb/pubgrub-opam/commit/d92013104c134372c5bb46443a9301a7eb41e4c9\">here</a>\ne.g.</span></p>\n<pre><code>(filtered-package-formula-equality, 1.0.0) -&gt; (A {(test = build)}, *)\nversions of A {(test = build)}: false, true\n(A {(test = build)}, false) -&gt; ({(test != build)}, *)\nversions of {(test != build)}: lhs, rhs\n({(test != build)}, lhs) -&gt; (`test`, true), (`build`, false)\nversions of `test`: false, true\n(`test`, true)\nversions of `build`: false, true\n(`build`, false)\n</code></pre></li>\n<li><p><span><span>X</span> add support\nfor a ‘root’ package to support setting variable values</span></p>\n<p><span>done <a href=\"https://github.com/RyanGibb/pubgrub-opam/commit/58d0cb69a22c8a396ebc6c42404b17b6a3e909dc\">here</a></span></p></li>\n<li><p><span><span>X</span> <code>ocaml-variants.5.3.1+trunk</code></span></p>\n<p><span>I’m reproducing a <a href=\"https://github.com/ocaml/opam-repository/pull/27472/\">bug</a> in\nopam-repository’s constraints that Patrick found.</span></p>\n<pre><code>$ opam sw create 5.3.1+trunk\n&lt;&gt;&lt;&gt; Installing new switch packages &lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt; 🐫\nSwitch invariant: [&quot;ocaml-variants&quot; {= &quot;5.3.1+trunk&quot;}]\n[ERROR] Could not determine which packages to install for this switch:\n * No agreement on the version of ocaml-variants:\n - (invariant) → ocaml-variants = 5.3.1+trunk → ocaml-compiler &lt; 5.3.0~alpha1 → ocaml = 5.3.0 → ocaml-variants &lt; 5.3.1~\n - (invariant) → ocaml-variants = 5.3.1+trunk\n You can temporarily relax the switch invariant with `--update-invariant'\n * Incompatible packages:\n - (invariant) → ocaml-variants = 5.3.1+trunk → ocaml-compiler &lt; 5.3.0~alpha1 → ocaml = 5.3.0 → dkml-base-compiler &lt; 5.3.1~\n - (invariant) → ocaml-variants = 5.3.1+trunk\n * Incompatible packages:\n - (invariant) → ocaml-variants = 5.3.1+trunk → ocaml-compiler &lt; 5.3.0~alpha1 → ocaml = 5.3.0 → ocaml-base-compiler &gt;= 5.3.0~\n - (invariant) → ocaml-variants = 5.3.1+trunk\n * Missing dependency:\n - (invariant) → ocaml-variants = 5.3.1+trunk → ocaml-compiler &lt; 5.3.0~alpha1 → ocaml = 5.3.0 → ocaml-variants &lt; 5.3.1~ →\n system-msvc\n unmet availability conditions: 'os = &quot;win32&quot;'\n</code></pre>\n<p><span>After <a href=\"https://github.com/RyanGibb/pubgrub-opam/commit/9ab1c0fcba010df7a782a40a13a33db8b01ebe5e\">adding</a>\nconflict-class support (which <a href=\"https://github.com/ocaml/opam-repository/blob/3f0fbcdd62029a20e3cefc8ce578e605f3bf22f8/packages/ocaml-variants/ocaml-variants.5.3.1%2Btrunk/opam#L25C1-L25C38\">are</a>\n<a href=\"https://github.com/ocaml/opam-repository/blob/3f0fbcdd62029a20e3cefc8ce578e605f3bf22f8/packages/ocaml-system/ocaml-system.5.3.0/opam#L49\">required</a>\nfor the ocaml compiler packages) we can reproduce the error:</span></p>\n<pre><code>Because ocaml-system &gt;=5.3.0~, &lt;5.3.1~ depends on Conflict class ocaml-core-compiler ocaml-system and ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on ocaml-system &gt;=5.3.0~, &lt;5.3.1~, ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on Conflict class ocaml-core-compiler ocaml-system. (1)\n\nBecause ocaml-base-compiler &gt;=5.3.0~, &lt;5.3.1~ depends on Conflict class ocaml-core-compiler ocaml-base-compiler and (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on ocaml-base-compiler &gt;=5.3.0~, &lt;5.3.1~, (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on Conflict class ocaml-core-compiler ocaml-base-compiler.\nAnd because (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) &lt;lhs | &gt;lhs depends on ocaml-variants &gt;=5.3.0~, &lt;5.3.1~ and ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}), Conflict class ocaml-core-compiler Not ( ocaml-base-compiler ), ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) lhs, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\nAnd because ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on Conflict class ocaml-core-compiler ocaml-system (1), Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) *, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\nAnd because (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) and (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) &lt;lhs | &gt;lhs depends on dkml-base-compiler &gt;=5.3.0~, &lt;5.3.1~, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) *, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\nAnd because ocaml 5.3.0 depends on (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) and ocaml {(= 5.3.0 &amp; post)} true depends on ocaml 5.3.0, ocaml {(= 5.3.0 &amp; post)} true, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\nAnd because ocaml {(= 5.3.0 &amp; post)} false depends on `post` false and ocaml-compiler 5.3 depends on ocaml {(= 5.3.0 &amp; post)}, ocaml-compiler 5.3, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), `post` Not ( false ), ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\nAnd because ocaml-variants 5.3.1+trunk depends on ocaml-compiler 5.3 and ocaml-variants 5.3.1+trunk depends on Conflict class ocaml-core-compiler ocaml-variants, ocaml-variants 5.3.1+trunk depends on `post` false.\nAnd because Root depends on `post` true and Root depends on ocaml-variants 5.3.1+trunk, Root is forbidden.\n</code></pre>\n<p><span>Let’s break this down.</span></p>\n<pre> <code>\nBecause ocaml-system &gt;=5.3.0~, &lt;5.3.1~ depends on Conflict class ocaml-core-compiler ocaml-system and ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on ocaml-system &gt;=5.3.0~, &lt;5.3.1~, ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on Conflict class ocaml-core-compiler ocaml-system. (1)\n</code> </pre>\n\n<p><span>Because <code>ocaml-system</code>\nis in conflict class <code>ocaml-core-compiler</code>\nand this formula’s right hand side (RHS) depends on <code>ocaml-system</code>, the RHS of the formula depends on\n<code>ocaml-system</code> in the <code>ocaml-core-compiler</code> conflict class.</span></p>\n<pre> <code>\nBecause ocaml-base-compiler &gt;=5.3.0~, &lt;5.3.1~ depends on Conflict class ocaml-core-compiler ocaml-base-compiler and (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on ocaml-base-compiler &gt;=5.3.0~, &lt;5.3.1~, (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on Conflict class ocaml-core-compiler ocaml-base-compiler.\n</code> </pre>\n\n<p><span>Because <code>ocaml-base-compiler</code> is in conflict class <code>ocaml-core-compiler</code> and this formula’s left hand\nside (LHS) depends on <code>ocaml-base-compiler</code>,\nthe LHS of the formula depends on <code>ocaml-base-compiler</code> in the <code>ocaml-core-compiler</code> conflict class.</span></p>\n<pre> <code>\nAnd because (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on ocaml-variants &gt;=5.3.0~, &lt;5.3.1~ and ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}), Conflict class ocaml-core-compiler Not ( ocaml-base-compiler ), ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) lhs, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\n</code> </pre>\n\n<p><span>And because the parent formula’s LHS has it’s RHS\ndepends on <code>ocaml-variants</code>, and the\nformula’s LHS depends on the formula’s LHS (duh), then we can’t select\nthe LHS of the formula (<code>ocaml-base-compiler</code> or <code>ocaml-variants</code>) and not select <code>ocaml-base-compiler</code> and not select\nocaml-variants (phew).</span></p>\n<p><span>Basically, the LHS of the formula depends on\neither <code>ocaml-base-compiler</code> or <code>ocaml-variants</code>.</span></p>\n<pre> <code>\nAnd because ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on Conflict class ocaml-core-compiler ocaml-system (1), Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) *, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\n</code> </pre>\n\n<p><span>Because the formula’s RHS selects <code>ocaml-system</code> in conflict class <code>ocaml-core-compiler</code>, then we can’t select\n(either side of) the formula without selecting <code>ocaml-base-compiler</code> or <code>ocaml-system</code> in <code>ocaml-core-compiler</code>, and <code>ocam-variants</code>.</span></p>\n<pre> <code>\nAnd because (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) and (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on dkml-base-compiler &gt;=5.3.0~, &lt;5.3.1~, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) *, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\n</code> </pre>\n\n<p><span>We can’t select this formula without selecting\n<code>ocaml-base-compiler</code> or <code>ocaml-system</code> in <code>ocaml-core-compiler</code>, and <code>ocam-variants</code>. Note <code>dkml-base-compiler</code> is ignored as there’s not\ncompatible versions.</span></p>\n<pre> <code>\nAnd because ocaml 5.3.0 depends on (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) and ocaml {(= 5.3.0 &amp; post)} true depends on ocaml 5.3.0, ocaml {(= 5.3.0 &amp; post)} true, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\n</code> </pre>\n\n<p><span>If the proxy package associated with the filtered\npackage formula ocaml <code>ocaml {(= 5.3.0 &amp; post)}</code> is\nselected (i.e. version <code>true</code>) then we must\nhave <code>ocaml-base-compiler</code> or <code>ocaml-system</code> in <code>ocaml-core-compiler</code>, and <code>ocam-variants</code>.</span></p>\n<pre> <code>\nAnd because ocaml {(= 5.3.0 &amp; post)} false depends on `post` false and ocaml-compiler 5.3 depends on ocaml {(= 5.3.0 &amp; post)}, ocaml-compiler 5.3, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), `post` Not ( false ), ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\n</code> </pre>\n\n<p><span>If we don’t select this package formula, we need\npost to be false, and <code>ocaml-compiler</code>\ndepends on this formula, so we can’t select ocaml-compiler with <code>post=true</code> without <code>ocaml-base-compiler</code> or <code>ocaml-system</code> in <code>ocaml-core-compiler</code>, and <code>ocam-variants</code>.</span></p>\n<pre> <code>\nAnd because ocaml-variants 5.3.1+trunk depends on ocaml-compiler 5.3 and ocaml-variants 5.3.1+trunk depends on Conflict class ocaml-core-compiler ocaml-variants, ocaml-variants 5.3.1+trunk depends on `post` false.\n</code> </pre>\n\n<p><span>Because <code>ocaml-variants</code> depends on <code>ocaml-compiler</code> and is in conflict class <code>ocaml-core-compiler</code>, we can’t select it without\nhaving <code>post=false</code>.</span></p>\n<pre> <code>\nAnd because Root depends on `post` true and Root depends on ocaml-variants 5.3.1+trunk, Root is forbidden.\n</code> </pre>\n\n<p><span>Since we set <code>post=true</code> at the root, we have a\nconflict.</span></p>\n<p><span>This is all a very roundabout way of telling us\nthat we have a conflict class. This provides a good example to explore\nusing a custom error provider for.</span></p>\n<p><span>After applying the fix, we successfully solve the\ndependencies:</span></p>\n<pre><code>Solution Set:\n opam-version = 2.1.0\n (host-arch-arm64, 1)\n (base-domains, base)\n (ocaml, 5.3.1)\n (host-system-other, 1)\n (base-threads, base)\n os = macos\n (base-unix, base)\n (ocaml-compiler, 5.3)\n (base-bigarray, base)\n (ocaml-config, 3)\n (base-nnp, base)\n (base-effects, base)\n (ocaml-variants, 5.3.1+trunk)\n post = true\n arch = arm64\n\nResolved Dependency Graph:\n (base-bigarray, base)\n (base-domains, base) -&gt; (ocaml, 5.3.1)\n (base-effects, base) -&gt; (ocaml, 5.3.1)\n (base-nnp, base) -&gt; (base-domains, base)\n (base-threads, base)\n (base-unix, base)\n (host-arch-arm64, 1)\n (host-system-other, 1)\n (ocaml, 5.3.1) -&gt; (ocaml-config, 3), (ocaml-variants, 5.3.1+trunk)\n (ocaml-compiler, 5.3) -&gt; (`arch`, arm64), (`opam-version`, 2.1.0), (`os`, macos), (`post`, true), (base-bigarray, base), (base-domains, base), (base-effects, base), (base-nnp, base), (base-threads, base), (base-unix, base), (host-arch-arm64, 1), (host-system-other, 1), (ocaml, 5.3.1)\n (ocaml-config, 3) -&gt; (`os`, macos)\n (ocaml-variants, 5.3.1+trunk) -&gt; (`opam-version`, 2.1.0), (ocaml-compiler, 5.3)\n</code></pre></li>\n<li><p><span><span>O</span> a\nDebian/Alpine encoding in PubGrub, which I think should be much simpler\nthan Opam</span></p>\n<ol>\n<li><p><span><span>O</span> and tie into\nopam with depexts for cross-ecosystem resolutions</span></p></li>\n</ol></li>\n<li><p><span><span>O</span> PubGrub\ncustom error provider</span></p>\n<ul>\n<li>look at <code>test_package_formula_or_error</code></li>\n<li>look at <code>test_opam_repository_ocaml_variants</code></li>\n</ul></li>\n<li><p><span><span>O</span> optional\ndependencies</span></p></li>\n<li><p><span><span>O</span>\nconflicts</span></p>\n<p><span>tracking issue <a href=\"https://github.com/pubgrub-rs/pubgrub/issues/122\">here</a></span></p></li>\n<li><p><span><span>O</span> boolean and\ninteger filter literals</span></p></li>\n<li><p><span><span>O</span> statically\nconfigure possible variable values</span></p></li>\n<li><p><span><span>O</span> read up on\nanswer set programming</span></p>\n<p><span><a href=\"https://pubgrub-rs-guide.pages.dev/internals/intro\">https://pubgrub-rs-guide.pages.dev/internals/intro</a>\nis a good starting point</span></p></li>\n</ol></li>\n<li><p><span>Teaching</span></p>\n<ol>\n<li><p><span>Supervision 2 of Robinson Computer\nNetworking</span></p></li>\n</ol></li>\n</ol>", 8 "content": "<div>\n <span> Previous: <a href=\"2025-02-10.html\">10 Feb 2025</a> </span>\n <span> Next: <a href=\"2025-02-25.html\">25 Feb 2025</a> </span>\n </div>\n \n \n\n <ol>\n<li><p><span>Babel: opam repository with <a href=\"https://github.com/RyanGibb/pubgrub-opam\">pubgrub-opam</a></span></p>\n<ol>\n<li><p><span><span>X</span> <a href=\"https://github.com/RyanGibb/pubgrub-opam/tree/main/example-repo\">tests</a></span></p></li>\n<li><p><span><span>X</span> <a href=\"https://crates.io/crates/pubgrub/0.3.0-alpha.1\">PubGrub\n0.3.0</a></span></p>\n<ul>\n<li><a href=\"https://github.com/astral-sh/uv\">Uv</a> is using the\ndevelopment branch of PubGrub.</li>\n<li>There’s a lot of improvements to be had since the last release was 4\nyears ago.\n<ul>\n<li>The new version bounds will cleanly express version constraints,\ne.g. stop converting <code>&lt;= 1.0.0</code> to <code>&lt; 1.0.0.1</code></li>\n<li>It looks like we might be able to manually add conflicts with <a href=\"https://github.com/pubgrub-rs/pubgrub/blob/23357967c6473b358ffb7c0092e9c3fc4e4c972b/src/internal/core.rs#L94\"><code>add_incompatibility</code></a>\n<ul>\n<li>Ah, actually this is an internal thing.</li>\n</ul></li>\n</ul></li>\n<li>Completed <a href=\"https://github.com/RyanGibb/pubgrub-opam/commit/d67fcfcfd02fc1e5fb720d5f89986d895693dce4\">here</a>.</li>\n</ul></li>\n<li><p><span><span>X</span> conjunctions\nand disjunctions in filtered package formula</span></p>\n<p><span>Take <code>\"D\" { test &amp; &gt; \"2.0.0\"}</code> as an example. We\nencode this as,</span></p>\n<pre><code>(filtered-package-formula-variable-version, 1.0.0) -&gt; (D {(test &amp; = &gt;2.0.0)}, *)\n(D {(test &amp; = &gt;2.0.0)}, false) -&gt; (`test`, false)\n(D {(test &amp; = &gt;2.0.0)}, true) -&gt; (`test`, true), (A, &gt;1.0.0)\n(`test`, false)\n(`test`, true)\n(A, 2.0.0) -&gt; ...\n</code></pre>\n<p><span>Note we introduce a proxy package that depends on\neither the filter being false (with versions stripped out), or the\nfilter being true (with versions part of the equation, taking the union\non conjunctions and intersection on disjunctions).</span></p>\n<p><span>Take <code>\"A\" { test | !test }</code> as an example. We encode\nthis as,</span></p>\n<pre><code>(filtered-package-formula-or, 1.0.0) -&gt; (A {(test | !test)}, *)\n(A {(test | !test)}, false) -&gt; (`test`, ∅)\n(A {(test | !test)}, true) -&gt; (A {(test | !test)}, *)\n(A {(test | !test)}, lhs) -&gt; (`test`, true), (A, *)\n(`test`, true)\n(A, 1.0.0) -&gt; ...\n</code></pre>\n<p><span>Note we combine the versions of the variable <code>test</code> with an intersection which leads to the\nempty set.</span></p></li>\n<li><p><span><span>X</span> comparison of\nbooleans</span></p>\n<p><span>done <a href=\"https://github.com/RyanGibb/pubgrub-opam/commit/d92013104c134372c5bb46443a9301a7eb41e4c9\">here</a>\ne.g.</span></p>\n<pre><code>(filtered-package-formula-equality, 1.0.0) -&gt; (A {(test = build)}, *)\nversions of A {(test = build)}: false, true\n(A {(test = build)}, false) -&gt; ({(test != build)}, *)\nversions of {(test != build)}: lhs, rhs\n({(test != build)}, lhs) -&gt; (`test`, true), (`build`, false)\nversions of `test`: false, true\n(`test`, true)\nversions of `build`: false, true\n(`build`, false)\n</code></pre></li>\n<li><p><span><span>X</span> add support\nfor a ‘root’ package to support setting variable values</span></p>\n<p><span>done <a href=\"https://github.com/RyanGibb/pubgrub-opam/commit/58d0cb69a22c8a396ebc6c42404b17b6a3e909dc\">here</a></span></p></li>\n<li><p><span><span>X</span> <code>ocaml-variants.5.3.1+trunk</code></span></p>\n<p><span>I’m reproducing a <a href=\"https://github.com/ocaml/opam-repository/pull/27472/\">bug</a> in\nopam-repository’s constraints that Patrick found.</span></p>\n<pre><code>$ opam sw create 5.3.1+trunk\n&lt;&gt;&lt;&gt; Installing new switch packages &lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt;&lt;&gt; 🐫\nSwitch invariant: [&quot;ocaml-variants&quot; {= &quot;5.3.1+trunk&quot;}]\n[ERROR] Could not determine which packages to install for this switch:\n * No agreement on the version of ocaml-variants:\n - (invariant) → ocaml-variants = 5.3.1+trunk → ocaml-compiler &lt; 5.3.0~alpha1 → ocaml = 5.3.0 → ocaml-variants &lt; 5.3.1~\n - (invariant) → ocaml-variants = 5.3.1+trunk\n You can temporarily relax the switch invariant with `--update-invariant'\n * Incompatible packages:\n - (invariant) → ocaml-variants = 5.3.1+trunk → ocaml-compiler &lt; 5.3.0~alpha1 → ocaml = 5.3.0 → dkml-base-compiler &lt; 5.3.1~\n - (invariant) → ocaml-variants = 5.3.1+trunk\n * Incompatible packages:\n - (invariant) → ocaml-variants = 5.3.1+trunk → ocaml-compiler &lt; 5.3.0~alpha1 → ocaml = 5.3.0 → ocaml-base-compiler &gt;= 5.3.0~\n - (invariant) → ocaml-variants = 5.3.1+trunk\n * Missing dependency:\n - (invariant) → ocaml-variants = 5.3.1+trunk → ocaml-compiler &lt; 5.3.0~alpha1 → ocaml = 5.3.0 → ocaml-variants &lt; 5.3.1~ →\n system-msvc\n unmet availability conditions: 'os = &quot;win32&quot;'\n</code></pre>\n<p><span>After <a href=\"https://github.com/RyanGibb/pubgrub-opam/commit/9ab1c0fcba010df7a782a40a13a33db8b01ebe5e\">adding</a>\nconflict-class support (which <a href=\"https://github.com/ocaml/opam-repository/blob/3f0fbcdd62029a20e3cefc8ce578e605f3bf22f8/packages/ocaml-variants/ocaml-variants.5.3.1%2Btrunk/opam#L25C1-L25C38\">are</a>\n<a href=\"https://github.com/ocaml/opam-repository/blob/3f0fbcdd62029a20e3cefc8ce578e605f3bf22f8/packages/ocaml-system/ocaml-system.5.3.0/opam#L49\">required</a>\nfor the ocaml compiler packages) we can reproduce the error:</span></p>\n<pre><code>Because ocaml-system &gt;=5.3.0~, &lt;5.3.1~ depends on Conflict class ocaml-core-compiler ocaml-system and ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on ocaml-system &gt;=5.3.0~, &lt;5.3.1~, ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on Conflict class ocaml-core-compiler ocaml-system. (1)\n\nBecause ocaml-base-compiler &gt;=5.3.0~, &lt;5.3.1~ depends on Conflict class ocaml-core-compiler ocaml-base-compiler and (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on ocaml-base-compiler &gt;=5.3.0~, &lt;5.3.1~, (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on Conflict class ocaml-core-compiler ocaml-base-compiler.\nAnd because (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) &lt;lhs | &gt;lhs depends on ocaml-variants &gt;=5.3.0~, &lt;5.3.1~ and ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}), Conflict class ocaml-core-compiler Not ( ocaml-base-compiler ), ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) lhs, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\nAnd because ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on Conflict class ocaml-core-compiler ocaml-system (1), Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) *, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\nAnd because (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) and (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) &lt;lhs | &gt;lhs depends on dkml-base-compiler &gt;=5.3.0~, &lt;5.3.1~, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) *, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\nAnd because ocaml 5.3.0 depends on (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) and ocaml {(= 5.3.0 &amp; post)} true depends on ocaml 5.3.0, ocaml {(= 5.3.0 &amp; post)} true, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\nAnd because ocaml {(= 5.3.0 &amp; post)} false depends on `post` false and ocaml-compiler 5.3 depends on ocaml {(= 5.3.0 &amp; post)}, ocaml-compiler 5.3, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), `post` Not ( false ), ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\nAnd because ocaml-variants 5.3.1+trunk depends on ocaml-compiler 5.3 and ocaml-variants 5.3.1+trunk depends on Conflict class ocaml-core-compiler ocaml-variants, ocaml-variants 5.3.1+trunk depends on `post` false.\nAnd because Root depends on `post` true and Root depends on ocaml-variants 5.3.1+trunk, Root is forbidden.\n</code></pre>\n<p><span>Let’s break this down.</span></p>\n<pre> <code>\nBecause ocaml-system &gt;=5.3.0~, &lt;5.3.1~ depends on Conflict class ocaml-core-compiler ocaml-system and ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on ocaml-system &gt;=5.3.0~, &lt;5.3.1~, ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on Conflict class ocaml-core-compiler ocaml-system. (1)\n</code> </pre>\n\n<p><span>Because <code>ocaml-system</code>\nis in conflict class <code>ocaml-core-compiler</code>\nand this formula’s right hand side (RHS) depends on <code>ocaml-system</code>, the RHS of the formula depends on\n<code>ocaml-system</code> in the <code>ocaml-core-compiler</code> conflict class.</span></p>\n<pre> <code>\nBecause ocaml-base-compiler &gt;=5.3.0~, &lt;5.3.1~ depends on Conflict class ocaml-core-compiler ocaml-base-compiler and (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on ocaml-base-compiler &gt;=5.3.0~, &lt;5.3.1~, (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on Conflict class ocaml-core-compiler ocaml-base-compiler.\n</code> </pre>\n\n<p><span>Because <code>ocaml-base-compiler</code> is in conflict class <code>ocaml-core-compiler</code> and this formula’s left hand\nside (LHS) depends on <code>ocaml-base-compiler</code>,\nthe LHS of the formula depends on <code>ocaml-base-compiler</code> in the <code>ocaml-core-compiler</code> conflict class.</span></p>\n<pre> <code>\nAnd because (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on ocaml-variants &gt;=5.3.0~, &lt;5.3.1~ and ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on (ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~}), Conflict class ocaml-core-compiler Not ( ocaml-base-compiler ), ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) lhs, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\n</code> </pre>\n\n<p><span>And because the parent formula’s LHS has it’s RHS\ndepends on <code>ocaml-variants</code>, and the\nformula’s LHS depends on the formula’s LHS (duh), then we can’t select\nthe LHS of the formula (<code>ocaml-base-compiler</code> or <code>ocaml-variants</code>) and not select <code>ocaml-base-compiler</code> and not select\nocaml-variants (phew).</span></p>\n<p><span>Basically, the LHS of the formula depends on\neither <code>ocaml-base-compiler</code> or <code>ocaml-variants</code>.</span></p>\n<pre> <code>\nAnd because ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) rhs depends on Conflict class ocaml-core-compiler ocaml-system (1), Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) *, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\n</code> </pre>\n\n<p><span>Because the formula’s RHS selects <code>ocaml-system</code> in conflict class <code>ocaml-core-compiler</code>, then we can’t select\n(either side of) the formula without selecting <code>ocaml-base-compiler</code> or <code>ocaml-system</code> in <code>ocaml-core-compiler</code>, and <code>ocam-variants</code>.</span></p>\n<pre> <code>\nAnd because (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on ((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~}) and (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) lhs depends on dkml-base-compiler &gt;=5.3.0~, &lt;5.3.1~, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) *, ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\n</code> </pre>\n\n<p><span>We can’t select this formula without selecting\n<code>ocaml-base-compiler</code> or <code>ocaml-system</code> in <code>ocaml-core-compiler</code>, and <code>ocam-variants</code>. Note <code>dkml-base-compiler</code> is ignored as there’s not\ncompatible versions.</span></p>\n<pre> <code>\nAnd because ocaml 5.3.0 depends on (((ocaml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) | (ocaml-variants {= &gt;=5.3.0~, &lt;5.3.1~})) | (ocaml-system {= &gt;=5.3.0~, &lt;5.3.1~})) | (dkml-base-compiler {= &gt;=5.3.0~, &lt;5.3.1~}) and ocaml {(= 5.3.0 &amp; post)} true depends on ocaml 5.3.0, ocaml {(= 5.3.0 &amp; post)} true, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\n</code> </pre>\n\n<p><span>If the proxy package associated with the filtered\npackage formula ocaml <code>ocaml {(= 5.3.0 &amp; post)}</code> is\nselected (i.e. version <code>true</code>) then we must\nhave <code>ocaml-base-compiler</code> or <code>ocaml-system</code> in <code>ocaml-core-compiler</code>, and <code>ocam-variants</code>.</span></p>\n<pre> <code>\nAnd because ocaml {(= 5.3.0 &amp; post)} false depends on `post` false and ocaml-compiler 5.3 depends on ocaml {(= 5.3.0 &amp; post)}, ocaml-compiler 5.3, Conflict class ocaml-core-compiler Not ( ocaml-base-compiler | ocaml-system ), `post` Not ( false ), ocaml-variants Not ( &gt;=5.3.0~, &lt;5.3.1~ ) are incompatible.\n</code> </pre>\n\n<p><span>If we don’t select this package formula, we need\npost to be false, and <code>ocaml-compiler</code>\ndepends on this formula, so we can’t select ocaml-compiler with <code>post=true</code> without <code>ocaml-base-compiler</code> or <code>ocaml-system</code> in <code>ocaml-core-compiler</code>, and <code>ocam-variants</code>.</span></p>\n<pre> <code>\nAnd because ocaml-variants 5.3.1+trunk depends on ocaml-compiler 5.3 and ocaml-variants 5.3.1+trunk depends on Conflict class ocaml-core-compiler ocaml-variants, ocaml-variants 5.3.1+trunk depends on `post` false.\n</code> </pre>\n\n<p><span>Because <code>ocaml-variants</code> depends on <code>ocaml-compiler</code> and is in conflict class <code>ocaml-core-compiler</code>, we can’t select it without\nhaving <code>post=false</code>.</span></p>\n<pre> <code>\nAnd because Root depends on `post` true and Root depends on ocaml-variants 5.3.1+trunk, Root is forbidden.\n</code> </pre>\n\n<p><span>Since we set <code>post=true</code> at the root, we have a\nconflict.</span></p>\n<p><span>This is all a very roundabout way of telling us\nthat we have a conflict class. This provides a good example to explore\nusing a custom error provider for.</span></p>\n<p><span>After applying the fix, we successfully solve the\ndependencies:</span></p>\n<pre><code>Solution Set:\n opam-version = 2.1.0\n (host-arch-arm64, 1)\n (base-domains, base)\n (ocaml, 5.3.1)\n (host-system-other, 1)\n (base-threads, base)\n os = macos\n (base-unix, base)\n (ocaml-compiler, 5.3)\n (base-bigarray, base)\n (ocaml-config, 3)\n (base-nnp, base)\n (base-effects, base)\n (ocaml-variants, 5.3.1+trunk)\n post = true\n arch = arm64\n\nResolved Dependency Graph:\n (base-bigarray, base)\n (base-domains, base) -&gt; (ocaml, 5.3.1)\n (base-effects, base) -&gt; (ocaml, 5.3.1)\n (base-nnp, base) -&gt; (base-domains, base)\n (base-threads, base)\n (base-unix, base)\n (host-arch-arm64, 1)\n (host-system-other, 1)\n (ocaml, 5.3.1) -&gt; (ocaml-config, 3), (ocaml-variants, 5.3.1+trunk)\n (ocaml-compiler, 5.3) -&gt; (`arch`, arm64), (`opam-version`, 2.1.0), (`os`, macos), (`post`, true), (base-bigarray, base), (base-domains, base), (base-effects, base), (base-nnp, base), (base-threads, base), (base-unix, base), (host-arch-arm64, 1), (host-system-other, 1), (ocaml, 5.3.1)\n (ocaml-config, 3) -&gt; (`os`, macos)\n (ocaml-variants, 5.3.1+trunk) -&gt; (`opam-version`, 2.1.0), (ocaml-compiler, 5.3)\n</code></pre></li>\n<li><p><span><span>O</span> a\nDebian/Alpine encoding in PubGrub, which I think should be much simpler\nthan Opam</span></p>\n<ol>\n<li><p><span><span>O</span> and tie into\nopam with depexts for cross-ecosystem resolutions</span></p></li>\n</ol></li>\n<li><p><span><span>O</span> PubGrub\ncustom error provider</span></p>\n<ul>\n<li>look at <code>test_package_formula_or_error</code></li>\n<li>look at <code>test_opam_repository_ocaml_variants</code></li>\n</ul></li>\n<li><p><span><span>O</span> optional\ndependencies</span></p></li>\n<li><p><span><span>O</span>\nconflicts</span></p>\n<p><span>tracking issue <a href=\"https://github.com/pubgrub-rs/pubgrub/issues/122\">here</a></span></p></li>\n<li><p><span><span>O</span> boolean and\ninteger filter literals</span></p></li>\n<li><p><span><span>O</span> statically\nconfigure possible variable values</span></p></li>\n<li><p><span><span>O</span> read up on\nanswer set programming</span></p>\n<p><span><a href=\"https://pubgrub-rs-guide.pages.dev/internals/intro\">https://pubgrub-rs-guide.pages.dev/internals/intro</a>\nis a good starting point</span></p></li>\n</ol></li>\n<li><p><span>Teaching</span></p>\n<ol>\n<li><p><span>Supervision 2 of Robinson Computer\nNetworking</span></p></li>\n</ol></li>\n</ol>", 9 "content_type": "html", 10 "categories": [], 11 "source": "https://ryan.freumh.org/atom.xml" 12}