`lixPackageSets.lix_2_92`: init (#393444)

authored by jade and committed by GitHub fd5897d3 3e05a0d6

+142 -13
+5
nixos/tests/installer.nix
··· 638 clevisTest ? false, 639 clevisFallbackTest ? false, 640 disableFileSystems ? false, 641 }: 642 let 643 isEfi = bootLoader == "systemd-boot" || (bootLoader == "grub" && grubUseEfi); ··· 701 virtualisation.rootDevice = "/dev/vdb"; 702 703 hardware.enableAllFirmware = mkForce false; 704 705 # The test cannot access the network, so any packages we 706 # need must be included in the VM. ··· 1101 # The (almost) simplest partitioning scheme: a swap partition and 1102 # one big filesystem partition. 1103 simple = makeInstallerTest "simple" simple-test-config; 1104 1105 switchToFlake = makeInstallerTest "switch-to-flake" simple-test-config-flake; 1106
··· 638 clevisTest ? false, 639 clevisFallbackTest ? false, 640 disableFileSystems ? false, 641 + selectNixPackage ? pkgs: pkgs.nixStable, 642 }: 643 let 644 isEfi = bootLoader == "systemd-boot" || (bootLoader == "grub" && grubUseEfi); ··· 702 virtualisation.rootDevice = "/dev/vdb"; 703 704 hardware.enableAllFirmware = mkForce false; 705 + nix.package = selectNixPackage pkgs; 706 707 # The test cannot access the network, so any packages we 708 # need must be included in the VM. ··· 1103 # The (almost) simplest partitioning scheme: a swap partition and 1104 # one big filesystem partition. 1105 simple = makeInstallerTest "simple" simple-test-config; 1106 + lix-simple = makeInstallerTest "simple" simple-test-config // { 1107 + selectNixPackage = pkgs: pkgs.lix; 1108 + }; 1109 1110 switchToFlake = makeInstallerTest "switch-to-flake" simple-test-config-flake; 1111
+82 -7
pkgs/tools/package-management/lix/common-lix.nix
··· 3 suffix ? "", 4 version, 5 src, 6 - docCargoDeps, 7 patches ? [ ], 8 maintainers ? lib.teams.lix.members, 9 }@args: 10 11 { 12 stdenv, 13 meson, ··· 18 busybox-sandbox-shell, 19 bzip2, 20 callPackage, 21 curl, 22 cmake, 23 doxygen, ··· 30 libarchive, 31 libcpuid, 32 libsodium, 33 lowdown, 34 lowdown-unsandboxed, 35 lsof, ··· 39 nlohmann_json, 40 ninja, 41 openssl, 42 toml11, 43 pegtl, 44 python3, ··· 47 Security, 48 sqlite, 49 util-linuxMinimal, 50 xz, 51 nixosTests, 52 lix-doc ? callPackage ./doc { 53 inherit src; 54 version = "${version}${suffix}"; ··· 57 58 enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, 59 enableStatic ? stdenv.hostPlatform.isStatic, 60 withAWS ? !enableStatic && (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin), 61 aws-sdk-cpp, 62 # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50 ··· 67 stateDir, 68 storeDir, 69 }: 70 - 71 let 72 isLegacyParser = lib.versionOlder version "2.91"; 73 in 74 - stdenv.mkDerivation { 75 pname = "lix"; 76 77 version = "${version}${suffix}"; ··· 91 ]; 92 93 strictDeps = true; 94 95 nativeBuildInputs = 96 [ 97 pkg-config 98 flex 99 jq ··· 101 ninja 102 cmake 103 python3 104 105 # Tests 106 git ··· 108 jq 109 lsof 110 ] 111 ++ lib.optionals isLegacyParser [ bison ] 112 ++ lib.optionals enableDocumentation [ 113 (lib.getBin lowdown-unsandboxed) ··· 123 brotli 124 bzip2 125 curl 126 editline 127 libsodium 128 openssl ··· 133 lowdown 134 rapidcheck 135 toml11 136 - lix-doc 137 ] 138 ++ lib.optionals (!isLegacyParser) [ pegtl ] 139 ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ] 140 ++ lib.optionals (stdenv.hostPlatform.isx86_64) [ libcpuid ] 141 ++ lib.optionals withLibseccomp [ libseccomp ] 142 ++ lib.optionals withAWS [ aws-sdk-cpp ]; 143 144 propagatedBuildInputs = [ 145 boehmgc 146 nlohmann_json ··· 179 mesonFlags = 180 [ 181 # Enable LTO, since it improves eval performance a fair amount 182 - # LTO is disabled on static due to strange linking errors 183 - (lib.mesonBool "b_lto" (!stdenv.hostPlatform.isStatic && stdenv.cc.isGNU)) 184 (lib.mesonEnable "gc" true) 185 (lib.mesonBool "enable-tests" true) 186 (lib.mesonBool "enable-docs" enableDocumentation) ··· 208 mkdir -p $devdoc/nix-support 209 echo "devdoc internal-api $devdoc/share/doc/nix/internal-api" >> $devdoc/nix-support/hydra-build-products 210 '' 211 + lib.optionalString stdenv.hostPlatform.isStatic '' 212 mkdir -p $out/nix-support 213 echo "file binary-dist $out/bin/nix" >> $out/nix-support/hydra-build-products ··· 219 "$out/lib/libboost_context.dylib" \ 220 "$out/lib/$lib" 221 done 222 ''; 223 224 # This needs to run after _multioutDocs moves the docs to $doc ··· 277 inherit aws-sdk-cpp boehmgc; 278 tests = { 279 misc = nixosTests.nix-misc.lix; 280 }; 281 }; 282 ··· 299 outputsToInstall = [ "out" ] ++ lib.optional enableDocumentation "man"; 300 mainProgram = "nix"; 301 }; 302 - }
··· 3 suffix ? "", 4 version, 5 src, 6 + # For Lix versions >= 2.92, Rust sources are in the Lix repository root. 7 + cargoDeps ? null, 8 + # For previous versions, Rust sources are only in a subdirectory for 9 + # `lix-doc`. 10 + docCargoDeps ? null, 11 patches ? [ ], 12 maintainers ? lib.teams.lix.members, 13 }@args: 14 15 + assert lib.assertMsg ( 16 + lib.versionOlder version "2.92" -> docCargoDeps != null 17 + ) "`lix-doc` `cargoDeps` must be set for Lix < 2.92"; 18 + assert lib.assertMsg ( 19 + lib.versionAtLeast version "2.92" -> cargoDeps != null 20 + ) "`cargoDeps` must be set for Lix ≥ 2.92"; 21 + 22 { 23 stdenv, 24 meson, ··· 29 busybox-sandbox-shell, 30 bzip2, 31 callPackage, 32 + capnproto, 33 + cargo, 34 curl, 35 cmake, 36 doxygen, ··· 43 libarchive, 44 libcpuid, 45 libsodium, 46 + llvmPackages, 47 lowdown, 48 lowdown-unsandboxed, 49 lsof, ··· 53 nlohmann_json, 54 ninja, 55 openssl, 56 + rustc, 57 toml11, 58 pegtl, 59 python3, ··· 62 Security, 63 sqlite, 64 util-linuxMinimal, 65 + removeReferencesTo, 66 xz, 67 nixosTests, 68 + rustPlatform, 69 + # Only used for versions before 2.92. 70 lix-doc ? callPackage ./doc { 71 inherit src; 72 version = "${version}${suffix}"; ··· 75 76 enableDocumentation ? stdenv.hostPlatform == stdenv.buildPlatform, 77 enableStatic ? stdenv.hostPlatform.isStatic, 78 + enableStrictLLVMChecks ? true, 79 withAWS ? !enableStatic && (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin), 80 aws-sdk-cpp, 81 # RISC-V support in progress https://github.com/seccomp/libseccomp/pull/50 ··· 86 stateDir, 87 storeDir, 88 }: 89 let 90 + isLLVMOnly = lib.versionAtLeast version "2.92"; 91 + hasExternalLixDoc = lib.versionOlder version "2.92"; 92 isLegacyParser = lib.versionOlder version "2.91"; 93 in 94 + # gcc miscompiles coroutines at least until 13.2, possibly longer 95 + # do not remove this check unless you are sure you (or your users) will not report bugs to Lix upstream about GCC miscompilations. 96 + assert lib.assertMsg (enableStrictLLVMChecks && isLLVMOnly -> stdenv.cc.isClang) 97 + "Lix upstream strongly discourage the usage of GCC to compile Lix as there's known miscompilations in important places. If you are a compiler developer, please get in touch with us."; 98 + stdenv.mkDerivation (finalAttrs: { 99 pname = "lix"; 100 101 version = "${version}${suffix}"; ··· 115 ]; 116 117 strictDeps = true; 118 + disallowedReferences = lib.optionals isLLVMOnly [ 119 + # We don't want the Clang. 120 + stdenv.cc.cc 121 + # We don't want the underlying GCC neither! 122 + stdenv.cc.cc.stdenv.cc.cc 123 + ]; 124 + 125 + # We only include CMake so that Meson can locate toml11, which only ships CMake dependency metadata. 126 + dontUseCmakeConfigure = true; 127 128 nativeBuildInputs = 129 [ 130 + # python3.withPackages does not splice properly, see https://github.com/NixOS/nixpkgs/issues/305858 131 + (python3.pythonOnBuildForHost.withPackages (p: [ 132 + p.pytest 133 + p.pytest-xdist 134 + p.python-frontmatter 135 + ])) 136 pkg-config 137 flex 138 jq ··· 140 ninja 141 cmake 142 python3 143 + # Required for libstd++ assertions that leaks inside of the final binary. 144 + removeReferencesTo 145 146 # Tests 147 git ··· 149 jq 150 lsof 151 ] 152 + ++ lib.optionals isLLVMOnly [ 153 + rustc 154 + cargo 155 + rustPlatform.cargoSetupHook 156 + ] 157 ++ lib.optionals isLegacyParser [ bison ] 158 ++ lib.optionals enableDocumentation [ 159 (lib.getBin lowdown-unsandboxed) ··· 169 brotli 170 bzip2 171 curl 172 + capnproto 173 editline 174 libsodium 175 openssl ··· 180 lowdown 181 rapidcheck 182 toml11 183 ] 184 + ++ lib.optionals hasExternalLixDoc [ lix-doc ] 185 ++ lib.optionals (!isLegacyParser) [ pegtl ] 186 ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ] 187 + # NOTE(Raito): I'd have expected that the LLVM packaging would inject the 188 + # libunwind library path directly in the wrappers, but it does inject 189 + # -lunwind without injecting the library path... 190 + ++ lib.optionals stdenv.hostPlatform.isStatic [ llvmPackages.libunwind ] 191 ++ lib.optionals (stdenv.hostPlatform.isx86_64) [ libcpuid ] 192 ++ lib.optionals withLibseccomp [ libseccomp ] 193 ++ lib.optionals withAWS [ aws-sdk-cpp ]; 194 195 + inherit cargoDeps; 196 + 197 + env = { 198 + # Meson allows referencing a /usr/share/cargo/registry shaped thing for subproject sources. 199 + # Turns out the Nix-generated Cargo dependencies are named the same as they 200 + # would be in a Cargo registry cache. 201 + MESON_PACKAGE_CACHE_DIR = 202 + if finalAttrs.cargoDeps != null then 203 + finalAttrs.cargoDeps 204 + else 205 + "lix: no `MESON_PACKAGE_CACHE_DIR`, set `cargoDeps`"; 206 + }; 207 + 208 propagatedBuildInputs = [ 209 boehmgc 210 nlohmann_json ··· 243 mesonFlags = 244 [ 245 # Enable LTO, since it improves eval performance a fair amount 246 + # LTO is disabled on: 247 + # - static builds (strange linkage errors) 248 + (lib.mesonBool "b_lto" (!stdenv.hostPlatform.isStatic && (isLLVMOnly || stdenv.cc.isGNU))) 249 (lib.mesonEnable "gc" true) 250 (lib.mesonBool "enable-tests" true) 251 (lib.mesonBool "enable-docs" enableDocumentation) ··· 273 mkdir -p $devdoc/nix-support 274 echo "devdoc internal-api $devdoc/share/doc/nix/internal-api" >> $devdoc/nix-support/hydra-build-products 275 '' 276 + + lib.optionalString (!hasExternalLixDoc) '' 277 + # We do not need static archives. 278 + # FIXME(Raito): why are they getting installed _at all_ ? 279 + rm $out/lib/liblix_doc.a 280 + '' 281 + lib.optionalString stdenv.hostPlatform.isStatic '' 282 mkdir -p $out/nix-support 283 echo "file binary-dist $out/bin/nix" >> $out/nix-support/hydra-build-products ··· 289 "$out/lib/libboost_context.dylib" \ 290 "$out/lib/$lib" 291 done 292 + '' 293 + + '' 294 + # Drop all references to libstd++ include files due to `__FILE__` leaking in libstd++ assertions. 295 + find "$out" -type f -exec remove-references-to -t ${stdenv.cc.cc.stdenv.cc.cc} '{}' + 296 ''; 297 298 # This needs to run after _multioutDocs moves the docs to $doc ··· 351 inherit aws-sdk-cpp boehmgc; 352 tests = { 353 misc = nixosTests.nix-misc.lix; 354 + installer = nixosTests.installer.lix-simple; 355 }; 356 }; 357 ··· 374 outputsToInstall = [ "out" ] ++ lib.optional enableDocumentation "man"; 375 mainProgram = "nix"; 376 }; 377 + })
+3 -2
pkgs/tools/package-management/lix/common-nix-eval-jobs.nix
··· 17 pkg-config, 18 ninja, 19 cmake, 20 - clang-tools, 21 }: 22 23 stdenv.mkDerivation { ··· 35 ninja 36 # nlohmann_json can be only discovered via cmake files 37 cmake 38 - ] ++ (lib.optional stdenv.cc.isClang [ clang-tools ]); 39 40 # point 'nix edit' and ofborg at the file that defines the attribute, 41 # not this common file. ··· 52 license = lib.licenses.gpl3; 53 inherit maintainers; 54 platforms = lib.platforms.unix; 55 }; 56 }
··· 17 pkg-config, 18 ninja, 19 cmake, 20 + buildPackages, 21 }: 22 23 stdenv.mkDerivation { ··· 35 ninja 36 # nlohmann_json can be only discovered via cmake files 37 cmake 38 + ] ++ (lib.optional stdenv.cc.isClang [ buildPackages.clang-tools ]); 39 40 # point 'nix edit' and ofborg at the file that defines the attribute, 41 # not this common file. ··· 52 license = lib.licenses.gpl3; 53 inherit maintainers; 54 platforms = lib.platforms.unix; 55 + broken = stdenv.hostPlatform.isStatic; 56 }; 57 }
+52 -4
pkgs/tools/package-management/lix/default.nix
··· 8 rustPlatform, 9 Security, 10 newScope, 11 12 storeDir ? "/nix/store", 13 stateDir ? "/nix/var", ··· 19 lix-args, 20 nix-eval-jobs-args, 21 }: 22 lib.makeScope newScope ( 23 self: 24 lib.recurseIntoAttrs { ··· 58 requiredSystemFeatures = [ ]; 59 }; 60 61 # NOTE: The `common-*.nix` helpers contain a top-level function which 62 # takes the Lix source to build and version information. We use the 63 # outer `callPackage` for that. ··· 65 # That *returns* another function which takes the actual build 66 # dependencies, and that uses the new scope's `self.callPackage` so 67 # that `nix-eval-jobs` can be built against the correct `lix` version. 68 - lix = self.callPackage (callPackage ./common-lix.nix lix-args) { }; 69 70 - nix-eval-jobs = self.callPackage (callPackage ./common-nix-eval-jobs.nix nix-eval-jobs-args) { }; 71 } 72 ); 73 - 74 in 75 lib.makeExtensible (self: { 76 inherit makeLixScope; ··· 135 }; 136 }; 137 138 - latest = self.lix_2_91; 139 stable = self.lix_2_91; 140 141 # Previously, `nix-eval-jobs` was not packaged here, so we export an
··· 8 rustPlatform, 9 Security, 10 newScope, 11 + editline, 12 + ncurses, 13 + stdenv, 14 + clangStdenv, 15 16 storeDir ? "/nix/store", 17 stateDir ? "/nix/var", ··· 23 lix-args, 24 nix-eval-jobs-args, 25 }: 26 + let 27 + # GCC 13.2 is known to miscompile Lix coroutines (introduced in 2.92). 28 + lixStdenv = if lib.versionAtLeast lix-args.version "2.92" then clangStdenv else stdenv; 29 + in 30 lib.makeScope newScope ( 31 self: 32 lib.recurseIntoAttrs { ··· 66 requiredSystemFeatures = [ ]; 67 }; 68 69 + editline = editline.override { 70 + inherit ncurses; 71 + enableTermcap = true; 72 + }; 73 + 74 # NOTE: The `common-*.nix` helpers contain a top-level function which 75 # takes the Lix source to build and version information. We use the 76 # outer `callPackage` for that. ··· 78 # That *returns* another function which takes the actual build 79 # dependencies, and that uses the new scope's `self.callPackage` so 80 # that `nix-eval-jobs` can be built against the correct `lix` version. 81 + lix = self.callPackage (callPackage ./common-lix.nix lix-args) { 82 + stdenv = lixStdenv; 83 + }; 84 85 + nix-eval-jobs = self.callPackage (callPackage ./common-nix-eval-jobs.nix nix-eval-jobs-args) { 86 + stdenv = lixStdenv; 87 + }; 88 } 89 ); 90 in 91 lib.makeExtensible (self: { 92 inherit makeLixScope; ··· 151 }; 152 }; 153 154 + lix_2_92 = self.makeLixScope { 155 + lix-args = rec { 156 + version = "2.92.0"; 157 + 158 + src = fetchFromGitHub { 159 + owner = "lix-project"; 160 + repo = "lix"; 161 + rev = version; 162 + hash = "sha256-CCKIAE84dzkrnlxJCKFyffAxP3yfsOAbdvydUGqq24g="; 163 + }; 164 + 165 + cargoDeps = rustPlatform.fetchCargoVendor { 166 + name = "lix-${version}"; 167 + inherit src; 168 + allowGitDependencies = false; 169 + hash = "sha256-YMyNOXdlx0I30SkcmdW/6DU0BYc3ZOa2FMJSKMkr7I8="; 170 + }; 171 + }; 172 + 173 + nix-eval-jobs-args = rec { 174 + version = "2.92.0"; 175 + src = fetchgit { 176 + url = "https://git.lix.systems/lix-project/nix-eval-jobs.git"; 177 + rev = version; 178 + hash = "sha256-tPr61X9v/OMVt7VXOs1RRStciwN8gDGxEKx+h0/Fg48="; 179 + }; 180 + }; 181 + }; 182 + 183 + latest = self.lix_2_92; 184 + 185 + # Note: This is not yet 2.92 because of a non-deterministic `curl` error. 186 + # See: https://git.lix.systems/lix-project/lix/issues/662 187 stable = self.lix_2_91; 188 189 # Previously, `nix-eval-jobs` was not packaged here, so we export an