1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00

lixVersions.lix_2_91: init

Original PR: #334269

This adds Lix 2.91.0 to nixpkgs and sets it as the default Lix release.
This is compliant with the 24.05 stability policy because Lix 2.91 does
not break any users (io_uring is already only partially available due to
old kernels, nobody on github uses build-hook, and nix 2.3 is the oldest
version of nix with security support).

Blog post:
https://lix.systems/blog/2024-08-12-lix-2.91-release/

Release notes:
https://docs.lix.systems/manual/lix/stable/release-notes/rl-2.91.html

Change-Id: I6960314bddceb7ab10e3cd6d9842d578f501fd76

Co-authored-by: Atemu <git@atemu.net>
Co-authored-by: Yureka <yureka@cyberchaos.dev>
Co-authored-by: getchoo <48872998+getchoo@users.noreply.github.com>
(cherry picked from commit 5b6d2fb626)
This commit is contained in:
jade 2024-08-21 01:50:11 -07:00 committed by Yureka
parent 9492635337
commit 196c3de257
2 changed files with 84 additions and 32 deletions

View file

@ -19,7 +19,6 @@ assert (hash == null) -> (src != null);
{
stdenv,
meson,
bash,
bison,
boehmgc,
boost,
@ -27,29 +26,20 @@ assert (hash == null) -> (src != null);
busybox-sandbox-shell,
bzip2,
callPackage,
coreutils,
curl,
cmake,
docbook_xsl_ns,
docbook5,
doxygen,
editline,
flex,
git,
gnutar,
gtest,
gzip,
jq,
lib,
libarchive,
libcpuid,
libgit2,
libsodium,
libxml2,
libxslt,
lowdown,
lsof,
man,
mercurial,
mdbook,
mdbook-linkcheck,
@ -57,8 +47,8 @@ assert (hash == null) -> (src != null);
ninja,
openssl,
toml11,
pegtl,
python3,
perl,
pkg-config,
rapidcheck,
Security,
@ -87,6 +77,9 @@ assert (hash == null) -> (src != null);
}:
assert lib.assertMsg (docCargoHash != null || docCargoLock != null)
"Either `lix-doc`'s cargoHash using `docCargoHash` or `lix-doc`'s `cargoLock.lockFile` using `docCargoLock` must be set!";
let
isLegacyParser = lib.versionOlder version "2.91";
in
stdenv.mkDerivation (finalAttrs: {
pname = "lix";
@ -103,6 +96,7 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optionals enableDocumentation [
"man"
"doc"
"devdoc"
];
strictDeps = true;
@ -110,14 +104,12 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs =
[
pkg-config
bison
flex
jq
meson
ninja
cmake
python3
doxygen
# Tests
git
@ -125,10 +117,12 @@ stdenv.mkDerivation (finalAttrs: {
jq
lsof
]
++ lib.optionals (enableDocumentation) [
++ lib.optionals isLegacyParser [ bison ]
++ lib.optionals enableDocumentation [
(lib.getBin lowdown)
mdbook
mdbook-linkcheck
doxygen
]
++ lib.optionals stdenv.isLinux [ util-linuxMinimal ];
@ -150,6 +144,7 @@ stdenv.mkDerivation (finalAttrs: {
toml11
lix-doc
]
++ lib.optionals (!isLegacyParser) [ pegtl ]
++ lib.optionals stdenv.isDarwin [ Security ]
++ lib.optionals (stdenv.isx86_64) [ libcpuid ]
++ lib.optionals withLibseccomp [ libseccomp ]
@ -161,7 +156,7 @@ stdenv.mkDerivation (finalAttrs: {
];
postPatch = ''
patchShebangs --build tests
patchShebangs --build tests doc/manual
'';
preConfigure =
@ -192,13 +187,20 @@ stdenv.mkDerivation (finalAttrs: {
BOOST_LIBRARYDIR = "${lib.getLib boost}/lib";
};
mesonBuildType = "release";
# -O3 seems to anger a gcc bug and provide no performance benefit.
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114360
# We use -O2 upstream https://gerrit.lix.systems/c/lix/+/554
mesonBuildType = "debugoptimized";
mesonFlags =
[
# LTO optimization
# Enable LTO, since it improves eval performance a fair amount
# LTO is disabled on static due to strange linking errors
(lib.mesonBool "b_lto" (!stdenv.hostPlatform.isStatic))
(lib.mesonEnable "gc" true)
(lib.mesonBool "enable-tests" true)
(lib.mesonBool "enable-docs" enableDocumentation)
(lib.mesonEnable "internal-api-docs" enableDocumentation)
(lib.mesonBool "enable-embedded-sandbox-shell" (stdenv.isLinux && stdenv.hostPlatform.isStatic))
(lib.mesonEnable "seccomp-sandboxing" withLibseccomp)
@ -210,10 +212,15 @@ stdenv.mkDerivation (finalAttrs: {
(lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox")
];
ninjaFlags = [ "-v" ];
postInstall =
''
lib.optionalString enableDocumentation ''
mkdir -p $doc/nix-support
echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products
mkdir -p $devdoc/nix-support
echo "devdoc internal-api $devdoc/share/doc/nix/internal-api" >> $devdoc/nix-support/hydra-build-products
''
+ lib.optionalString stdenv.hostPlatform.isStatic ''
mkdir -p $out/nix-support
@ -228,15 +235,27 @@ stdenv.mkDerivation (finalAttrs: {
done
'';
# This needs to run after _multioutDocs moves the docs to $doc
postFixup = lib.optionalString enableDocumentation ''
mkdir -p $devdoc/share/doc/nix
mv $doc/share/doc/nix/internal-api $devdoc/share/doc/nix
'';
doCheck = true;
mesonCheckFlags = [ "--suite=check" ];
mesonCheckFlags = [
"--suite=check"
"--print-errorlogs"
];
checkInputs = [
gtest
rapidcheck
];
doInstallCheck = true;
mesonInstallCheckFlags = [ "--suite=installcheck" ];
mesonInstallCheckFlags = [
"--suite=installcheck"
"--print-errorlogs"
];
preInstallCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
# socket path becomes too long otherwise
@ -255,12 +274,17 @@ stdenv.mkDerivation (finalAttrs: {
hardeningDisable = [
# strictoverflow is disabled because we trap on signed overflow instead
"strictoverflow"
] ++ lib.optional stdenv.hostPlatform.isStatic "pie";
]
# fortify breaks the build with lto and musl for some reason
++ lib.optional stdenv.hostPlatform.isMusl "fortify";
# hardeningEnable = lib.optionals (!stdenv.isDarwin) [ "pie" ];
# hardeningDisable = lib.optional stdenv.hostPlatform.isMusl "fortify";
separateDebugInfo = stdenv.isLinux && !enableStatic;
enableParallelBuilding = true;
# Used by (1) test which has dynamic port assignment.
__darwinAllowLocalNetworking = true;
passthru = {
inherit aws-sdk-cpp boehmgc;
tests = {
@ -271,7 +295,7 @@ stdenv.mkDerivation (finalAttrs: {
# point 'nix edit' and ofborg at the file that defines the attribute,
# not this common file.
pos = builtins.unsafeGetAttrPos "version" args;
meta = with lib; {
meta = {
description = "Powerful package manager that makes package management reliable and reproducible";
longDescription = ''
Lix (a fork of Nix) is a powerful package manager for Linux and other Unix systems that
@ -281,11 +305,10 @@ stdenv.mkDerivation (finalAttrs: {
environments.
'';
homepage = "https://lix.systems";
license = licenses.lgpl21Plus;
license = lib.licenses.lgpl21Plus;
inherit maintainers;
platforms = platforms.unix;
outputsToInstall = [ "out" ] ++ optional enableDocumentation "man";
platforms = lib.platforms.unix;
outputsToInstall = [ "out" ] ++ lib.optional enableDocumentation "man";
mainProgram = "nix";
broken = enableStatic;
};
})

View file

@ -4,6 +4,7 @@
boehmgc,
callPackage,
fetchFromGitHub,
fetchpatch,
Security,
storeDir ? "/nix/store",
@ -33,6 +34,9 @@ let
requiredSystemFeatures = [ ];
};
# Since Lix 2.91 does not use boost coroutines, it does not need boehmgc patches either.
needsBoehmgcPatches = version: lib.versionOlder version "2.91";
common =
args:
callPackage (import ./common.nix ({ inherit lib fetchFromGitHub; } // args)) {
@ -42,11 +46,11 @@ let
stateDir
confDir
;
boehmgc = boehmgc-nix;
boehmgc = if needsBoehmgcPatches args.version then boehmgc-nix else boehmgc-nix_2_3;
aws-sdk-cpp = aws-sdk-cpp-nix;
};
in
lib.makeExtensible (self: ({
lib.makeExtensible (self: {
buildLix = common;
lix_2_90 = (
@ -57,6 +61,31 @@ lib.makeExtensible (self: ({
}
);
latest = self.lix_2_90;
stable = self.lix_2_90;
}))
lix_2_91 = (
common {
version = "2.91.0";
hash = "sha256-Rosl9iA9MybF5Bud4BTAQ9adbY81aGmPfV8dDBGl34s=";
docCargoHash = "sha256-KOn1fXF7k7c/0e5ZCNZwt3YZmjL1oi5A2mhwxQWKaUo=";
patches = [
# Fix meson to not use target_machine, fixing cross. This commit is in release-2.91: remove when updating to 2.91.1 (if any).
# https://gerrit.lix.systems/c/lix/+/1781
# https://git.lix.systems/lix-project/lix/commit/ca2b514e20de12b75088b06b8e0e316482516401
(fetchpatch {
url = "https://git.lix.systems/lix-project/lix/commit/ca2b514e20de12b75088b06b8e0e316482516401.patch";
hash = "sha256-TZauU4RIsn07xv9vZ33amrDvCLMbrtcHs1ozOTLgu98=";
})
# Fix musl builds. This commit is in release-2.91: remove when updating to 2.91.1 (if any).
# https://gerrit.lix.systems/c/lix/+/1823
# https://git.lix.systems/lix-project/lix/commit/ed51a172c69996fc6f3b7dfaa86015bff50c8ba8
(fetchpatch {
url = "https://git.lix.systems/lix-project/lix/commit/ed51a172c69996fc6f3b7dfaa86015bff50c8ba8.patch";
hash = "sha256-X59N+tOQ2GN17p9sXvo9OiuEexzB23ieuOvtq2sre5c=";
})
];
}
);
latest = self.lix_2_91;
stable = self.lix_2_91;
})