graalvm17-ce-dev: init with aarch64-darwin

This commit is contained in:
Thibault Gagnaux 2022-03-29 12:36:39 +02:00
parent fa5712c0b7
commit c6203291c8
No known key found for this signature in database
GPG key ID: 44BD0764ACAE8E25
7 changed files with 117 additions and 103 deletions

View file

@ -56,4 +56,19 @@ in
javaVersion = "17";
platforms = builtins.attrNames config;
};
graalvm17-ce-dev = mkGraal rec {
config = {
aarch64-darwin = {
arch = "darwin-aarch64";
products = [
"graalvm-ce"
"native-image-installable-svm"
];
};
};
version = "22.2.0-dev-20220326_0133";
javaVersion = "17";
platforms = builtins.attrNames config;
};
}

View file

@ -1,62 +1,62 @@
{
"darwin-amd64": {
"graalvm-ce_java11_22.0.0.2": {
"graalvm-ce|java11|22.0.0.2": {
"sha256": "8280159b8a66c51a839c8079d885928a7f759d5da0632f3af7300df2b63a6323",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java11-darwin-amd64-22.0.0.2.tar.gz"
},
"native-image-installable-svm_java11_22.0.0.2": {
"native-image-installable-svm|java11|22.0.0.2": {
"sha256": "03c27de6cce61ee8073e89252212457f3fbac2c0bc9bfa4acbff12176476c176",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/native-image-installable-svm-java11-darwin-amd64-22.0.0.2.jar"
},
"python-installable-svm_java11_22.0.0.2": {
"python-installable-svm|java11|22.0.0.2": {
"sha256": "67ee2f1cc10b0189e359344c31b22f423e636ff4ec2dd7d9437c3eb0ef54e601",
"url": "https://github.com/graalvm/graalpython/releases/download/vm-22.0.0.2/python-installable-svm-java11-darwin-amd64-22.0.0.2.jar"
},
"ruby-installable-svm_java11_22.0.0.2": {
"ruby-installable-svm|java11|22.0.0.2": {
"sha256": "a25c0099a21ca1ca9904dd3acdeef509f67a13b96c6135b6de199e9805330df9",
"url": "https://github.com/oracle/truffleruby/releases/download/vm-22.0.0.2/ruby-installable-svm-java11-darwin-amd64-22.0.0.2.jar"
},
"wasm-installable-svm_java11_22.0.0.2": {
"wasm-installable-svm|java11|22.0.0.2": {
"sha256": "d74c210a8a87b8eb0c4d18a65fde6f2c03ebc94d9bf7ed87bbb9cacc460006d7",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/wasm-installable-svm-java11-darwin-amd64-22.0.0.2.jar"
}
},
"linux-aarch64": {
"graalvm-ce_java11_22.0.0.2": {
"graalvm-ce|java11|22.0.0.2": {
"sha256": "1cc0263d95f642dada4e290dca7f49c0456cefa7b690b67e3e5c159b537b2c58",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java11-linux-aarch64-22.0.0.2.tar.gz"
},
"native-image-installable-svm_java11_22.0.0.2": {
"native-image-installable-svm|java11|22.0.0.2": {
"sha256": "51d41e890a5aabf8e7b9d4f4e0f88206ee70a261f7dbb0315d51770ab8f3009e",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/native-image-installable-svm-java11-linux-aarch64-22.0.0.2.jar"
},
"ruby-installable-svm_java11_22.0.0.2": {
"ruby-installable-svm|java11|22.0.0.2": {
"sha256": "e0fb582a9c6b4167e7dc267c58ca1968bd1c471b3bc5c56061b436f175486d80",
"url": "https://github.com/oracle/truffleruby/releases/download/vm-22.0.0.2/ruby-installable-svm-java11-linux-aarch64-22.0.0.2.jar"
},
"wasm-installable-svm_java11_22.0.0.2": {
"wasm-installable-svm|java11|22.0.0.2": {
"sha256": "a48470ae391c75cb2805b7fe27cde2c925c0466fdbc0623dfbb67c54f19dbf8c",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/wasm-installable-svm-java11-linux-aarch64-22.0.0.2.jar"
}
},
"linux-amd64": {
"graalvm-ce_java11_22.0.0.2": {
"graalvm-ce|java11|22.0.0.2": {
"sha256": "bc86083bb7e2778c7e4fe4f55d74790e42255b96f7806a7fefa51d06f3bc7103",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java11-linux-amd64-22.0.0.2.tar.gz"
},
"native-image-installable-svm_java11_22.0.0.2": {
"native-image-installable-svm|java11|22.0.0.2": {
"sha256": "8504a3441f5b28b8fd625f676674a9216f082ae63a4e30d43930c80f9672e71d",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/native-image-installable-svm-java11-linux-amd64-22.0.0.2.jar"
},
"python-installable-svm_java11_22.0.0.2": {
"python-installable-svm|java11|22.0.0.2": {
"sha256": "2f01d1bbc2ed2c507952d8ceaab1cb2176fc67e2d8c4b3bf5864e8d930c60c55",
"url": "https://github.com/graalvm/graalpython/releases/download/vm-22.0.0.2/python-installable-svm-java11-linux-amd64-22.0.0.2.jar"
},
"ruby-installable-svm_java11_22.0.0.2": {
"ruby-installable-svm|java11|22.0.0.2": {
"sha256": "e90f7ebc13b6c1f8e3f98881bb4fe2336870744174b2b6d41dc672d15f0b9a40",
"url": "https://github.com/oracle/truffleruby/releases/download/vm-22.0.0.2/ruby-installable-svm-java11-linux-amd64-22.0.0.2.jar"
},
"wasm-installable-svm_java11_22.0.0.2": {
"wasm-installable-svm|java11|22.0.0.2": {
"sha256": "c0fdfc40374b70f6f1597dd21660535c813dc5c3948c8a6ea9559a20f4d3fb5e",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/wasm-installable-svm-java11-linux-amd64-22.0.0.2.jar"
}

View file

@ -0,0 +1,12 @@
{
"darwin-aarch64": {
"graalvm-ce|java17|22.2.0-dev-20220326_0133": {
"sha256": "72bab733783684dba422d9e04eb4fbd9103adb21db6937cf204c0c46e6ce5b7d",
"url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220326_0133/graalvm-ce-java17-darwin-aarch64-dev.tar.gz"
},
"native-image-installable-svm|java17|22.2.0-dev-20220326_0133": {
"sha256": "397fd17fef67456f66820cbdae9493d16785499b91002d20fdef6e5aaf067ba7",
"url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220326_0133/native-image-installable-svm-java17-darwin-aarch64-dev.jar"
}
}
}

View file

@ -1,62 +1,44 @@
{
"darwin-amd64": {
"graalvm-ce_java17_22.0.0.2": {
"graalvm-ce|java17|22.0.0.2": {
"sha256": "d54af9d1f4d0d351827395a714ed84d2489b023b74a9c13a431cc9d31d1e8f9a",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java17-darwin-amd64-22.0.0.2.tar.gz"
},
"native-image-installable-svm_java17_22.0.0.2": {
"native-image-installable-svm|java17|22.0.0.2": {
"sha256": "007fa742cd139d447f83d776b6d78e717c9df11d56a61061a5937547c20028b7",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/native-image-installable-svm-java17-darwin-amd64-22.0.0.2.jar"
},
"python-installable-svm_java17_22.0.0.2": {
"python-installable-svm|java17|22.0.0.2": {
"sha256": "af887b0304d5ec98fab1be2cd1fca2aa3b10e84e823142a7f274560b1e0ea7c1",
"url": "https://github.com/graalvm/graalpython/releases/download/vm-22.0.0.2/python-installable-svm-java17-darwin-amd64-22.0.0.2.jar"
},
"ruby-installable-svm_java17_22.0.0.2": {
"ruby-installable-svm|java17|22.0.0.2": {
"sha256": "fc5eb6f833136ae3fda61f46fe0af66a8454ca2f803ca35eaff7336521cb468d",
"url": "https://github.com/oracle/truffleruby/releases/download/vm-22.0.0.2/ruby-installable-svm-java17-darwin-amd64-22.0.0.2.jar"
},
"wasm-installable-svm_java17_22.0.0.2": {
"wasm-installable-svm|java17|22.0.0.2": {
"sha256": "b76e6d872ce07ca9facd5b997dbb6e557ba72aa369ddd5f1664431bd11b98796",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/wasm-installable-svm-java17-darwin-amd64-22.0.0.2.jar"
}
},
"linux-aarch64": {
"graalvm-ce_java17_22.0.0.2": {
"sha256": "c7d78387d2a144944f26773697c1b61d3478a081a1c5e7fc20f47f1f5f3c82c7",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java17-linux-aarch64-22.0.0.2.tar.gz"
},
"native-image-installable-svm_java17_22.0.0.2": {
"sha256": "798947d0a93988929d2b8e3555f7c65225e789124cd99fbc0c3aae5f350175db",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/native-image-installable-svm-java17-linux-aarch64-22.0.0.2.jar"
},
"ruby-installable-svm_java17_22.0.0.2": {
"sha256": "38cd733334efdecb040087341bccf0aed8031d70eccd857695eaee6b274a5a6d",
"url": "https://github.com/oracle/truffleruby/releases/download/vm-22.0.0.2/ruby-installable-svm-java17-linux-aarch64-22.0.0.2.jar"
},
"wasm-installable-svm_java17_22.0.0.2": {
"sha256": "5a4d85324b0565c647b0a31f2a12c9192c9bdc49fca3fe57fdb95370e01c325e",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/wasm-installable-svm-java17-linux-aarch64-22.0.0.2.jar"
}
},
"linux-amd64": {
"graalvm-ce_java17_22.0.0.2": {
"graalvm-ce|java17|22.0.0.2": {
"sha256": "4f743e0ed3d974b7d619ca2ed6014554e8c12e5ebbb38b9bc9e820b182169bd4",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java17-linux-amd64-22.0.0.2.tar.gz"
},
"native-image-installable-svm_java17_22.0.0.2": {
"native-image-installable-svm|java17|22.0.0.2": {
"sha256": "8c25f650d58c2649c97061cb806dfaec9e685d5d2b80afc7cf72fe61d6891831",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/native-image-installable-svm-java17-linux-amd64-22.0.0.2.jar"
},
"python-installable-svm_java17_22.0.0.2": {
"python-installable-svm|java17|22.0.0.2": {
"sha256": "b3b78a15bd29b4eaaf0f2607e21181ca2a5b41b38ba43a3ff2656c2f6effda8a",
"url": "https://github.com/graalvm/graalpython/releases/download/vm-22.0.0.2/python-installable-svm-java17-linux-amd64-22.0.0.2.jar"
},
"ruby-installable-svm_java17_22.0.0.2": {
"ruby-installable-svm|java17|22.0.0.2": {
"sha256": "d86c9ad50cbed980fa69d69b2eccd47d31880d8c55553483f59ce9eda15628bd",
"url": "https://github.com/oracle/truffleruby/releases/download/vm-22.0.0.2/ruby-installable-svm-java17-linux-amd64-22.0.0.2.jar"
},
"wasm-installable-svm_java17_22.0.0.2": {
"wasm-installable-svm|java17|22.0.0.2": {
"sha256": "7f7e51e4a24384b3dd960c12ab9b05b1fea58a0457d6b80e3797228fab93c0bd",
"url": "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/wasm-installable-svm-java17-linux-amd64-22.0.0.2.jar"
}

View file

@ -43,7 +43,9 @@ assert useMusl -> stdenv.isLinux;
let
platform = config.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
name = "graalvm${javaVersion}-ce";
name = if lib.hasInfix "dev" version
then "graalvm${javaVersion}-ce-dev"
else "graalvm${javaVersion}-ce";
sourcesFilename = "${name}-sources.json";
sources = builtins.fromJSON (builtins.readFile (./. + "/${sourcesFilename}"));
@ -164,43 +166,25 @@ let
done
'';
in
{
"11-linux-amd64" = ''
${copyClibrariesToOut "$out/lib/svm/clibraries"}
''
# ensure that $lib/lib exists to avoid breaking builds
mkdir -p $lib/lib
# jni.h expects jni_md.h to be in the header search path.
ln -s $out/include/linux/*_md.h $out/include/
${copyClibrariesToLib}
# copy-paste openjdk's preFixup
# Set JAVA_HOME automatically.
mkdir -p $out/nix-support
cat > $out/nix-support/setup-hook << EOF
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
${
lib.optionalString (stdenv.isLinux) ''
${copyClibrariesToOut "$out/lib/svm/clibraries"}
${copyClibrariesToLib}
''
}
'';
"17-linux-amd64" = ''
${copyClibrariesToOut "$out/lib/svm/clibraries"}
${copyClibrariesToLib}
'';
"11-linux-aarch64" = ''
${copyClibrariesToOut "$out/lib/svm/clibraries"}
${copyClibrariesToLib}
'';
"17-linux-aarch64" = ''
${copyClibrariesToOut "$out/lib/svm/clibraries"}
${copyClibrariesToLib}
'';
"11-darwin-amd64" = "";
"17-darwin-amd64" = "";
"17-darwin-aarch64" = "";
}.${javaVersionPlatform} + ''
# ensure that $lib/lib exists to avoid breaking builds
mkdir -p $lib/lib
# jni.h expects jni_md.h to be in the header search path.
ln -s $out/include/linux/*_md.h $out/include/
# copy-paste openjdk's preFixup
# Set JAVA_HOME automatically.
mkdir -p $out/nix-support
cat <<EOF > $out/nix-support/setup-hook
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';
dontStrip = true;
@ -284,7 +268,7 @@ let
}
${
lib.optionalString (platform.arch != "linux-aarch64" && platform.arch != "darwin-aarch64") ''
lib.optionalString (builtins.any (a: a == "python-installable-svm") platform.products) ''
echo "Testing GraalPython"
$out/bin/graalpython -c 'print(1 + 1)'
echo '1 + 1' | $out/bin/graalpython
@ -293,7 +277,7 @@ let
echo "Testing TruffleRuby"
${
lib.optionalString (platform != "darwin-aarch64") ''
lib.optionalString (builtins.any (a: a == "ruby-installable-svm") platform.products) ''
# Hide warnings about wrong locale
export LANG=C
export LC_ALL=C

View file

@ -10,6 +10,7 @@
}:
let
productJavaVersionGraalVersionSep = "|";
# getArchString :: String -> String
getArchString = nixArchString:
{
@ -21,40 +22,58 @@ let
# getProductSuffix :: String -> String
getProductSuffix = productName:
let suffixes = {
{
"graalvm-ce" = ".tar.gz";
"native-image-installable-svm" = ".jar";
"ruby-installable-svm" = ".jar";
"wasm-installable-svm" = ".jar";
"python-installable-svm" = ".jar";
};
in
suffixes.${productName};
}.${productName};
# getProductSuffix :: String -> String
getProductBaseUrl = productName:
let baseUrls = {
{
"graalvm-ce" = "https://github.com/graalvm/graalvm-ce-builds/releases/download";
"native-image-installable-svm" = "https://github.com/graalvm/graalvm-ce-builds/releases/download";
"ruby-installable-svm" = "https://github.com/oracle/truffleruby/releases/download";
"wasm-installable-svm" = "https://github.com/graalvm/graalvm-ce-builds/releases/download";
"python-installable-svm" = "https://github.com/graalvm/graalpython/releases/download";
};
}.${productName};
# getDevUrl :: String
getDevUrl = { arch, graalVersion, product, javaVersion }:
let
baseUrl = https://github.com/graalvm/graalvm-ce-dev-builds/releases/download;
in
baseUrls.${productName};
"${baseUrl}/${graalVersion}/${product}-${javaVersion}-${arch}-dev${getProductSuffix product}";
# generateUrl :: AttrSet -> String
generateUrl = { arch, graalVersion, product, javaVersion }:
let baseUrl = getProductBaseUrl product;
in
"${baseUrl}/vm-${graalVersion}/${product}-${javaVersion}-${arch}-${graalVersion}${getProductSuffix product}";
# downloadSha256 :: AttrSet -> String
downloadSha256 = args@{ arch, graalVersion, product, javaVersion }:
let url = generateUrl args + ".sha256";
# getReleaseUrl :: AttrSet -> String
getReleaseUrl = { arch, graalVersion, product, javaVersion }:
let baseUrl = getProductBaseUrl product;
in
builtins.readFile (builtins.fetchurl url);
"${baseUrl}/vm-${graalVersion}/${product}-${javaVersion}-${arch}-${graalVersion}${getProductSuffix product}";
# getUrl :: AttrSet -> String
getUrl = args@{ arch, graalVersion, product, javaVersion }:
if lib.hasInfix "dev" graalVersion
then getDevUrl args
else getReleaseUrl args;
# computeSha256 :: String -> String
computeSha256 = url:
builtins.hashFile "sha256" (builtins.fetchurl url);
# downloadSha256 :: String -> String
downloadSha256 = url:
let sha256Url = url + ".sha256";
in
builtins.readFile (builtins.fetchurl sha256Url);
# getSha256 :: String -> String -> String
getSha256 = graalVersion: url:
if lib.hasInfix "dev" graalVersion
then computeSha256 url
else downloadSha256 url;
# cartesianZipListsWith :: (a -> b -> c) -> [a] -> [b] -> [c]
cartesianZipListsWith = f: fst: snd:
@ -73,7 +92,7 @@ let
# genProductJavaVersionGraalVersionAttrSet :: String -> AttrSet
genProductJavaVersionGraalVersionAttrSet = product_javaVersion_graalVersion:
let attrNames = [ "product" "javaVersion" "graalVersion" ];
attrValues = lib.splitString "_" product_javaVersion_graalVersion;
attrValues = lib.splitString productJavaVersionGraalVersionSep product_javaVersion_graalVersion;
in zipListsToAttrs attrNames attrValues;
# genUrlAndSha256 :: String -> String -> AttrSet
@ -82,8 +101,8 @@ let
productJavaVersionGraalVersion =
(genProductJavaVersionGraalVersionAttrSet product_javaVersion_graalVersion)
// { inherit arch; };
url = generateUrl productJavaVersionGraalVersion;
sha256 = downloadSha256 productJavaVersionGraalVersion;
url = getUrl productJavaVersionGraalVersion;
sha256 = getSha256 productJavaVersionGraalVersion.graalVersion url;
in
{
${arch} = {
@ -99,7 +118,8 @@ let
arch = archProducts.arch;
products = archProducts.products;
productJavaGraalVersionList =
cartesianZipListsWith (a: b: a + "_" + b) products [ javaGraalVersion ];
cartesianZipListsWith (a: b: a + productJavaVersionGraalVersionSep + b)
products [ javaGraalVersion ];
in
cartesianZipListsWith (genUrlAndSha256) [ arch ] productJavaGraalVersionList;
@ -107,7 +127,7 @@ let
# genSources :: String -> String -> AttrSet -> Path String
genSources = graalVersion: javaVersion: config:
let
javaGraalVersion = javaVersion + "_" + graalVersion; # java17_20.2.0.2
javaGraalVersion = javaVersion + productJavaVersionGraalVersionSep + graalVersion;
archProducts = builtins.attrValues config;
sourcesList = builtins.concatMap (genArchProductVersionList javaGraalVersion) archProducts;
sourcesAttr = builtins.foldl' (lib.recursiveUpdate) {} sourcesList;

View file

@ -12864,6 +12864,7 @@ with pkgs;
});
graalvm11-ce = graalvmCEPackages.graalvm11-ce;
graalvm17-ce = graalvmCEPackages.graalvm17-ce;
graalvm17-ce-dev = graalvmCEPackages.graalvm17-ce-dev;
buildGraalvmNativeImage = callPackage ../build-support/build-graalvm-native-image { };
inherit (callPackages ../development/compilers/graalvm/enterprise-edition.nix { })