From 737e30d3feb0e8bc7eb42f680ce67868627314f3 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Tue, 1 Feb 2022 12:45:12 -0500 Subject: [PATCH 01/10] hadoop: add aarch64 support This commit also changes the names of the tests for Hadoop so they use dashes instead of dots, and makes the default `hadoop` test what would have been `hadoop-all` after the rename. This change should mean that we're able to run `nix build github:nixos/nixpkgs/master#nixosTests.hadoop` which I was unable to do prior to this change. --- nixos/tests/all-tests.nix | 6 +- .../networking/cluster/hadoop/default.nix | 68 ++++++++++++++----- 2 files changed, 55 insertions(+), 19 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 3fd4945ed352e..cf695dad4762f 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -187,9 +187,9 @@ in grocy = handleTest ./grocy.nix {}; grub = handleTest ./grub.nix {}; gvisor = handleTest ./gvisor.nix {}; - hadoop.all = handleTestOn [ "x86_64-linux" ] ./hadoop/hadoop.nix {}; - hadoop.hdfs = handleTestOn [ "x86_64-linux" ] ./hadoop/hdfs.nix {}; - hadoop.yarn = handleTestOn [ "x86_64-linux" ] ./hadoop/yarn.nix {}; + hadoop = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/hadoop.nix {}; + hadoop-hdfs = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/hdfs.nix {}; + hadoop-yarn = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/yarn.nix {}; haka = handleTest ./haka.nix {}; haproxy = handleTest ./haproxy.nix {}; hardened = handleTest ./hardened.nix {}; diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index 0e8e652fbb30b..6444d75829de8 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -1,7 +1,19 @@ -{ lib, stdenv, fetchurl, makeWrapper, autoPatchelfHook -, jdk8_headless, jdk11_headless -, bash, coreutils, which -, bzip2, cyrus_sasl , protobuf3_7, snappy, zlib, zstd +{ lib +, stdenv +, fetchurl +, makeWrapper +, autoPatchelfHook +, jdk8_headless +, jdk11_headless +, bash +, coreutils +, which +, bzip2 +, cyrus_sasl +, protobuf3_7 +, snappy +, zlib +, zstd , openssl }: @@ -9,15 +21,25 @@ with lib; let common = { pname, version, untarDir ? "${pname}-${version}", sha256, jdk, openssl, nativeLibs ? [ ], libPatches ? "" }: + let + platformUrlSuffix = + if stdenv.isx86_64 && (stdenv.isLinux || stdenv.isDarwin) + then "" + else + if stdenv.isAarch64 && (stdenv.isLinux || stdenv.isDarwin) + then "-aarch64" + else throw "Hadoop does not currently support ${stdenv.system}."; + in stdenv.mkDerivation rec { inherit pname version jdk libPatches untarDir openssl; src = fetchurl { - url = "mirror://apache/hadoop/common/hadoop-${version}/hadoop-${version}.tar.gz"; - inherit sha256; + url = "mirror://apache/hadoop/common/hadoop-${version}/hadoop-${version}${platformUrlSuffix}.tar.gz"; + sha256 = sha256.${stdenv.system}; }; + doCheck = true; nativeBuildInputs = [ makeWrapper ] - ++ optional (nativeLibs != [] || libPatches != "") [ autoPatchelfHook ]; + ++ optional (stdenv.isLinux && (nativeLibs != [ ] || libPatches != "")) [ autoPatchelfHook ]; buildInputs = [ openssl ] ++ nativeLibs; installPhase = '' @@ -51,7 +73,7 @@ let computers, each of which may be prone to failures. ''; maintainers = with maintainers; [ volth illustris ]; - platforms = [ "x86_64-linux" ]; + platforms = builtins.attrNames sha256; }; }; @@ -59,12 +81,22 @@ in { # Different version of hadoop support different java runtime versions # https://cwiki.apache.org/confluence/display/HADOOP/Hadoop+Java+Versions - hadoop_3_3 = common rec { - pname = "hadoop"; - version = "3.3.1"; - sha256 = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; - untarDir = "${pname}-${version}"; - jdk = jdk11_headless; + hadoop_3_3 = common + rec { + pname = "hadoop"; + version = "3.3.1"; + sha256 = { + x86_64-linux = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; + x86_64-darwin = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; + aarch64-linux = "sha256-v1Om2pk0wsgKBghRD2wgTSHJoKd3jkm1wPKAeDcKlgI="; + aarch64-darwin = "sha256-v1Om2pk0wsgKBghRD2wgTSHJoKd3jkm1wPKAeDcKlgI="; + }; + jdk = jdk11_headless; + untarDir = "${pname}-${version}"; + openssl = null; + } // optionalAttrs stdenv.isLinux { + # Only include native libraries if we're using Linux. + # TODO: Figure out how to get the libraries to link properly for darwin. inherit openssl; # TODO: Package and add Intel Storage Acceleration Library nativeLibs = [ stdenv.cc.cc.lib protobuf3_7 zlib snappy ]; @@ -80,7 +112,9 @@ in hadoop_3_2 = common rec { pname = "hadoop"; version = "3.2.2"; - sha256 = "1hxq297cqvkfgz2yfdiwa3l28g44i2abv5921k2d6b4pqd33prwp"; + sha256 = { + x86_64-linux = "1hxq297cqvkfgz2yfdiwa3l28g44i2abv5921k2d6b4pqd33prwp"; + }; jdk = jdk8_headless; # not using native libs because of broken openssl_1_0_2 dependency # can be manually overriden @@ -89,7 +123,9 @@ in hadoop2 = common rec { pname = "hadoop"; version = "2.10.1"; - sha256 = "1w31x4bk9f2swnx8qxx0cgwfg8vbpm6cy5lvfnbbpl3rsjhmyg97"; + sha256 = { + x86_64-linux = "1w31x4bk9f2swnx8qxx0cgwfg8vbpm6cy5lvfnbbpl3rsjhmyg97"; + }; jdk = jdk8_headless; openssl = null; }; From 2bb25dbe7ce9f2bb09cfc3811acb1c30cc3e6bbd Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Tue, 8 Feb 2022 18:26:32 -0500 Subject: [PATCH 02/10] hadoop: Don't case-split on supported architectures --- pkgs/applications/networking/cluster/hadoop/default.nix | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index 6444d75829de8..6990feaf72611 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -22,13 +22,7 @@ with lib; let common = { pname, version, untarDir ? "${pname}-${version}", sha256, jdk, openssl, nativeLibs ? [ ], libPatches ? "" }: let - platformUrlSuffix = - if stdenv.isx86_64 && (stdenv.isLinux || stdenv.isDarwin) - then "" - else - if stdenv.isAarch64 && (stdenv.isLinux || stdenv.isDarwin) - then "-aarch64" - else throw "Hadoop does not currently support ${stdenv.system}."; + platformUrlSuffix = optionalString stdenv.isAarch64 "-aarch64"; in stdenv.mkDerivation rec { inherit pname version jdk libPatches untarDir openssl; From f3897027c4d7f5fba21b601ed3e573f0550daa5d Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Tue, 8 Feb 2022 18:27:26 -0500 Subject: [PATCH 03/10] hadoop: Use sha256 from nix-prefetch-url for aarch64 builds --- pkgs/applications/networking/cluster/hadoop/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index 6990feaf72611..609f74d72ada0 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -82,8 +82,8 @@ in sha256 = { x86_64-linux = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; x86_64-darwin = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; - aarch64-linux = "sha256-v1Om2pk0wsgKBghRD2wgTSHJoKd3jkm1wPKAeDcKlgI="; - aarch64-darwin = "sha256-v1Om2pk0wsgKBghRD2wgTSHJoKd3jkm1wPKAeDcKlgI="; + aarch64-linux = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; + aarch64-darwin = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; }; jdk = jdk11_headless; untarDir = "${pname}-${version}"; From d321b391147c3f1e4da7f8ad6dd04ca07d017835 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Wed, 9 Feb 2022 19:55:33 -0500 Subject: [PATCH 04/10] hadoop: Make x86_64 settings default and conditionally override --- .../networking/cluster/hadoop/default.nix | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index 609f74d72ada0..7ee18c83ac15b 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -75,34 +75,34 @@ in { # Different version of hadoop support different java runtime versions # https://cwiki.apache.org/confluence/display/HADOOP/Hadoop+Java+Versions - hadoop_3_3 = common - rec { - pname = "hadoop"; - version = "3.3.1"; - sha256 = { - x86_64-linux = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; - x86_64-darwin = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; - aarch64-linux = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; - aarch64-darwin = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; - }; - jdk = jdk11_headless; - untarDir = "${pname}-${version}"; + hadoop_3_3 = + common + rec { + pname = "hadoop"; + version = "3.3.1"; + untarDir = "${pname}-${version}"; + sha256 = { + x86_64-linux = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; + x86_64-darwin = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; + aarch64-linux = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; + aarch64-darwin = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; + }; + inherit openssl; + nativeLibs = [ stdenv.cc.cc.lib protobuf3_7 zlib snappy ]; + libPatches = '' + ln -s ${getLib cyrus_sasl}/lib/libsasl2.so $out/lib/${untarDir}/lib/native/libsasl2.so.2 + ln -s ${getLib openssl}/lib/libcrypto.so $out/lib/${untarDir}/lib/native/ + ln -s ${getLib zlib}/lib/libz.so.1 $out/lib/${untarDir}/lib/native/ + ln -s ${getLib zstd}/lib/libzstd.so.1 $out/lib/${untarDir}/lib/native/ + ln -s ${getLib bzip2}/lib/libbz2.so.1 $out/lib/${untarDir}/lib/native/ + patchelf --add-rpath ${jdk.home}/lib/server $out/lib/${untarDir}/lib/native/libnativetask.so.1.0.0 + ''; + jdk = jdk11_headless; + } // optionalAttrs stdenv.isAarch64 { openssl = null; - } // optionalAttrs stdenv.isLinux { - # Only include native libraries if we're using Linux. - # TODO: Figure out how to get the libraries to link properly for darwin. - inherit openssl; - # TODO: Package and add Intel Storage Acceleration Library - nativeLibs = [ stdenv.cc.cc.lib protobuf3_7 zlib snappy ]; - libPatches = '' - ln -s ${getLib cyrus_sasl}/lib/libsasl2.so $out/lib/${untarDir}/lib/native/libsasl2.so.2 - ln -s ${getLib openssl}/lib/libcrypto.so $out/lib/${untarDir}/lib/native/ - ln -s ${getLib zlib}/lib/libz.so.1 $out/lib/${untarDir}/lib/native/ - ln -s ${getLib zstd}/lib/libzstd.so.1 $out/lib/${untarDir}/lib/native/ - ln -s ${getLib bzip2}/lib/libbz2.so.1 $out/lib/${untarDir}/lib/native/ - patchelf --add-rpath ${jdk.home}/lib/server $out/lib/${untarDir}/lib/native/libnativetask.so.1.0.0 - ''; - }; + nativeLibs = [ ]; + libPatches = ""; + }; hadoop_3_2 = common rec { pname = "hadoop"; version = "3.2.2"; From 50c8089b2809b31581679a9e911357b9d4eadb13 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Thu, 10 Feb 2022 09:30:00 -0500 Subject: [PATCH 05/10] hadoop: aarch64-linux has native libraries, darwin does not --- pkgs/applications/networking/cluster/hadoop/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index 7ee18c83ac15b..b5aa6b4443642 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -83,9 +83,7 @@ in untarDir = "${pname}-${version}"; sha256 = { x86_64-linux = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; - x86_64-darwin = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; aarch64-linux = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; - aarch64-darwin = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; }; inherit openssl; nativeLibs = [ stdenv.cc.cc.lib protobuf3_7 zlib snappy ]; @@ -98,7 +96,11 @@ in patchelf --add-rpath ${jdk.home}/lib/server $out/lib/${untarDir}/lib/native/libnativetask.so.1.0.0 ''; jdk = jdk11_headless; - } // optionalAttrs stdenv.isAarch64 { + } // optionalAttrs stdenv.isDarwin { + sha256 = { + x86_64-darwin = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; + aarch64-darwin = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; + }; openssl = null; nativeLibs = [ ]; libPatches = ""; From e752dfc6fbae10ffb71673e0b0c6ecef3aee5cf5 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Thu, 10 Feb 2022 20:58:12 -0500 Subject: [PATCH 06/10] hadoop: Group attrset update to ensure completion before passing to common --- .../networking/cluster/hadoop/default.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index b5aa6b4443642..e81c6ae308f68 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -77,7 +77,7 @@ in # https://cwiki.apache.org/confluence/display/HADOOP/Hadoop+Java+Versions hadoop_3_3 = common - rec { + (rec { pname = "hadoop"; version = "3.3.1"; untarDir = "${pname}-${version}"; @@ -97,14 +97,14 @@ in ''; jdk = jdk11_headless; } // optionalAttrs stdenv.isDarwin { - sha256 = { - x86_64-darwin = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; - aarch64-darwin = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; - }; - openssl = null; - nativeLibs = [ ]; - libPatches = ""; - }; + sha256 = { + x86_64-darwin = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; + aarch64-darwin = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; + }; + openssl = null; + nativeLibs = [ ]; + libPatches = ""; + }); hadoop_3_2 = common rec { pname = "hadoop"; version = "3.2.2"; From 1e5ffe1fc0f93a6a9e3b6d0cd21cde53c7c4c144 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Mon, 14 Feb 2022 09:21:28 -0500 Subject: [PATCH 07/10] hadoop: Consolidate sha256 attrs and add assert for supported platforms --- .../applications/networking/cluster/hadoop/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index e81c6ae308f68..1a0a6dafec469 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -19,6 +19,8 @@ with lib; +assert elem stdenv.system [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; + let common = { pname, version, untarDir ? "${pname}-${version}", sha256, jdk, openssl, nativeLibs ? [ ], libPatches ? "" }: let @@ -81,9 +83,11 @@ in pname = "hadoop"; version = "3.3.1"; untarDir = "${pname}-${version}"; - sha256 = { + sha256 = rec { x86_64-linux = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; + x86_64-darwin = x86_64-linux; aarch64-linux = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; + aarch64-darwin = aarch64-linux; }; inherit openssl; nativeLibs = [ stdenv.cc.cc.lib protobuf3_7 zlib snappy ]; @@ -97,10 +101,6 @@ in ''; jdk = jdk11_headless; } // optionalAttrs stdenv.isDarwin { - sha256 = { - x86_64-darwin = "1b3v16ihysqaxw8za1r5jlnphy8dwhivdx2d0z64309w57ihlxxd"; - aarch64-darwin = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; - }; openssl = null; nativeLibs = [ ]; libPatches = ""; From e10eed89e7fa0922a701810591c083860bf865b7 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Wed, 23 Feb 2022 21:43:09 -0500 Subject: [PATCH 08/10] hadoop: add back dots in names of nixos tests --- nixos/tests/all-tests.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index cf695dad4762f..f0260bff4743d 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -187,9 +187,9 @@ in grocy = handleTest ./grocy.nix {}; grub = handleTest ./grub.nix {}; gvisor = handleTest ./gvisor.nix {}; - hadoop = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/hadoop.nix {}; - hadoop-hdfs = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/hdfs.nix {}; - hadoop-yarn = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/yarn.nix {}; + hadoop.all = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/hadoop.nix {}; + hadoop.hdfs = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/hdfs.nix {}; + hadoop.yarn = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./hadoop/yarn.nix {}; haka = handleTest ./haka.nix {}; haproxy = handleTest ./haproxy.nix {}; hardened = handleTest ./hardened.nix {}; From 799d7434e2a49407b6506cecb21d3f1fd3d3ae4c Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Wed, 23 Feb 2022 22:53:31 -0500 Subject: [PATCH 09/10] hadoop: link native libraries on Darwin even though they're not used to simplify expression --- .../networking/cluster/hadoop/default.nix | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index 1a0a6dafec469..901987d087696 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -22,7 +22,7 @@ with lib; assert elem stdenv.system [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; let - common = { pname, version, untarDir ? "${pname}-${version}", sha256, jdk, openssl, nativeLibs ? [ ], libPatches ? "" }: + common = { pname, version, untarDir ? "${pname}-${version}", sha256, jdk, openssl ? null, nativeLibs ? [ ], libPatches ? "" }: let platformUrlSuffix = optionalString stdenv.isAarch64 "-aarch64"; in @@ -89,6 +89,7 @@ in aarch64-linux = "00ln18vpi07jq2slk3kplyhcj8ad41n0yl880q5cihilk7daclxz"; aarch64-darwin = aarch64-linux; }; + inherit openssl; nativeLibs = [ stdenv.cc.cc.lib protobuf3_7 zlib snappy ]; libPatches = '' @@ -97,13 +98,8 @@ in ln -s ${getLib zlib}/lib/libz.so.1 $out/lib/${untarDir}/lib/native/ ln -s ${getLib zstd}/lib/libzstd.so.1 $out/lib/${untarDir}/lib/native/ ln -s ${getLib bzip2}/lib/libbz2.so.1 $out/lib/${untarDir}/lib/native/ - patchelf --add-rpath ${jdk.home}/lib/server $out/lib/${untarDir}/lib/native/libnativetask.so.1.0.0 - ''; + '' + optionalString stdenv.isLinux "patchelf --add-rpath ${jdk.home}/lib/server $out/lib/${untarDir}/lib/native/libnativetask.so.1.0.0"; jdk = jdk11_headless; - } // optionalAttrs stdenv.isDarwin { - openssl = null; - nativeLibs = [ ]; - libPatches = ""; }); hadoop_3_2 = common rec { pname = "hadoop"; @@ -114,7 +110,6 @@ in jdk = jdk8_headless; # not using native libs because of broken openssl_1_0_2 dependency # can be manually overriden - openssl = null; }; hadoop2 = common rec { pname = "hadoop"; @@ -123,6 +118,5 @@ in x86_64-linux = "1w31x4bk9f2swnx8qxx0cgwfg8vbpm6cy5lvfnbbpl3rsjhmyg97"; }; jdk = jdk8_headless; - openssl = null; }; } From 2cf96863d1ba53d3e2f58a2be32c1feb045576aa Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Fri, 25 Feb 2022 19:19:47 -0500 Subject: [PATCH 10/10] hadoop: Minor simplifications to default.nix --- .../networking/cluster/hadoop/default.nix | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index 901987d087696..6a48cc8ada89e 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -23,13 +23,10 @@ assert elem stdenv.system [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarc let common = { pname, version, untarDir ? "${pname}-${version}", sha256, jdk, openssl ? null, nativeLibs ? [ ], libPatches ? "" }: - let - platformUrlSuffix = optionalString stdenv.isAarch64 "-aarch64"; - in stdenv.mkDerivation rec { inherit pname version jdk libPatches untarDir openssl; src = fetchurl { - url = "mirror://apache/hadoop/common/hadoop-${version}/hadoop-${version}${platformUrlSuffix}.tar.gz"; + url = "mirror://apache/hadoop/common/hadoop-${version}/hadoop-${version}" + optionalString stdenv.isAarch64 "-aarch64" + ".tar.gz"; sha256 = sha256.${stdenv.system}; }; doCheck = true; @@ -69,9 +66,8 @@ let computers, each of which may be prone to failures. ''; maintainers = with maintainers; [ volth illustris ]; - platforms = builtins.attrNames sha256; + platforms = attrNames sha256; }; - }; in { @@ -104,9 +100,7 @@ in hadoop_3_2 = common rec { pname = "hadoop"; version = "3.2.2"; - sha256 = { - x86_64-linux = "1hxq297cqvkfgz2yfdiwa3l28g44i2abv5921k2d6b4pqd33prwp"; - }; + sha256.x86_64-linux = "1hxq297cqvkfgz2yfdiwa3l28g44i2abv5921k2d6b4pqd33prwp"; jdk = jdk8_headless; # not using native libs because of broken openssl_1_0_2 dependency # can be manually overriden @@ -114,9 +108,7 @@ in hadoop2 = common rec { pname = "hadoop"; version = "2.10.1"; - sha256 = { - x86_64-linux = "1w31x4bk9f2swnx8qxx0cgwfg8vbpm6cy5lvfnbbpl3rsjhmyg97"; - }; + sha256.x86_64-linux = "1w31x4bk9f2swnx8qxx0cgwfg8vbpm6cy5lvfnbbpl3rsjhmyg97"; jdk = jdk8_headless; }; }