From c287b0599c4a02a30d483963aefb14d1b3223e3f Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Wed, 11 Sep 2024 17:35:30 +0200 Subject: [PATCH] fixing CI dependencies --- .github/workflows/nix-action-coq-master.yml | 38 +++++++++++++++++-- .nix/coq-overlays/stdlib-html/default.nix | 11 ++++-- .../stdlib-refman-html/default.nix | 10 +++-- .../stdlib-subcomponents/default.nix | 6 +-- .nix/coq-overlays/stdlib-test/default.nix | 9 +++-- 5 files changed, 56 insertions(+), 18 deletions(-) diff --git a/.github/workflows/nix-action-coq-master.yml b/.github/workflows/nix-action-coq-master.yml index da2878973d..b99a299db3 100644 --- a/.github/workflows/nix-action-coq-master.yml +++ b/.github/workflows/nix-action-coq-master.yml @@ -5770,7 +5770,8 @@ jobs: run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" --argstr job "stdlib" stdlib-html: - needs: [] + needs: + - coq runs-on: ubuntu-latest steps: - name: Determine which commit to initially checkout @@ -5812,12 +5813,18 @@ jobs: \ bundle \"coq-master\" --argstr job \"stdlib-html\" \\\n --dry-run 2>&1\ \ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\ built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n" + - if: steps.stepCheck.outputs.status == 'built' + name: 'Building/fetching previous CI target: coq' + run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" + --argstr job "coq" - if: steps.stepCheck.outputs.status == 'built' name: Building/fetching current CI target run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" --argstr job "stdlib-html" stdlib-refman-html: - needs: [] + needs: + - coq + - stdlib runs-on: ubuntu-latest steps: - name: Determine which commit to initially checkout @@ -5859,12 +5866,21 @@ jobs: \ bundle \"coq-master\" --argstr job \"stdlib-refman-html\" \\\n --dry-run\ \ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\ \ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n" + - if: steps.stepCheck.outputs.status == 'built' + name: 'Building/fetching previous CI target: coq' + run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" + --argstr job "coq" + - if: steps.stepCheck.outputs.status == 'built' + name: 'Building/fetching previous CI target: stdlib' + run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" + --argstr job "stdlib" - if: steps.stepCheck.outputs.status == 'built' name: Building/fetching current CI target run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" --argstr job "stdlib-refman-html" stdlib-subcomponents: - needs: [] + needs: + - coq runs-on: ubuntu-latest steps: - name: Determine which commit to initially checkout @@ -5906,12 +5922,18 @@ jobs: \ bundle \"coq-master\" --argstr job \"stdlib-subcomponents\" \\\n --dry-run\ \ 2>&1 > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep\ \ \"built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n" + - if: steps.stepCheck.outputs.status == 'built' + name: 'Building/fetching previous CI target: coq' + run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" + --argstr job "coq" - if: steps.stepCheck.outputs.status == 'built' name: Building/fetching current CI target run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" --argstr job "stdlib-subcomponents" stdlib-test: - needs: [] + needs: + - coq + - stdlib runs-on: ubuntu-latest steps: - name: Determine which commit to initially checkout @@ -5953,6 +5975,14 @@ jobs: \ bundle \"coq-master\" --argstr job \"stdlib-test\" \\\n --dry-run 2>&1\ \ > /dev/null)\necho $nb_dry_run\necho status=$(echo $nb_dry_run | grep \"\ built:\" | sed \"s/.*/built/\") >> $GITHUB_OUTPUT\n" + - if: steps.stepCheck.outputs.status == 'built' + name: 'Building/fetching previous CI target: coq' + run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" + --argstr job "coq" + - if: steps.stepCheck.outputs.status == 'built' + name: 'Building/fetching previous CI target: stdlib' + run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" + --argstr job "stdlib" - if: steps.stepCheck.outputs.status == 'built' name: Building/fetching current CI target run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "coq-master" diff --git a/.nix/coq-overlays/stdlib-html/default.nix b/.nix/coq-overlays/stdlib-html/default.nix index 22ec6dc8cc..b147f163fe 100644 --- a/.nix/coq-overlays/stdlib-html/default.nix +++ b/.nix/coq-overlays/stdlib-html/default.nix @@ -1,10 +1,13 @@ -{ graphviz, stdlib }: -stdlib.overrideAttrs (o: { - buildInputs = o.buildInputs ++ [ graphviz ]; +{ graphviz, stdlib, coqPackages }: + +coqPackages.lib.overrideCoqDerivation { + pname = "stdlib-html"; + + overrideBuildInputs = stdlib.buildInputs ++ [ graphviz ]; preBuild = '' patchShebangs doc/stdlib/make-library-index ''; buildFlags = [ "stdlib-html" ]; -}) +} stdlib diff --git a/.nix/coq-overlays/stdlib-refman-html/default.nix b/.nix/coq-overlays/stdlib-refman-html/default.nix index bab228d23d..9a4cb8256a 100644 --- a/.nix/coq-overlays/stdlib-refman-html/default.nix +++ b/.nix/coq-overlays/stdlib-refman-html/default.nix @@ -1,7 +1,9 @@ -{ antlr4_9, python311, coq, stdlib }: +{ antlr4_9, python311, coq, stdlib, coqPackages }: -stdlib.overrideAttrs (o: { - buildInputs = o.buildInputs ++ [ coq.ocamlPackages.ocaml coq.ocamlPackages.dune_3 stdlib ] +coqPackages.lib.overrideCoqDerivation { + pname = "stdlib-refman-html"; + + overrideBuildInputs = stdlib.buildInputs ++ [ coq.ocamlPackages.ocaml coq.ocamlPackages.dune_3 stdlib ] ++ [ # Sphinx doc dependencies (python311.withPackages @@ -16,4 +18,4 @@ stdlib.overrideAttrs (o: { echo "nothing to install" touch $out ''; -}) +} stdlib diff --git a/.nix/coq-overlays/stdlib-subcomponents/default.nix b/.nix/coq-overlays/stdlib-subcomponents/default.nix index b27135626a..353f59afe8 100644 --- a/.nix/coq-overlays/stdlib-subcomponents/default.nix +++ b/.nix/coq-overlays/stdlib-subcomponents/default.nix @@ -1,7 +1,7 @@ # CI job to test that we don't break the subcomponent structure of the stdlib, # as described in the graph doc/stdlib/depends -{ stdlib }: +{ stdlib, coqPackages }: let # stdlib subcomponents with their dependencies @@ -54,7 +54,7 @@ let stdlib_ = component: let pname = "stdlib-${component}"; stdlib-deps = map stdlib_ components.${component}; - in stdlib.overrideAttrs ({ + in coqPackages.lib.overrideCoqDerivation ({ inherit pname; propagatedBuildInputs = stdlib-deps; } // (if component != "all" then { @@ -67,5 +67,5 @@ let installPhase = '' echo "nothing left to install" ''; - })); + })) stdlib; in stdlib_ "all" diff --git a/.nix/coq-overlays/stdlib-test/default.nix b/.nix/coq-overlays/stdlib-test/default.nix index 650a60aece..b5bcfdd355 100644 --- a/.nix/coq-overlays/stdlib-test/default.nix +++ b/.nix/coq-overlays/stdlib-test/default.nix @@ -1,6 +1,9 @@ -{ rsync, coq, stdlib }: +{ rsync, coq, stdlib, coqPackages }: + +coqPackages.lib.overrideCoqDerivation { + + pname = "stdlib-test"; -stdlib.overrideAttrs { propagatedBuildInputs = [ rsync stdlib ] ++ (with coq.ocamlPackages; [ ocaml findlib zarith ]); @@ -11,4 +14,4 @@ stdlib.overrideAttrs { installPhase = '' echo "nothing to install" ''; -} +} stdlib