nixVersions.nix_2_27: init (and refactor _2_26) (#394957)

This commit is contained in:
John Ericson
2025-04-02 17:36:38 -04:00
committed by GitHub
37 changed files with 207 additions and 193 deletions
+41 -104
View File
@@ -2,9 +2,7 @@
lib,
config,
stdenv,
aws-sdk-cpp,
boehmgc,
callPackage,
nixDependencies,
generateSplicesForMkScope,
fetchFromGitHub,
fetchpatch2,
@@ -20,99 +18,22 @@
confDir ? "/etc",
}:
let
boehmgc-nix_2_3 = boehmgc.override { enableLargeConfig = true; };
boehmgc-nix = boehmgc-nix_2_3.overrideAttrs (drv: {
patches = (drv.patches or [ ]) ++ [
# Part of the GC solution in https://github.com/NixOS/nix/pull/4944
./patches/boehmgc-coroutine-sp-fallback.patch
];
});
# old nix fails to build with newer aws-sdk-cpp and the patch doesn't apply
aws-sdk-cpp-old-nix =
(aws-sdk-cpp.override {
apis = [
"s3"
"transfer"
];
customMemoryManagement = false;
}).overrideAttrs
(args: rec {
# intentionally overriding postPatch
version = "1.9.294";
src = fetchFromGitHub {
owner = "aws";
repo = "aws-sdk-cpp";
rev = version;
hash = "sha256-Z1eRKW+8nVD53GkNyYlZjCcT74MqFqqRMeMc33eIQ9g=";
};
postPatch =
''
# Avoid blanket -Werror to evade build failures on less
# tested compilers.
substituteInPlace cmake/compiler_settings.cmake \
--replace '"-Werror"' ' '
# Missing includes for GCC11
sed '5i#include <thread>' -i \
aws-cpp-sdk-cloudfront-integration-tests/CloudfrontOperationTest.cpp \
aws-cpp-sdk-cognitoidentity-integration-tests/IdentityPoolOperationTest.cpp \
aws-cpp-sdk-dynamodb-integration-tests/TableOperationTest.cpp \
aws-cpp-sdk-elasticfilesystem-integration-tests/ElasticFileSystemTest.cpp \
aws-cpp-sdk-lambda-integration-tests/FunctionTest.cpp \
aws-cpp-sdk-mediastore-data-integration-tests/MediaStoreDataTest.cpp \
aws-cpp-sdk-queues/source/sqs/SQSQueue.cpp \
aws-cpp-sdk-redshift-integration-tests/RedshiftClientTest.cpp \
aws-cpp-sdk-s3-crt-integration-tests/BucketAndObjectOperationTest.cpp \
aws-cpp-sdk-s3-integration-tests/BucketAndObjectOperationTest.cpp \
aws-cpp-sdk-s3control-integration-tests/S3ControlTest.cpp \
aws-cpp-sdk-sqs-integration-tests/QueueOperationTest.cpp \
aws-cpp-sdk-transfer-tests/TransferTests.cpp
# Flaky on Hydra
rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp
# Includes aws-c-auth private headers, so only works with submodule build
rm aws-cpp-sdk-core-tests/aws/auth/AWSAuthSignerTest.cpp
# TestRandomURLMultiThreaded fails
rm aws-cpp-sdk-core-tests/http/HttpClientTest.cpp
''
+ lib.optionalString aws-sdk-cpp.stdenv.hostPlatform.isi686 ''
# EPSILON is exceeded
rm aws-cpp-sdk-core-tests/aws/client/AdaptiveRetryStrategyTest.cpp
'';
patches = (args.patches or [ ]) ++ [ ./patches/aws-sdk-cpp-TransferManager-ContentEncoding.patch ];
# only a stripped down version is build which takes a lot less resources to build
requiredSystemFeatures = [ ];
});
aws-sdk-cpp-nix =
(aws-sdk-cpp.override {
apis = [
"s3"
"transfer"
];
customMemoryManagement = false;
}).overrideAttrs
{
# only a stripped down version is build which takes a lot less resources to build
requiredSystemFeatures = [ ];
};
# Called for Nix < 2.26
common =
args:
callPackage (import ./common.nix ({ inherit lib fetchFromGitHub; } // args)) {
nixDependencies.callPackage (import ./common.nix ({ inherit lib fetchFromGitHub; } // args)) {
inherit
Security
storeDir
stateDir
confDir
;
boehmgc = boehmgc-nix;
aws-sdk-cpp =
if lib.versionAtLeast args.version "2.12pre" then aws-sdk-cpp-nix else aws-sdk-cpp-old-nix;
if lib.versionAtLeast args.version "2.12pre" then
nixDependencies.aws-sdk-cpp
else
nixDependencies.aws-sdk-cpp-old;
};
# https://github.com/NixOS/nix/pull/7585
@@ -219,18 +140,15 @@ lib.makeExtensible (
(
{
nix_2_3 =
(
(common {
version = "2.3.18";
hash = "sha256-jBz2Ub65eFYG+aWgSI3AJYvLSghio77fWQiIW1svA9U=";
patches = [
patch-monitorfdhup
];
self_attribute_name = "nix_2_3";
maintainers = with lib.maintainers; [ flokli ];
}).override
{ boehmgc = boehmgc-nix_2_3; }
).overrideAttrs
(common {
version = "2.3.18";
hash = "sha256-jBz2Ub65eFYG+aWgSI3AJYvLSghio77fWQiIW1svA9U=";
patches = [
patch-monitorfdhup
];
self_attribute_name = "nix_2_3";
maintainers = with lib.maintainers; [ flokli ];
}).overrideAttrs
{
# https://github.com/NixOS/nix/issues/10222
# spurious test/add.sh failures
@@ -249,17 +167,36 @@ lib.makeExtensible (
self_attribute_name = "nix_2_25";
};
nixComponents_2_26 = (
callPackage ./vendor/2_26/componentized.nix {
inherit (self.nix_2_24.meta) maintainers;
otherSplices = generateSplicesForNixComponents "nixComponents_2_26";
}
);
nixComponents_2_26 = nixDependencies.callPackage ./modular/packages.nix {
version = "2.26.3";
inherit (self.nix_2_24.meta) maintainers;
otherSplices = generateSplicesForNixComponents "nixComponents_2_26";
src = fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = "42fc03dd1f12df2d9152303f3fb8bf22b746462c";
hash = "sha256-5ZV8YqU8mfFmoAMiUEuBqNwk0T3vUR//x1D12BiYCeY=";
};
};
# Note, this might eventually become an alias, as packages should
# depend on the components they need in `nixComponents_2_26`.
nix_2_26 = addTests "nix_2_26" self.nixComponents_2_26.nix-everything;
nixComponents_2_27 = nixDependencies.callPackage ./modular/packages.nix {
version = "2.27.1";
inherit (self.nix_2_24.meta) maintainers;
otherSplices = generateSplicesForNixComponents "nixComponents_2_26";
src = fetchFromGitHub {
owner = "NixOS";
repo = "nix";
rev = "9cb662df7442a1e2c4600fb8ecb2ad613ebc5a95";
hash = "sha256-rBPulEBpn4IiqkPsetuh7BRzT2iGCzZYnogTAsbrvhU=";
};
};
nix_2_27 = addTests "nix_2_27" self.nixComponents_2_27.nix-everything;
latest = self.nix_2_26;
# The minimum Nix version supported by Nixpkgs
@@ -0,0 +1,22 @@
{
lib,
generateSplicesForMkScope,
newScope,
splicePackages,
callPackage,
}:
let
otherSplices = generateSplicesForMkScope [ "nixDependencies" ];
in
lib.makeScopeWithSplicing'
{
inherit splicePackages;
inherit newScope; # layered directly on pkgs, unlike nixComponents above
}
{
# Technically this should point to the nixDependencies set only, but
# this is ok as long as the scopes don't intersect.
inherit otherSplices;
f = (callPackage ./dependencies.nix { }).scopeFunction;
}
@@ -0,0 +1,102 @@
regular@{
lib,
boehmgc,
aws-sdk-cpp,
fetchFromGitHub,
pkgs,
stdenv,
}:
let
stdenv =
if regular.stdenv.isDarwin && regular.stdenv.isx86_64 then darwinStdenv else regular.stdenv;
# Fix the following error with the default x86_64-darwin SDK:
#
# error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer
#
# Despite the use of the 10.13 deployment target here, the aligned
# allocation function Clang uses with this setting actually works
# all the way back to 10.6.
darwinStdenv = regular.pkgs.overrideSDK regular.stdenv { darwinMinVersion = "10.13"; };
in
{
scopeFunction = scope: {
inherit stdenv;
boehmgc = regular.boehmgc.override { enableLargeConfig = true; };
# old nix fails to build with newer aws-sdk-cpp and the patch doesn't apply
aws-sdk-cpp-old =
(regular.aws-sdk-cpp.override {
apis = [
"s3"
"transfer"
];
customMemoryManagement = false;
}).overrideAttrs
(args: rec {
# intentionally overriding postPatch
version = "1.9.294";
src = fetchFromGitHub {
owner = "aws";
repo = "aws-sdk-cpp";
rev = version;
hash = "sha256-Z1eRKW+8nVD53GkNyYlZjCcT74MqFqqRMeMc33eIQ9g=";
};
postPatch =
''
# Avoid blanket -Werror to evade build failures on less
# tested compilers.
substituteInPlace cmake/compiler_settings.cmake \
--replace '"-Werror"' ' '
# Missing includes for GCC11
sed '5i#include <thread>' -i \
aws-cpp-sdk-cloudfront-integration-tests/CloudfrontOperationTest.cpp \
aws-cpp-sdk-cognitoidentity-integration-tests/IdentityPoolOperationTest.cpp \
aws-cpp-sdk-dynamodb-integration-tests/TableOperationTest.cpp \
aws-cpp-sdk-elasticfilesystem-integration-tests/ElasticFileSystemTest.cpp \
aws-cpp-sdk-lambda-integration-tests/FunctionTest.cpp \
aws-cpp-sdk-mediastore-data-integration-tests/MediaStoreDataTest.cpp \
aws-cpp-sdk-queues/source/sqs/SQSQueue.cpp \
aws-cpp-sdk-redshift-integration-tests/RedshiftClientTest.cpp \
aws-cpp-sdk-s3-crt-integration-tests/BucketAndObjectOperationTest.cpp \
aws-cpp-sdk-s3-integration-tests/BucketAndObjectOperationTest.cpp \
aws-cpp-sdk-s3control-integration-tests/S3ControlTest.cpp \
aws-cpp-sdk-sqs-integration-tests/QueueOperationTest.cpp \
aws-cpp-sdk-transfer-tests/TransferTests.cpp
# Flaky on Hydra
rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp
# Includes aws-c-auth private headers, so only works with submodule build
rm aws-cpp-sdk-core-tests/aws/auth/AWSAuthSignerTest.cpp
# TestRandomURLMultiThreaded fails
rm aws-cpp-sdk-core-tests/http/HttpClientTest.cpp
''
+ lib.optionalString aws-sdk-cpp.stdenv.hostPlatform.isi686 ''
# EPSILON is exceeded
rm aws-cpp-sdk-core-tests/aws/client/AdaptiveRetryStrategyTest.cpp
'';
patches = (args.patches or [ ]) ++ [ ./patches/aws-sdk-cpp-TransferManager-ContentEncoding.patch ];
# only a stripped down version is build which takes a lot less resources to build
requiredSystemFeatures = [ ];
});
aws-sdk-cpp =
(regular.aws-sdk-cpp.override {
apis = [
"s3"
"transfer"
];
customMemoryManagement = false;
}).overrideAttrs
{
# only a stripped down version is build which takes a lot less resources to build
requiredSystemFeatures = [ ];
};
};
}
@@ -0,0 +1,6 @@
# `nix/modular`
This directory follows a directory structure similar to that in the upstream repo,
to make comparisons easier.
The files are maintained separately from the upstream repo, so differences are expected.
@@ -1,17 +1,15 @@
{
lib,
fetchFromGitHub,
splicePackages,
generateSplicesForMkScope,
newScope,
nixDependencies,
pkgs,
stdenv,
maintainers,
otherSplices,
version,
src,
}:
let
officialRelease = true;
src = fetchFromGitHub (builtins.fromJSON (builtins.readFile ./source.json));
# A new scope, so that we can use `callPackage` to inject our own interdependencies
# without "polluting" the top level "`pkgs`" attrset.
@@ -32,26 +30,10 @@ let
officialRelease
pkgs
src
version
;
};
};
# The dependencies are in their own scope, so that they don't have to be
# in Nixpkgs top level `pkgs` or `nixComponents`.
nixDependencies =
lib.makeScopeWithSplicing'
{
inherit splicePackages;
inherit newScope; # layered directly on pkgs, unlike nixComponents above
}
{
# Technically this should point to the nixDependencies set only, but
# this is ok as long as the scopes don't intersect.
inherit otherSplices;
f = import ./dependencies.nix {
inherit pkgs;
inherit stdenv;
};
};
in
nixComponents.overrideSource src
@@ -4,6 +4,7 @@
src,
officialRelease,
maintainers,
version,
}:
scope:
@@ -27,7 +28,7 @@ let
pkg-config
;
baseVersion = lib.fileContents ../.version;
baseVersion = version;
versionSuffix = lib.optionalString (!officialRelease) "pre";
@@ -7,6 +7,7 @@
nix-fetchers,
nix-store-test-support,
libgit2,
rapidcheck,
gtest,
runCommand,
@@ -37,12 +38,16 @@ mkMesonExecutable (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.)
];
buildInputs = [
nix-fetchers
nix-store-test-support
rapidcheck
gtest
];
buildInputs =
[
nix-fetchers
nix-store-test-support
rapidcheck
gtest
]
++ lib.optionals (lib.versionAtLeast version "2.27") [
libgit2
];
mesonFlags = [
];
@@ -78,7 +78,7 @@ mkMesonLibrary (finalAttrs: {
(lib.mesonOption "sandbox-shell" "${busybox-sandbox-shell}/bin/busybox")
];
env = {
env = lib.optionalAttrs (!lib.versionAtLeast version "2.27") {
# Needed for Meson to find Boost.
# https://github.com/NixOS/nixpkgs/issues/86131.
BOOST_INCLUDEDIR = "${lib.getDev boost}/include";
@@ -6,6 +6,7 @@
boost,
brotli,
libarchive,
libblake3,
libcpuid,
libsodium,
nlohmann_json,
@@ -40,11 +41,18 @@ mkMesonLibrary (finalAttrs: {
(fileset.fileFilter (file: file.hasExt "hh") ./.)
];
buildInputs = [
brotli
libsodium
openssl
] ++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid;
buildInputs =
[
brotli
]
++ lib.optional (lib.versionAtLeast version "2.27") [
libblake3
]
++ [
libsodium
openssl
]
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid;
propagatedBuildInputs = [
boost
@@ -56,7 +64,7 @@ mkMesonLibrary (finalAttrs: {
(lib.mesonEnable "cpuid" stdenv.hostPlatform.isx86_64)
];
env = {
env = lib.optionalAttrs (!lib.versionAtLeast version "2.27") {
# Needed for Meson to find Boost.
# https://github.com/NixOS/nixpkgs/issues/86131.
BOOST_INCLUDEDIR = "${lib.getDev boost}/include";
@@ -1 +0,0 @@
2.26.3
@@ -1,46 +0,0 @@
# These overrides are applied to the dependencies of the Nix components.
{
# The raw Nixpkgs, not affected by this scope
pkgs,
stdenv,
}:
let
prevStdenv = stdenv;
in
let
stdenv = if prevStdenv.isDarwin && prevStdenv.isx86_64 then darwinStdenv else prevStdenv;
# Fix the following error with the default x86_64-darwin SDK:
#
# error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer
#
# Despite the use of the 10.13 deployment target here, the aligned
# allocation function Clang uses with this setting actually works
# all the way back to 10.6.
darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; };
in
scope: {
inherit stdenv;
aws-sdk-cpp =
(pkgs.aws-sdk-cpp.override {
apis = [
"s3"
"transfer"
];
customMemoryManagement = false;
}).overrideAttrs
{
# only a stripped down version is built, which takes a lot less resources
# to build, so we don't need a "big-parallel" machine.
requiredSystemFeatures = [ ];
};
boehmgc = pkgs.boehmgc.override {
enableLargeConfig = true;
};
}
@@ -1,6 +0,0 @@
{
"owner": "NixOS",
"repo": "nix",
"rev": "42fc03dd1f12df2d9152303f3fb8bf22b746462c",
"hash": "sha256-5ZV8YqU8mfFmoAMiUEuBqNwk0T3vUR//x1D12BiYCeY="
}
+4
View File
@@ -18890,6 +18890,10 @@ with pkgs;
muse = libsForQt5.callPackage ../applications/audio/muse { };
nixDependencies = recurseIntoAttrs (
callPackage ../tools/package-management/nix/dependencies-scope.nix { }
);
nixVersions = recurseIntoAttrs (
callPackage ../tools/package-management/nix {
storeDir = config.nix.storeDir or "/nix/store";