lol

nixVersions.*: Remove coroutine sp patch and factor out nixDependencies

Note that the file itself is still referenced by Lix 2.90.

authored by

Robert Hensing and committed by
Jörg Thalheim
9aa683ef 0ddf8d4c

+146 -165
+17 -99
pkgs/tools/package-management/nix/default.nix
··· 2 2 lib, 3 3 config, 4 4 stdenv, 5 - aws-sdk-cpp, 6 - boehmgc, 7 - callPackage, 5 + nixDependencies, 8 6 generateSplicesForMkScope, 9 7 fetchFromGitHub, 10 8 fetchpatch2, ··· 20 18 confDir ? "/etc", 21 19 }: 22 20 let 23 - boehmgc-nix_2_3 = boehmgc.override { enableLargeConfig = true; }; 24 21 25 - boehmgc-nix = boehmgc-nix_2_3.overrideAttrs (drv: { 26 - patches = (drv.patches or [ ]) ++ [ 27 - # Part of the GC solution in https://github.com/NixOS/nix/pull/4944 28 - ./patches/boehmgc-coroutine-sp-fallback.patch 29 - ]; 30 - }); 31 - 32 - # old nix fails to build with newer aws-sdk-cpp and the patch doesn't apply 33 - aws-sdk-cpp-old-nix = 34 - (aws-sdk-cpp.override { 35 - apis = [ 36 - "s3" 37 - "transfer" 38 - ]; 39 - customMemoryManagement = false; 40 - }).overrideAttrs 41 - (args: rec { 42 - # intentionally overriding postPatch 43 - version = "1.9.294"; 44 - 45 - src = fetchFromGitHub { 46 - owner = "aws"; 47 - repo = "aws-sdk-cpp"; 48 - rev = version; 49 - hash = "sha256-Z1eRKW+8nVD53GkNyYlZjCcT74MqFqqRMeMc33eIQ9g="; 50 - }; 51 - postPatch = 52 - '' 53 - # Avoid blanket -Werror to evade build failures on less 54 - # tested compilers. 55 - substituteInPlace cmake/compiler_settings.cmake \ 56 - --replace '"-Werror"' ' ' 57 - 58 - # Missing includes for GCC11 59 - sed '5i#include <thread>' -i \ 60 - aws-cpp-sdk-cloudfront-integration-tests/CloudfrontOperationTest.cpp \ 61 - aws-cpp-sdk-cognitoidentity-integration-tests/IdentityPoolOperationTest.cpp \ 62 - aws-cpp-sdk-dynamodb-integration-tests/TableOperationTest.cpp \ 63 - aws-cpp-sdk-elasticfilesystem-integration-tests/ElasticFileSystemTest.cpp \ 64 - aws-cpp-sdk-lambda-integration-tests/FunctionTest.cpp \ 65 - aws-cpp-sdk-mediastore-data-integration-tests/MediaStoreDataTest.cpp \ 66 - aws-cpp-sdk-queues/source/sqs/SQSQueue.cpp \ 67 - aws-cpp-sdk-redshift-integration-tests/RedshiftClientTest.cpp \ 68 - aws-cpp-sdk-s3-crt-integration-tests/BucketAndObjectOperationTest.cpp \ 69 - aws-cpp-sdk-s3-integration-tests/BucketAndObjectOperationTest.cpp \ 70 - aws-cpp-sdk-s3control-integration-tests/S3ControlTest.cpp \ 71 - aws-cpp-sdk-sqs-integration-tests/QueueOperationTest.cpp \ 72 - aws-cpp-sdk-transfer-tests/TransferTests.cpp 73 - # Flaky on Hydra 74 - rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp 75 - # Includes aws-c-auth private headers, so only works with submodule build 76 - rm aws-cpp-sdk-core-tests/aws/auth/AWSAuthSignerTest.cpp 77 - # TestRandomURLMultiThreaded fails 78 - rm aws-cpp-sdk-core-tests/http/HttpClientTest.cpp 79 - '' 80 - + lib.optionalString aws-sdk-cpp.stdenv.hostPlatform.isi686 '' 81 - # EPSILON is exceeded 82 - rm aws-cpp-sdk-core-tests/aws/client/AdaptiveRetryStrategyTest.cpp 83 - ''; 84 - 85 - patches = (args.patches or [ ]) ++ [ ./patches/aws-sdk-cpp-TransferManager-ContentEncoding.patch ]; 86 - 87 - # only a stripped down version is build which takes a lot less resources to build 88 - requiredSystemFeatures = [ ]; 89 - }); 90 - 91 - aws-sdk-cpp-nix = 92 - (aws-sdk-cpp.override { 93 - apis = [ 94 - "s3" 95 - "transfer" 96 - ]; 97 - customMemoryManagement = false; 98 - }).overrideAttrs 99 - { 100 - # only a stripped down version is build which takes a lot less resources to build 101 - requiredSystemFeatures = [ ]; 102 - }; 103 - 22 + # Called for Nix < 2.26 104 23 common = 105 24 args: 106 - callPackage (import ./common.nix ({ inherit lib fetchFromGitHub; } // args)) { 25 + nixDependencies.callPackage (import ./common.nix ({ inherit lib fetchFromGitHub; } // args)) { 107 26 inherit 108 27 Security 109 28 storeDir 110 29 stateDir 111 30 confDir 112 31 ; 113 - boehmgc = boehmgc-nix; 114 32 aws-sdk-cpp = 115 - if lib.versionAtLeast args.version "2.12pre" then aws-sdk-cpp-nix else aws-sdk-cpp-old-nix; 33 + if lib.versionAtLeast args.version "2.12pre" then 34 + nixDependencies.aws-sdk-cpp 35 + else 36 + nixDependencies.aws-sdk-cpp-old; 116 37 }; 117 38 118 39 # https://github.com/NixOS/nix/pull/7585 ··· 219 140 ( 220 141 { 221 142 nix_2_3 = 222 - ( 223 - (common { 224 - version = "2.3.18"; 225 - hash = "sha256-jBz2Ub65eFYG+aWgSI3AJYvLSghio77fWQiIW1svA9U="; 226 - patches = [ 227 - patch-monitorfdhup 228 - ]; 229 - self_attribute_name = "nix_2_3"; 230 - maintainers = with lib.maintainers; [ flokli ]; 231 - }).override 232 - { boehmgc = boehmgc-nix_2_3; } 233 - ).overrideAttrs 143 + (common { 144 + version = "2.3.18"; 145 + hash = "sha256-jBz2Ub65eFYG+aWgSI3AJYvLSghio77fWQiIW1svA9U="; 146 + patches = [ 147 + patch-monitorfdhup 148 + ]; 149 + self_attribute_name = "nix_2_3"; 150 + maintainers = with lib.maintainers; [ flokli ]; 151 + }).overrideAttrs 234 152 { 235 153 # https://github.com/NixOS/nix/issues/10222 236 154 # spurious test/add.sh failures ··· 250 168 }; 251 169 252 170 nixComponents_2_26 = ( 253 - callPackage ./vendor/2_26/componentized.nix { 171 + nixDependencies.callPackage ./vendor/2_26/componentized.nix { 254 172 inherit (self.nix_2_24.meta) maintainers; 255 173 otherSplices = generateSplicesForNixComponents "nixComponents_2_26"; 256 174 }
+22
pkgs/tools/package-management/nix/dependencies-scope.nix
··· 1 + { 2 + lib, 3 + generateSplicesForMkScope, 4 + newScope, 5 + splicePackages, 6 + callPackage, 7 + }: 8 + 9 + let 10 + otherSplices = generateSplicesForMkScope [ "nixDependencies" ]; 11 + in 12 + lib.makeScopeWithSplicing' 13 + { 14 + inherit splicePackages; 15 + inherit newScope; # layered directly on pkgs, unlike nixComponents above 16 + } 17 + { 18 + # Technically this should point to the nixDependencies set only, but 19 + # this is ok as long as the scopes don't intersect. 20 + inherit otherSplices; 21 + f = (callPackage ./dependencies.nix { }).scopeFunction; 22 + }
+102
pkgs/tools/package-management/nix/dependencies.nix
··· 1 + regular@{ 2 + lib, 3 + boehmgc, 4 + aws-sdk-cpp, 5 + fetchFromGitHub, 6 + pkgs, 7 + stdenv, 8 + }: 9 + 10 + let 11 + stdenv = 12 + if regular.stdenv.isDarwin && regular.stdenv.isx86_64 then darwinStdenv else regular.stdenv; 13 + 14 + # Fix the following error with the default x86_64-darwin SDK: 15 + # 16 + # error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer 17 + # 18 + # Despite the use of the 10.13 deployment target here, the aligned 19 + # allocation function Clang uses with this setting actually works 20 + # all the way back to 10.6. 21 + darwinStdenv = regular.pkgs.overrideSDK regular.stdenv { darwinMinVersion = "10.13"; }; 22 + in 23 + 24 + { 25 + scopeFunction = scope: { 26 + inherit stdenv; 27 + 28 + boehmgc = regular.boehmgc.override { enableLargeConfig = true; }; 29 + 30 + # old nix fails to build with newer aws-sdk-cpp and the patch doesn't apply 31 + aws-sdk-cpp-old = 32 + (regular.aws-sdk-cpp.override { 33 + apis = [ 34 + "s3" 35 + "transfer" 36 + ]; 37 + customMemoryManagement = false; 38 + }).overrideAttrs 39 + (args: rec { 40 + # intentionally overriding postPatch 41 + version = "1.9.294"; 42 + 43 + src = fetchFromGitHub { 44 + owner = "aws"; 45 + repo = "aws-sdk-cpp"; 46 + rev = version; 47 + hash = "sha256-Z1eRKW+8nVD53GkNyYlZjCcT74MqFqqRMeMc33eIQ9g="; 48 + }; 49 + postPatch = 50 + '' 51 + # Avoid blanket -Werror to evade build failures on less 52 + # tested compilers. 53 + substituteInPlace cmake/compiler_settings.cmake \ 54 + --replace '"-Werror"' ' ' 55 + 56 + # Missing includes for GCC11 57 + sed '5i#include <thread>' -i \ 58 + aws-cpp-sdk-cloudfront-integration-tests/CloudfrontOperationTest.cpp \ 59 + aws-cpp-sdk-cognitoidentity-integration-tests/IdentityPoolOperationTest.cpp \ 60 + aws-cpp-sdk-dynamodb-integration-tests/TableOperationTest.cpp \ 61 + aws-cpp-sdk-elasticfilesystem-integration-tests/ElasticFileSystemTest.cpp \ 62 + aws-cpp-sdk-lambda-integration-tests/FunctionTest.cpp \ 63 + aws-cpp-sdk-mediastore-data-integration-tests/MediaStoreDataTest.cpp \ 64 + aws-cpp-sdk-queues/source/sqs/SQSQueue.cpp \ 65 + aws-cpp-sdk-redshift-integration-tests/RedshiftClientTest.cpp \ 66 + aws-cpp-sdk-s3-crt-integration-tests/BucketAndObjectOperationTest.cpp \ 67 + aws-cpp-sdk-s3-integration-tests/BucketAndObjectOperationTest.cpp \ 68 + aws-cpp-sdk-s3control-integration-tests/S3ControlTest.cpp \ 69 + aws-cpp-sdk-sqs-integration-tests/QueueOperationTest.cpp \ 70 + aws-cpp-sdk-transfer-tests/TransferTests.cpp 71 + # Flaky on Hydra 72 + rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp 73 + # Includes aws-c-auth private headers, so only works with submodule build 74 + rm aws-cpp-sdk-core-tests/aws/auth/AWSAuthSignerTest.cpp 75 + # TestRandomURLMultiThreaded fails 76 + rm aws-cpp-sdk-core-tests/http/HttpClientTest.cpp 77 + '' 78 + + lib.optionalString aws-sdk-cpp.stdenv.hostPlatform.isi686 '' 79 + # EPSILON is exceeded 80 + rm aws-cpp-sdk-core-tests/aws/client/AdaptiveRetryStrategyTest.cpp 81 + ''; 82 + 83 + patches = (args.patches or [ ]) ++ [ ./patches/aws-sdk-cpp-TransferManager-ContentEncoding.patch ]; 84 + 85 + # only a stripped down version is build which takes a lot less resources to build 86 + requiredSystemFeatures = [ ]; 87 + }); 88 + 89 + aws-sdk-cpp = 90 + (regular.aws-sdk-cpp.override { 91 + apis = [ 92 + "s3" 93 + "transfer" 94 + ]; 95 + customMemoryManagement = false; 96 + }).overrideAttrs 97 + { 98 + # only a stripped down version is build which takes a lot less resources to build 99 + requiredSystemFeatures = [ ]; 100 + }; 101 + }; 102 + }
+1 -20
pkgs/tools/package-management/nix/vendor/2_26/componentized.nix
··· 2 2 lib, 3 3 fetchFromGitHub, 4 4 splicePackages, 5 - generateSplicesForMkScope, 6 - newScope, 5 + nixDependencies, 7 6 pkgs, 8 - stdenv, 9 7 maintainers, 10 8 otherSplices, 11 9 }: ··· 36 34 }; 37 35 }; 38 36 39 - # The dependencies are in their own scope, so that they don't have to be 40 - # in Nixpkgs top level `pkgs` or `nixComponents`. 41 - nixDependencies = 42 - lib.makeScopeWithSplicing' 43 - { 44 - inherit splicePackages; 45 - inherit newScope; # layered directly on pkgs, unlike nixComponents above 46 - } 47 - { 48 - # Technically this should point to the nixDependencies set only, but 49 - # this is ok as long as the scopes don't intersect. 50 - inherit otherSplices; 51 - f = import ./dependencies.nix { 52 - inherit pkgs; 53 - inherit stdenv; 54 - }; 55 - }; 56 37 in 57 38 nixComponents.overrideSource src
-46
pkgs/tools/package-management/nix/vendor/2_26/dependencies.nix
··· 1 - # These overrides are applied to the dependencies of the Nix components. 2 - 3 - { 4 - # The raw Nixpkgs, not affected by this scope 5 - pkgs, 6 - 7 - stdenv, 8 - }: 9 - 10 - let 11 - prevStdenv = stdenv; 12 - in 13 - 14 - let 15 - stdenv = if prevStdenv.isDarwin && prevStdenv.isx86_64 then darwinStdenv else prevStdenv; 16 - 17 - # Fix the following error with the default x86_64-darwin SDK: 18 - # 19 - # error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer 20 - # 21 - # Despite the use of the 10.13 deployment target here, the aligned 22 - # allocation function Clang uses with this setting actually works 23 - # all the way back to 10.6. 24 - darwinStdenv = pkgs.overrideSDK prevStdenv { darwinMinVersion = "10.13"; }; 25 - in 26 - scope: { 27 - inherit stdenv; 28 - 29 - aws-sdk-cpp = 30 - (pkgs.aws-sdk-cpp.override { 31 - apis = [ 32 - "s3" 33 - "transfer" 34 - ]; 35 - customMemoryManagement = false; 36 - }).overrideAttrs 37 - { 38 - # only a stripped down version is built, which takes a lot less resources 39 - # to build, so we don't need a "big-parallel" machine. 40 - requiredSystemFeatures = [ ]; 41 - }; 42 - 43 - boehmgc = pkgs.boehmgc.override { 44 - enableLargeConfig = true; 45 - }; 46 - }
+4
pkgs/top-level/all-packages.nix
··· 18894 18894 18895 18895 muse = libsForQt5.callPackage ../applications/audio/muse { }; 18896 18896 18897 + nixDependencies = recurseIntoAttrs ( 18898 + callPackage ../tools/package-management/nix/dependencies-scope.nix { } 18899 + ); 18900 + 18897 18901 nixVersions = recurseIntoAttrs ( 18898 18902 callPackage ../tools/package-management/nix { 18899 18903 storeDir = config.nix.storeDir or "/nix/store";