Skip to content

Commit

Permalink
lixVersions.lix_2_91: init
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-authored-by: Yureka <[email protected]>
Co-authored-by: getchoo <[email protected]>
(cherry picked from commit 5b6d2fb)
  • Loading branch information
lf- committed Aug 22, 2024
1 parent 7ccd111 commit 671282f
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 32 deletions.
77 changes: 50 additions & 27 deletions pkgs/tools/package-management/lix/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,46 +19,36 @@ assert (hash == null) -> (src != null);
{
stdenv,
meson,
bash,
bison,
boehmgc,
boost,
brotli,
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,
nlohmann_json,
ninja,
openssl,
toml11,
pegtl,
python3,
perl,
pkg-config,
rapidcheck,
Security,
Expand Down Expand Up @@ -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";

Expand All @@ -103,32 +96,33 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optionals enableDocumentation [
"man"
"doc"
"devdoc"
];

strictDeps = true;

nativeBuildInputs =
[
pkg-config
bison
flex
jq
meson
ninja
cmake
python3
doxygen

# Tests
git
mercurial
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 ];

Expand All @@ -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 ]
Expand All @@ -161,7 +156,7 @@ stdenv.mkDerivation (finalAttrs: {
];

postPatch = ''
patchShebangs --build tests
patchShebangs --build tests doc/manual
'';

preConfigure =
Expand Down Expand Up @@ -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)

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 = {
Expand All @@ -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
Expand All @@ -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;
};
})
39 changes: 34 additions & 5 deletions pkgs/tools/package-management/lix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
boehmgc,
callPackage,
fetchFromGitHub,
fetchpatch,
Security,

storeDir ? "/nix/store",
Expand Down Expand Up @@ -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)) {
Expand All @@ -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 = (
Expand All @@ -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;
})

0 comments on commit 671282f

Please sign in to comment.