2022-01-27 00:19:43 +00:00
|
|
|
{ lib
|
2023-07-15 17:15:38 +00:00
|
|
|
, config
|
2022-01-27 00:19:43 +00:00
|
|
|
, aws-sdk-cpp
|
|
|
|
, boehmgc
|
|
|
|
, callPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
2022-12-28 21:21:41 +00:00
|
|
|
, fetchpatch2
|
2023-11-16 04:20:00 +00:00
|
|
|
, runCommand
|
2022-01-27 00:19:43 +00:00
|
|
|
, Security
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
, storeDir ? "/nix/store"
|
|
|
|
, stateDir ? "/nix/var"
|
|
|
|
, confDir ? "/etc"
|
|
|
|
}:
|
|
|
|
let
|
2022-01-27 00:19:43 +00:00
|
|
|
boehmgc-nix_2_3 = boehmgc.override { enableLargeConfig = true; };
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
boehmgc-nix = boehmgc-nix_2_3.overrideAttrs (drv: {
|
|
|
|
# Part of the GC solution in https://github.com/NixOS/nix/pull/4944
|
|
|
|
patches = (drv.patches or [ ]) ++ [ ./patches/boehmgc-coroutine-sp-fallback.patch ];
|
2021-07-21 07:28:18 +00:00
|
|
|
});
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
# 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 {
|
2022-01-27 00:19:43 +00:00
|
|
|
apis = [ "s3" "transfer" ];
|
|
|
|
customMemoryManagement = false;
|
2023-04-29 16:46:19 +00:00
|
|
|
}).overrideAttrs (args: rec {
|
|
|
|
# intentionally overriding postPatch
|
|
|
|
version = "1.9.294";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "aws";
|
|
|
|
repo = "aws-sdk-cpp";
|
|
|
|
rev = version;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-Z1eRKW+8nVD53GkNyYlZjCcT74MqFqqRMeMc33eIQ9g=";
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
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.isi686 ''
|
|
|
|
# EPSILON is exceeded
|
|
|
|
rm aws-cpp-sdk-core-tests/aws/client/AdaptiveRetryStrategyTest.cpp
|
|
|
|
'';
|
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
patches = (args.patches or [ ]) ++ [ ./patches/aws-sdk-cpp-TransferManager-ContentEncoding.patch ];
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
# only a stripped down version is build which takes a lot less resources to build
|
2023-04-29 16:46:19 +00:00
|
|
|
requiredSystemFeatures = [ ];
|
|
|
|
});
|
|
|
|
|
|
|
|
aws-sdk-cpp-nix = (aws-sdk-cpp.override {
|
|
|
|
apis = [ "s3" "transfer" ];
|
|
|
|
customMemoryManagement = false;
|
2023-08-04 22:07:22 +00:00
|
|
|
}).overrideAttrs {
|
2023-04-29 16:46:19 +00:00
|
|
|
# only a stripped down version is build which takes a lot less resources to build
|
|
|
|
requiredSystemFeatures = [ ];
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
|
2022-01-27 00:19:43 +00:00
|
|
|
common = args:
|
|
|
|
callPackage
|
2022-09-30 11:47:45 +00:00
|
|
|
(import ./common.nix ({ inherit lib fetchFromGitHub; } // args))
|
2022-01-27 00:19:43 +00:00
|
|
|
{
|
|
|
|
inherit Security storeDir stateDir confDir;
|
|
|
|
boehmgc = boehmgc-nix;
|
2023-04-29 16:46:19 +00:00
|
|
|
aws-sdk-cpp = if lib.versionAtLeast args.version "2.12pre" then aws-sdk-cpp-nix else aws-sdk-cpp-old-nix;
|
2022-01-27 00:19:43 +00:00
|
|
|
};
|
2022-12-28 21:21:41 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
# https://github.com/NixOS/nix/pull/7585
|
|
|
|
patch-monitorfdhup = fetchpatch2 {
|
|
|
|
name = "nix-7585-monitor-fd-hup.patch";
|
|
|
|
url = "https://github.com/NixOS/nix/commit/1df3d62c769dc68c279e89f68fdd3723ed3bcb5a.patch";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-f+F0fUO+bqyPXjt+IXJtISVr589hdc3y+Cdrxznb+Nk=";
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
# https://github.com/NixOS/nix/pull/7473
|
|
|
|
patch-sqlite-exception = fetchpatch2 {
|
|
|
|
name = "nix-7473-sqlite-exception-add-message.patch";
|
|
|
|
url = "https://github.com/hercules-ci/nix/commit/c965f35de71cc9d88f912f6b90fd7213601e6eb8.patch";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-tI5nKU7SZgsJrxiskJ5nHZyfrWf5aZyKYExM0792N80=";
|
2022-12-28 21:21:41 +00:00
|
|
|
};
|
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
patch-non-existing-output = fetchpatch {
|
|
|
|
# https://github.com/NixOS/nix/pull/7283
|
|
|
|
name = "fix-requires-non-existing-output.patch";
|
|
|
|
url = "https://github.com/NixOS/nix/commit/3ade5f5d6026b825a80bdcc221058c4f14e10a27.patch";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-s1ybRFCjQaSGj7LKu0Z5g7UiHqdJGeD+iPoQL0vaiS0=";
|
2023-03-24 00:07:29 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
patch-rapidcheck-shared = fetchpatch2 {
|
|
|
|
# https://github.com/NixOS/nix/pull/9431
|
|
|
|
name = "fix-missing-librapidcheck.patch";
|
|
|
|
url = "https://github.com/NixOS/nix/commit/46131567da96ffac298b9ec54016b37114b0dfd5.patch";
|
|
|
|
hash = "sha256-lShYxYKRDWwBqCysAFmFBudhhAL1eendWcL8sEFLCGg=";
|
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
# Intentionally does not support overrideAttrs etc
|
|
|
|
# Use only for tests that are about the package relation to `pkgs` and/or NixOS.
|
|
|
|
addTestsShallowly = tests: pkg: pkg // {
|
|
|
|
tests = pkg.tests // tests;
|
|
|
|
# In case someone reads the wrong attribute
|
|
|
|
passthru.tests = pkg.tests // tests;
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
addFallbackPathsCheck = pkg: addTestsShallowly
|
|
|
|
{ nix-fallback-paths =
|
|
|
|
runCommand "test-nix-fallback-paths-version-equals-nix-stable" {
|
|
|
|
paths = lib.concatStringsSep "\n" (builtins.attrValues (import ../../../../nixos/modules/installer/tools/nix-fallback-paths.nix));
|
|
|
|
} ''
|
|
|
|
if [[ "" != $(grep -v 'nix-${pkg.version}$' <<< "$paths") ]]; then
|
|
|
|
echo "nix-fallback-paths not up to date with nixVersions.stable (nix-${pkg.version})"
|
|
|
|
echo "The following paths are not up to date:"
|
|
|
|
grep -v 'nix-${pkg.version}$' <<< "$paths"
|
|
|
|
echo
|
|
|
|
echo "Fix it by running in nixpkgs:"
|
|
|
|
echo
|
|
|
|
echo "curl https://releases.nixos.org/nix/nix-${pkg.version}/fallback-paths.nix >nixos/modules/installer/tools/nix-fallback-paths.nix"
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
echo "nix-fallback-paths versions up to date"
|
|
|
|
touch $out
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
pkg;
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
in lib.makeExtensible (self: ({
|
2024-01-02 11:29:13 +00:00
|
|
|
nix_2_3 = (common {
|
|
|
|
version = "2.3.17";
|
|
|
|
hash = "sha256-EK0pgHDekJFqr0oMj+8ANIjq96WPjICe2s0m4xkUdH4=";
|
2023-02-02 18:25:31 +00:00
|
|
|
patches = [
|
|
|
|
patch-monitorfdhup
|
|
|
|
];
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with lib.maintainers; [ flokli raitobezarius ];
|
2022-01-27 00:19:43 +00:00
|
|
|
}).override { boehmgc = boehmgc-nix_2_3; };
|
2021-07-21 07:28:18 +00:00
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
nix_2_10 = common {
|
|
|
|
version = "2.10.3";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-B9EyDUz/9tlcWwf24lwxCFmkxuPTVW7HFYvp0C4xGbc=";
|
2022-11-21 17:40:18 +00:00
|
|
|
patches = [
|
|
|
|
./patches/flaky-tests.patch
|
2023-03-24 00:07:29 +00:00
|
|
|
patch-non-existing-output
|
2023-02-02 18:25:31 +00:00
|
|
|
patch-monitorfdhup
|
2022-12-28 21:21:41 +00:00
|
|
|
patch-sqlite-exception
|
2022-11-21 17:40:18 +00:00
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
2022-01-27 00:19:43 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
nix_2_11 = common {
|
2022-12-02 08:20:57 +00:00
|
|
|
version = "2.11.1";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-qCV65kw09AG+EkdchDPq7RoeBznX0Q6Qa4yzPqobdOk=";
|
2022-11-21 17:40:18 +00:00
|
|
|
patches = [
|
|
|
|
./patches/flaky-tests.patch
|
2023-03-24 00:07:29 +00:00
|
|
|
patch-non-existing-output
|
2023-02-02 18:25:31 +00:00
|
|
|
patch-monitorfdhup
|
2022-12-28 21:21:41 +00:00
|
|
|
patch-sqlite-exception
|
2022-11-21 17:40:18 +00:00
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
nix_2_12 = common {
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "2.12.1";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-GmHKhq0uFtdOiJnuBwj2YwlZjvh6YTkfQZgeu4e0dLU=";
|
2022-12-17 10:02:37 +00:00
|
|
|
patches = [
|
|
|
|
./patches/flaky-tests.patch
|
2023-02-02 18:25:31 +00:00
|
|
|
patch-monitorfdhup
|
2022-12-28 21:21:41 +00:00
|
|
|
patch-sqlite-exception
|
2022-12-17 10:02:37 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nix_2_13 = common {
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.13.6";
|
|
|
|
hash = "sha256-pd2yGmHWn4njfbrSP6cMJx8qL+yeGieqcbLNICzcRFs=";
|
2023-03-04 12:14:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nix_2_14 = common {
|
|
|
|
version = "2.14.1";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-5aCmGZbsFcLIckCDfvnPD4clGPQI7qYAqHYlttN/Wkg=";
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
patch-rapidcheck-shared
|
|
|
|
];
|
2023-02-02 18:25:31 +00:00
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
nix_2_15 = common {
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.15.3";
|
|
|
|
hash = "sha256-sfFXbjC5iIdSAbctZIuFozxX0uux/KFBNr9oh33xINs=";
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
patch-rapidcheck-shared
|
|
|
|
];
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nix_2_16 = common {
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "2.16.2";
|
|
|
|
hash = "sha256-VXIYCDkvAWeMoU0W2ZI0TeOszCZA1o8trz6YCPFD5ac=";
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
patch-rapidcheck-shared
|
|
|
|
];
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
nix_2_17 = common {
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "2.17.1";
|
|
|
|
hash = "sha256-Q5L+rHzjp0bYuR2ogg+YPCn6isjmlQ4CJVT0zpn/hFc=";
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
patch-rapidcheck-shared
|
|
|
|
];
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nix_2_18 = common {
|
|
|
|
version = "2.18.1";
|
|
|
|
hash = "sha256-WNmifcTsN9aG1ONkv+l2BC4sHZZxtNKy0keqBHXXQ7w=";
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
patch-rapidcheck-shared
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
nix_2_19 = common {
|
|
|
|
version = "2.19.2";
|
|
|
|
hash = "sha256-iA8DqS+W2fWTfR+nNJSvMHqQ+4NpYMRT3b+2zS6JTvE=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# The minimum Nix version supported by Nixpkgs
|
|
|
|
# Note that some functionality *might* have been backported into this Nix version,
|
|
|
|
# making this package an inaccurate representation of what features are available
|
|
|
|
# in the actual lowest minver.nix *patch* version.
|
|
|
|
minimum =
|
|
|
|
let
|
|
|
|
minver = import ../../../../lib/minver.nix;
|
|
|
|
major = lib.versions.major minver;
|
|
|
|
minor = lib.versions.minor minver;
|
|
|
|
attribute = "nix_${major}_${minor}";
|
|
|
|
nix = self.${attribute};
|
|
|
|
in
|
|
|
|
if ! self ? ${attribute} then
|
|
|
|
throw "The minimum supported Nix version is ${minver} (declared in lib/minver.nix), but pkgs.nixVersions.${attribute} does not exist."
|
|
|
|
else
|
|
|
|
nix;
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
stable = addFallbackPathsCheck self.nix_2_18;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
unstable = self.nix_2_19;
|
2023-07-15 17:15:38 +00:00
|
|
|
} // lib.optionalAttrs config.allowAliases {
|
|
|
|
nix_2_4 = throw "nixVersions.nix_2_4 has been removed";
|
|
|
|
|
|
|
|
nix_2_5 = throw "nixVersions.nix_2_5 has been removed";
|
|
|
|
|
|
|
|
nix_2_6 = throw "nixVersions.nix_2_6 has been removed";
|
|
|
|
|
|
|
|
nix_2_7 = throw "nixVersions.nix_2_7 has been removed";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nix_2_8 = throw "nixVersions.nix_2_8 has been removed";
|
|
|
|
|
|
|
|
nix_2_9 = throw "nixVersions.nix_2_9 has been removed";
|
|
|
|
}))
|