|
| 1 | +# CI job to test that we don't break the subcomponent structure of the stdlib, |
| 2 | +# as described in the graph doc/stdlib/depends |
| 3 | + |
| 4 | +{ coq, stdlib, coqPackages }: |
| 5 | + |
| 6 | +let |
| 7 | + # stdlib subcomponents with their dependencies |
| 8 | + # when editing this, ensure to keep doc/stdlib/depends in sync |
| 9 | + components = { |
| 10 | + "corelib-wrapper" = [ ]; |
| 11 | + "logic" = [ ]; |
| 12 | + "relations" = [ "corelib-wrapper" ]; |
| 13 | + "program" = [ "corelib-wrapper" "logic" ]; |
| 14 | + "classes" = [ "program" "relations" ]; |
| 15 | + "bool" = [ "classes" ]; |
| 16 | + "structures" = [ "bool" ]; |
| 17 | + "arith-base" = [ "structures" ]; |
| 18 | + "positive" = [ "arith-base" ]; |
| 19 | + "narith" = [ "positive" ]; |
| 20 | + "zarith-base" = [ "narith" ]; |
| 21 | + "lists" = [ "arith-base" ]; |
| 22 | + "ring" = [ "zarith-base" "lists" ]; |
| 23 | + "arith" = [ "ring" ]; |
| 24 | + "strings" = [ "arith" ]; |
| 25 | + "lia" = [ "arith" ]; |
| 26 | + "zarith" = [ "lia" ]; |
| 27 | + "qarith-base" = [ "ring" ]; |
| 28 | + "field" = [ "qarith-base" "zarith" ]; |
| 29 | + "lqa" = [ "field" ]; |
| 30 | + "qarith" = [ "field" ]; |
| 31 | + "nsatz" = [ "zarith" "qarith-base" ]; |
| 32 | + "classical-logic" = [ "arith" ]; |
| 33 | + "sets" = [ "classical-logic" ]; |
| 34 | + "vectors" = [ "lists" ]; |
| 35 | + "sorting" = [ "lia" "sets" "vectors" ]; |
| 36 | + "orders-ex" = [ "strings" "sorting" ]; |
| 37 | + "unicode" = [ ]; |
| 38 | + "primitive-int" = [ "unicode" "zarith" ]; |
| 39 | + "primitive-floats" = [ "primitive-int" ]; |
| 40 | + "primitive-array" = [ "primitive-int" ]; |
| 41 | + "primitive-string" = [ "primitive-int" "orders-ex" ]; |
| 42 | + "reals" = [ "nsatz" "lqa" "qarith" "classical-logic" "vectors" ]; |
| 43 | + "fmaps-fsets-msets" = [ "orders-ex" "zarith" ]; |
| 44 | + "extraction" = [ "primitive-string" "primitive-array" "primitive-floats" ]; |
| 45 | + "funind" = [ "arith-base" ]; |
| 46 | + "wellfounded" = [ "lists" ]; |
| 47 | + "streams" = [ "logic" ]; |
| 48 | + "rtauto" = [ "positive" "lists" ]; |
| 49 | + "compat" = [ "rtauto" "fmaps-fsets-msets" "funind" "extraction" "reals" "wellfounded" "streams" ]; |
| 50 | + "all" = [ "compat" ]; |
| 51 | + }; |
| 52 | + |
| 53 | + stdlib_ = component: let |
| 54 | + pname = "stdlib-${component}"; |
| 55 | + stdlib-deps = map stdlib_ components.${component}; |
| 56 | + in coqPackages.lib.overrideCoqDerivation ({ |
| 57 | + inherit pname; |
| 58 | + propagatedBuildInputs = stdlib-deps; |
| 59 | + useDune = false; |
| 60 | + mlPlugin = true; |
| 61 | + } // (if component != "all" then { |
| 62 | + buildPhase = '' |
| 63 | + make ''${enableParallelBuilding:+-j $NIX_BUILD_CORES} build-${component} |
| 64 | + ''; |
| 65 | + installPhase = '' |
| 66 | + make COQLIBINSTALL=$out/lib/coq/${coq.coq-version}/user-contrib install-${component} |
| 67 | + ''; |
| 68 | + } else { |
| 69 | + buildPhase = '' |
| 70 | + echo "nothing left to build" |
| 71 | + ''; |
| 72 | + installPhase = '' |
| 73 | + echo "nothing left to install" |
| 74 | + ''; |
| 75 | + })) stdlib; |
| 76 | +in stdlib_ "all" |
0 commit comments