graalvmXX-ce: use the release version as defaultVersion

This commit is contained in:
Thibault Gagnaux 2022-04-02 11:33:07 +02:00
parent bfc501493f
commit 2d7d3692c1
No known key found for this signature in database
GPG key ID: 44BD0764ACAE8E25
5 changed files with 62 additions and 47 deletions

View file

@ -15,8 +15,8 @@ let
*/
graalvm11-ce-release-version = "22.0.0.2";
graalvm17-ce-release-version = "22.0.0.2";
graalvm11-ce-dev-version = "22.2.0-dev-20220331_1955";
graalvm17-ce-dev-version = "22.2.0-dev-20220331_1955";
graalvm11-ce-dev-version = "22.2.0-dev-20220401_1942";
graalvm17-ce-dev-version = "22.2.0-dev-20220401_1942";
commonProducts = [
"graalvm-ce"
@ -25,16 +25,19 @@ let
"wasm-installable-svm"
];
baseConfig = {
in
{
inherit mkGraal;
graalvm11-ce = mkGraal rec {
config = {
x86_64-darwin = {
arch = "darwin-amd64";
products = commonProducts ++ [ "python-installable-svm" ];
version = graalvm17-ce-release-version;
};
x86_64-linux = {
arch = "linux-amd64";
products = commonProducts ++ [ "python-installable-svm" ];
version = graalvm17-ce-release-version;
};
aarch64-darwin = {
arch = "darwin-aarch64";
@ -42,22 +45,14 @@ let
"graalvm-ce"
"native-image-installable-svm"
];
version = graalvm17-ce-dev-version;
version = graalvm11-ce-dev-version;
};
};
in
{
inherit mkGraal;
graalvm11-ce = mkGraal rec {
config = baseConfig // {
aarch64-linux = {
arch = "linux-aarch64";
products = commonProducts;
version = graalvm11-ce-release-version;
};
};
defaultVersion = graalvm11-ce-release-version;
javaVersion = "11";
platforms = builtins.attrNames config;
};
@ -68,7 +63,25 @@ in
# directory"/tmp/SVM-4194439592488143713"): error=0, Failed to exec spawn
# helper: pid: 19865, exit value: 1"
graalvm17-ce = mkGraal rec {
config = baseConfig;
config = {
x86_64-darwin = {
arch = "darwin-amd64";
products = commonProducts ++ [ "python-installable-svm" ];
};
x86_64-linux = {
arch = "linux-amd64";
products = commonProducts ++ [ "python-installable-svm" ];
};
aarch64-darwin = {
arch = "darwin-aarch64";
products = [
"graalvm-ce"
"native-image-installable-svm"
];
version = graalvm17-ce-dev-version;
};
};
defaultVersion = graalvm17-ce-release-version;
javaVersion = "17";
platforms = builtins.attrNames config;
};

View file

@ -1,12 +1,12 @@
{
"darwin-aarch64": {
"graalvm-ce|java11|22.2.0-dev-20220331_1955": {
"sha256": "a1229931575bd90256f5453ce9c880cf2286db117d4cbfec92c033813b017035",
"url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220331_1955/graalvm-ce-java11-darwin-aarch64-dev.tar.gz"
"graalvm-ce|java11|22.2.0-dev-20220401_1942": {
"sha256": "c83dee740ae148486598759e44a717b09d8124e4ea50f9da1e7d49d016572b89",
"url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220401_1942/graalvm-ce-java11-darwin-aarch64-dev.tar.gz"
},
"native-image-installable-svm|java11|22.2.0-dev-20220331_1955": {
"sha256": "813f9cc417415801e3d7d6468bb06e45487c76fe35b56202b66b6c9fa3ce3456",
"url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220331_1955/native-image-installable-svm-java11-darwin-aarch64-dev.jar"
"native-image-installable-svm|java11|22.2.0-dev-20220401_1942": {
"sha256": "661311ae26bfd6c46360b9e65aabe9361dc5cd05878a404343adf16925ae78fa",
"url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220401_1942/native-image-installable-svm-java11-darwin-aarch64-dev.jar"
}
},
"darwin-amd64": {

View file

@ -1,12 +1,12 @@
{
"darwin-aarch64": {
"graalvm-ce|java17|22.2.0-dev-20220331_1955": {
"sha256": "bb217a3bd53a488ef3672920fd47b9a0d800243eb385a7ceae9ddbd4350c0b27",
"url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220331_1955/graalvm-ce-java17-darwin-aarch64-dev.tar.gz"
"graalvm-ce|java17|22.2.0-dev-20220401_1942": {
"sha256": "f0409c59adbce62da7be46ab7d0e01abe5c080ef97d0b555e6c773f94dbfdecf",
"url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220401_1942/graalvm-ce-java17-darwin-aarch64-dev.tar.gz"
},
"native-image-installable-svm|java17|22.2.0-dev-20220331_1955": {
"sha256": "eee405e704792794f45e619372e72e0343ba2caf8ace0e4c7abd8baa69e56bcf",
"url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220331_1955/native-image-installable-svm-java17-darwin-aarch64-dev.jar"
"native-image-installable-svm|java17|22.2.0-dev-20220401_1942": {
"sha256": "3770dc4810d7ebae8f9ca2212e91112629096a964d3caea1667b0aaf5f70c1e0",
"url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220401_1942/native-image-installable-svm-java17-darwin-aarch64-dev.jar"
}
},
"darwin-amd64": {

View file

@ -1,4 +1,5 @@
{ javaVersion
, defaultVersion
, platforms
, config
, useMusl ? false
@ -41,7 +42,7 @@ assert useMusl -> stdenv.isLinux;
let
platform = config.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
version = platform.version;
version = platform.version or defaultVersion;
name = "graalvm${javaVersion}-ce";
sourcesFilename = "${name}-sources.json";
sources = builtins.fromJSON (builtins.readFile (./${sourcesFilename}));
@ -284,7 +285,7 @@ let
passthru = {
home = graalvmXXX-ce;
updateScript = import ./update.nix {
inherit lib writeShellScript jq sourcesFilename name config gnused;
inherit lib writeShellScript jq sourcesFilename name config gnused defaultVersion;
graalVersion = version;
javaVersion = "java${javaVersion}";
};

View file

@ -1,5 +1,6 @@
{ javaVersion
, graalVersion
, defaultVersion
, config
, sourcesFilename
, name
@ -151,12 +152,12 @@ let
};
};
# genArchProductVersionPairs :: String -> AttrSet -> [AttrSet]
genArchProductVersionList = javaVersion: archProducts:
# genArchProductVersionPairs :: String -> -> String -> AttrSet -> [AttrSet]
genArchProductVersionList = javaVersion: graalVersion: archProducts:
let
arch = archProducts.arch;
products = archProducts.products;
javaGraalVersion = javaVersion + separator + (getLatestVersion archProducts.version);
javaGraalVersion = javaVersion + separator + (getLatestVersion (archProducts.version or graalVersion));
productJavaGraalVersionList =
cartesianZipListsWith (a: b: a + separator + b)
products [ javaGraalVersion ];
@ -164,11 +165,11 @@ let
cartesianZipListsWith (genUrlAndSha256) [ arch ] productJavaGraalVersionList;
# genSources :: String -> AttrSet -> Path String
genSources = javaVersion: config:
# genSources :: String -> String -> AttrSet -> Path String
genSources = javaVersion: defaultVersion: config:
let
archProducts = builtins.attrValues config;
sourcesList = builtins.concatMap (genArchProductVersionList javaVersion) archProducts;
sourcesList = builtins.concatMap (genArchProductVersionList javaVersion defaultVersion) archProducts;
sourcesAttr = builtins.foldl' (lib.recursiveUpdate) { } sourcesList;
in
builtins.toFile "sources.json" (builtins.toJSON sourcesAttr);
@ -182,7 +183,7 @@ let
}.${builtins.toString (builtins.compareVersions newVersion currentVersion)};
newVersion = getLatestVersion graalVersion;
sourcesJson = genSources javaVersion config;
sourcesJson = genSources javaVersion defaultVersion config;
sourcesJsonPath = lib.strings.escapeShellArg ./${sourcesFilename};
# versionKeyInDefaultNix String -> String