From 782d03bca71ecfe225a6d71a9ca2d5055d8af327 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Fri, 15 Apr 2022 19:33:52 +0100 Subject: [PATCH 1/6] graalvmXX-ee: remove This package was last updated in 2020. It is out-of-date compared to upstream and we have the graalvmXX-ce already, that is much better maintained nowadays. --- .../compilers/graalvm/enterprise-edition.nix | 183 ------------------ pkgs/top-level/aliases.nix | 2 + pkgs/top-level/all-packages.nix | 4 - 3 files changed, 2 insertions(+), 187 deletions(-) delete mode 100644 pkgs/development/compilers/graalvm/enterprise-edition.nix diff --git a/pkgs/development/compilers/graalvm/enterprise-edition.nix b/pkgs/development/compilers/graalvm/enterprise-edition.nix deleted file mode 100644 index f3ca8a4f5bbb..000000000000 --- a/pkgs/development/compilers/graalvm/enterprise-edition.nix +++ /dev/null @@ -1,183 +0,0 @@ -{ lib, stdenv, requireFile, perl, unzip, glibc, zlib, bzip2, gdk-pixbuf, xorg, glib, fontconfig, freetype, cairo, pango, gtk3, gtk2, ffmpeg, libGL, atk, alsa-lib, setJavaClassPath }: - -let - common = javaVersion: - let - graalvmXXX-ee = stdenv.mkDerivation rec { - pname = "graalvm${javaVersion}-ee"; - version = "20.2.1"; - srcs = [ - (requireFile { - name = "graalvm-ee-java${javaVersion}-linux-amd64-${version}.tar.gz"; - sha256 = { "8" = "e0bb182146283a43824dd2c2ceeb89b6ff7a93f9a85da889f8663ce1c2bd3002"; - "11" = "e5d92d361e7859fe5f88c92d7bb466e285e07f1e4e2d9944948f85fa0e3aee2b"; - }.${javaVersion}; - url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html"; - }) - (requireFile { - name = "native-image-installable-svm-svmee-java${javaVersion}-linux-amd64-${version}.jar"; - sha256 = { "8" = "37ac6a62f68adad513057a60513ba75749adf98cc73999b3918afe159900428d"; - "11" = "f62df715ad529f8b84854644ac99e0a9a349232c7f03985d20a2a8be20edaa44"; - }.${javaVersion}; - url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html"; - }) - (requireFile { - name = "llvm-toolchain-installable-java${javaVersion}-linux-amd64-${version}.jar"; - sha256 = { "8" = "da98a8c17b0c724b41d1596b57e282a1ecfcbf9140404dfb04b0d4d9fb159d8a"; - "11" = "fc442c396e92f59d034a69175104cb3565c3d128426bd939cc94c6ceccbb720f"; - }.${javaVersion}; - url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html"; - }) - (requireFile { - name = "ruby-installable-svm-svmee-java${javaVersion}-linux-amd64-${version}.jar"; - sha256 = { "8" = "44f6887249f2eb54cba98dd4d9de019da5463d92982e03bf655fffe4bb520daf"; - "11" = "941f3752ccb097958f49250586f04c305092ded3ea4c1b7d9a0f7632e47fa335"; - }.${javaVersion}; - url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html"; - }) - (requireFile { - name = "python-installable-svm-svmee-java${javaVersion}-linux-amd64-${version}.jar"; - sha256 = { "8" = "5c3993c701bd09c6064dcf4a6d9c7489620d0654b03c74682398c788c0211c09"; - "11" = "de3ebf35ce47dc399d7976cbd09fde0e85f2c10f85bc3fe8f32bb9e2b500ab70"; - }.${javaVersion}; - url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html"; - }) - (requireFile { - name = "wasm-installable-svm-svmee-java${javaVersion}-linux-amd64-${version}.jar"; - sha256 = { "8" = "c0a334b271fd32c098bb3c42eada7eafb9f536becaa756097eebe4682915b067"; - "11" = "9e801071992a0ff976bc40b640a8b9368fd8ea890ba986543658fcbaa3a7fd68"; - }.${javaVersion}; - url = "https://www.oracle.com/technetwork/graalvm/downloads/index.html"; - }) - ]; - nativeBuildInputs = [ unzip perl ]; - unpackPhase = '' - unpack_jar() { - jar=$1 - unzip -o $jar -d $out - perl -ne 'use File::Path qw(make_path); - use File::Basename qw(dirname); - if (/^(.+) = (.+)$/) { - make_path dirname("$ENV{out}/$1"); - system "ln -s $2 $ENV{out}/$1"; - }' $out/META-INF/symlinks - perl -ne 'if (/^(.+) = ([r-])([w-])([x-])([r-])([w-])([x-])([r-])([w-])([x-])$/) { - my $mode = ($2 eq 'r' ? 0400 : 0) + ($3 eq 'w' ? 0200 : 0) + ($4 eq 'x' ? 0100 : 0) + - ($5 eq 'r' ? 0040 : 0) + ($6 eq 'w' ? 0020 : 0) + ($7 eq 'x' ? 0010 : 0) + - ($8 eq 'r' ? 0004 : 0) + ($9 eq 'w' ? 0002 : 0) + ($10 eq 'x' ? 0001 : 0); - chmod $mode, "$ENV{out}/$1"; - }' $out/META-INF/permissions - rm -rf $out/META-INF - } - - mkdir -p $out - arr=($srcs) - tar xf ''${arr[0]} -C $out --strip-components=1 - unpack_jar ''${arr[1]} - unpack_jar ''${arr[2]} - unpack_jar ''${arr[3]} - unpack_jar ''${arr[4]} - unpack_jar ''${arr[5]} - ''; - - installPhase = { - "8" = '' - # BUG workaround http://mail.openjdk.java.net/pipermail/graal-dev/2017-December/005141.html - substituteInPlace $out/jre/lib/security/java.security \ - --replace file:/dev/random file:/dev/./urandom \ - --replace NativePRNGBlocking SHA1PRNG - - # provide libraries needed for static compilation - for f in ${glibc}/lib/* ${glibc.static}/lib/* ${zlib.static}/lib/*; do - ln -s $f $out/jre/lib/svm/clibraries/linux-amd64/$(basename $f) - done - - # allow using external truffle-api.jar and languages not included in the distrubution - rm $out/jre/lib/jvmci/parentClassLoader.classpath - ''; - "11" = '' - # BUG workaround http://mail.openjdk.java.net/pipermail/graal-dev/2017-December/005141.html - substituteInPlace $out/conf/security/java.security \ - --replace file:/dev/random file:/dev/./urandom \ - --replace NativePRNGBlocking SHA1PRNG - - # provide libraries needed for static compilation - for f in ${glibc}/lib/* ${glibc.static}/lib/* ${zlib.static}/lib/*; do - ln -s $f $out/lib/svm/clibraries/linux-amd64/$(basename $f) - done - ''; - }.${javaVersion}; - - dontStrip = true; - - # copy-paste openjdk's preFixup - preFixup = '' - # Set JAVA_HOME automatically. - mkdir -p $out/nix-support - cat < $out/nix-support/setup-hook - if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi - EOF - ''; - - postFixup = '' - rpath="${ { "8" = "$out/jre/lib/amd64/jli:$out/jre/lib/amd64/server:$out/jre/lib/amd64"; - "11" = "$out/lib/jli:$out/lib/server:$out/lib"; - }.${javaVersion} - }:${ - lib.strings.makeLibraryPath [ glibc xorg.libXxf86vm xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender - glib zlib bzip2 alsa-lib fontconfig freetype pango gtk3 gtk2 cairo gdk-pixbuf atk ffmpeg libGL ]}" - - for f in $(find $out -type f -perm -0100); do - patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$f" || true - patchelf --set-rpath "$rpath" "$f" || true - done - - for f in $(find $out -type f -perm -0100); do - if ldd "$f" | fgrep 'not found'; then echo "in file $f"; fi - done - ''; - - propagatedBuildInputs = [ setJavaClassPath zlib ]; # $out/bin/native-image needs zlib to build native executables - - doInstallCheck = true; - installCheckPhase = '' - echo ${lib.escapeShellArg '' - public class HelloWorld { - public static void main(String[] args) { - System.out.println("Hello World"); - } - } - ''} > HelloWorld.java - $out/bin/javac HelloWorld.java - - # run on JVM with Graal Compiler - $out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld - $out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld | fgrep 'Hello World' - - # Ahead-Of-Time compilation - $out/bin/native-image --no-server HelloWorld - ./helloworld - ./helloworld | fgrep 'Hello World' - - # Ahead-Of-Time compilation with --static - $out/bin/native-image --no-server --static HelloWorld - ./helloworld - ./helloworld | fgrep 'Hello World' - ''; - - passthru.home = graalvmXXX-ee; - - meta = with lib; { - homepage = "https://www.graalvm.org/"; - description = "High-Performance Polyglot VM"; - license = licenses.unfree; - maintainers = with maintainers; [ volth hlolli ]; - platforms = [ "x86_64-linux" ]; - }; - }; - in - graalvmXXX-ee; -in { - graalvm8-ee = common "8"; - graalvm11-ee = common "11"; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index dde08c9d5e9d..2e2c4e1fce14 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -492,6 +492,8 @@ mapAliases ({ graalvm11 = graalvm11-ce; graalvm8-ce = throw "graalvm8-ce has been removed by upstream"; # Added 2021-10-19 graalvm8 = throw "graalvm8-ce has been removed by upstream"; # Added 2021-10-19 + graalvm8-ee = throw "graalvm8-ee has been removed because it is unmaintained"; # Added 2022-04-15 + graalvm11-ee = throw "graalvm11-ee has been removed because it is unmaintained"; # Added 2022-04-15 gr-ais = gnuradio3_7.pkgs.ais; # Added 2019-05-27, changed 2020-10-16 grantlee5 = throw "'grantlee5' has been renamed to/replaced by 'libsForQt5.grantlee'"; # Converted to throw 2022-02-22 gr-gsm = gnuradio3_7.pkgs.gsm; # Added 2019-05-27, changed 2020-10-16 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e0f80b57c95d..208c5e5c0d9a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12788,10 +12788,6 @@ with pkgs; graalvm = graalvm11-ce; }; - inherit (callPackages ../development/compilers/graalvm/enterprise-edition.nix { }) - graalvm8-ee - graalvm11-ee; - openshot-qt = libsForQt5.callPackage ../applications/video/openshot-qt { }; lingua-franca = callPackage ../development/compilers/lingua-franca { }; From 399ed1f1bda0546f4fbd73cd5c4d1dc0acc51fb1 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Fri, 15 Apr 2022 20:08:43 +0100 Subject: [PATCH 2/6] graalvmXX-ce: remove Ruby/Python/WASM support Those additional languages does not seem to really have much usage (e.g.: none in nixpkgs). For example, Ruby is pretty much broken for all environments for quite sometime already, however nobody seemed to border enough to fix it. They also add a good amount of size to the derivation. So let's remove them. It should be really easy if someone still cares for them and want to add them back on their own system: just use the `mkGraal` function (that we export) to generate their own version of GraalVM with all extra features they want. --- .../graalvm/community-edition/default.nix | 24 +++----- .../graalvm11-ce-sources.json | 44 ++----------- .../graalvm17-ce-sources.json | 36 ++--------- .../graalvm/community-edition/mkGraal.nix | 61 +++++++++---------- .../graalvm/community-edition/update.nix | 3 +- 5 files changed, 52 insertions(+), 116 deletions(-) diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix index 6f42bfcc4539..b4448cda9c39 100644 --- a/pkgs/development/compilers/graalvm/community-edition/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/default.nix @@ -18,11 +18,9 @@ let graalvm11-ce-dev-version = "22.2.0-dev-20220401_1942"; graalvm17-ce-dev-version = "22.2.0-dev-20220401_1942"; - commonProducts = [ + products = [ "graalvm-ce" "native-image-installable-svm" - "ruby-installable-svm" - "wasm-installable-svm" ]; in @@ -32,24 +30,21 @@ in graalvm11-ce = mkGraal rec { config = { x86_64-darwin = { + inherit products; arch = "darwin-amd64"; - products = commonProducts ++ [ "python-installable-svm" ]; }; x86_64-linux = { + inherit products; arch = "linux-amd64"; - products = commonProducts ++ [ "python-installable-svm" ]; }; aarch64-darwin = { + inherit products; arch = "darwin-aarch64"; - products = [ - "graalvm-ce" - "native-image-installable-svm" - ]; version = graalvm11-ce-dev-version; }; aarch64-linux = { + inherit products; arch = "linux-aarch64"; - products = commonProducts; }; }; defaultVersion = graalvm11-ce-release-version; @@ -65,19 +60,16 @@ in graalvm17-ce = mkGraal rec { config = { x86_64-darwin = { + inherit products; arch = "darwin-amd64"; - products = commonProducts ++ [ "python-installable-svm" ]; }; x86_64-linux = { + inherit products; arch = "linux-amd64"; - products = commonProducts ++ [ "python-installable-svm" ]; }; aarch64-darwin = { + inherit products; arch = "darwin-aarch64"; - products = [ - "graalvm-ce" - "native-image-installable-svm" - ]; version = graalvm17-ce-dev-version; }; }; diff --git a/pkgs/development/compilers/graalvm/community-edition/graalvm11-ce-sources.json b/pkgs/development/compilers/graalvm/community-edition/graalvm11-ce-sources.json index 070c783d0336..e3d514d58b9d 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalvm11-ce-sources.json +++ b/pkgs/development/compilers/graalvm/community-edition/graalvm11-ce-sources.json @@ -1,12 +1,12 @@ { "darwin-aarch64": { - "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" + "graalvm-ce|java11|22.2.0-dev-20220414_2112": { + "sha256": "7d1d39a7cc2579112e745943fa5b557405b501f5c3c3fde441f9a31c7627d18d", + "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220414_2112/graalvm-ce-java11-darwin-aarch64-dev.tar.gz" }, - "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" + "native-image-installable-svm|java11|22.2.0-dev-20220414_2112": { + "sha256": "5ec82588bf493c38656ca7c31fff276342ce1cbadee41309ae7a3486f56f7ba7", + "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220414_2112/native-image-installable-svm-java11-darwin-aarch64-dev.jar" } }, "darwin-amd64": { @@ -17,18 +17,6 @@ "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": { - "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": { - "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": { - "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": { @@ -39,14 +27,6 @@ "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": { - "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": { - "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": { @@ -57,18 +37,6 @@ "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": { - "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": { - "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": { - "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" } } } diff --git a/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json b/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json index 65e28b8b11cc..861f5e454e27 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json +++ b/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json @@ -1,12 +1,12 @@ { "darwin-aarch64": { - "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" + "graalvm-ce|java17|22.2.0-dev-20220414_2112": { + "sha256": "1ae8991d95814945d33cf8758a1e7072c48660680d1d90ec5629671e25f99344", + "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220414_2112/graalvm-ce-java17-darwin-aarch64-dev.tar.gz" }, - "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" + "native-image-installable-svm|java17|22.2.0-dev-20220414_2112": { + "sha256": "8a35491ea5487e755c087072fc827d81ec37a23075dcb29850e6f6cd5ff9630f", + "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220414_2112/native-image-installable-svm-java17-darwin-aarch64-dev.jar" } }, "darwin-amd64": { @@ -17,18 +17,6 @@ "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": { - "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": { - "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": { - "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-amd64": { @@ -39,18 +27,6 @@ "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": { - "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": { - "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": { - "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" } } } diff --git a/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix b/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix index 5b20890ced1b..9758ca020671 100644 --- a/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix +++ b/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix @@ -59,6 +59,11 @@ let (writeShellScriptBin "${stdenv.system}-musl-gcc" ''${lib.getDev musl}/bin/musl-gcc "$@"'') ]); + withNativeImageSvm = builtins.any (p: p == "native-image-installable-svm") platform.products; + withRubySvm = builtins.any (p: p == "ruby-installable-svm") platform.products; + withPythonSvm = builtins.any (p: p == "python-installable-svm") platform.products; + withWasmSvm = builtins.any (p: p == "wasm-installable-svm") platform.products; + graalvmXXX-ce = stdenv.mkDerivation rec { inherit version; pname = name; @@ -69,7 +74,6 @@ let alsa-lib # libasound.so wanted by lib/libjsound.so fontconfig freetype - openssl # libssl.so wanted by languages/ruby/lib/mri/openssl.so stdenv.cc.cc.lib # libstdc++.so.6 xorg.libX11 xorg.libXext @@ -77,6 +81,8 @@ let xorg.libXrender xorg.libXtst zlib + ] ++ lib.optionals withRubySvm [ + openssl # libssl.so wanted by languages/ruby/lib/mri/openssl.so ]; nativeBuildInputs = [ unzip perl makeWrapper ] @@ -172,7 +178,7 @@ let # Workaround for libssl.so.10 wanted by TruffleRuby # Resulting TruffleRuby cannot use `openssl` library. - autoPatchelfIgnoreMissingDeps = stdenv.isDarwin; + autoPatchelfIgnoreMissingDeps = withRubySvm && stdenv.isDarwin; preFixup = lib.optionalString (stdenv.isLinux) '' # We cannot use -exec since wrapProgram is a function but not a @@ -191,10 +197,14 @@ let find "$out" -name libfontmanager.so -exec \ patchelf --add-needed libfontconfig.so {} \; - # Workaround for libssl.so.10/libcrypto.so.10 wanted by TruffleRuby - patchelf $out/languages/ruby/lib/mri/openssl.so \ - --replace-needed libssl.so.10 libssl.so \ - --replace-needed libcrypto.so.10 libcrypto.so + ${ + lib.optionalString withRubySvm '' + # Workaround for libssl.so.10/libcrypto.so.10 wanted by TruffleRuby + patchelf $out/languages/ruby/lib/mri/openssl.so \ + --replace-needed libssl.so.10 libssl.so \ + --replace-needed libcrypto.so.10 libcrypto.so + '' + } ''; # $out/bin/native-image needs zlib to build native executables. @@ -222,7 +232,7 @@ let $out/bin/java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler HelloWorld | fgrep 'Hello World' ${# --static flag doesn't work for darwin - lib.optionalString (stdenv.isLinux && !useMusl) '' + lib.optionalString (withNativeImageSvm && stdenv.isLinux && !useMusl) '' echo "Ahead-Of-Time compilation" $out/bin/native-image -H:-CheckToolchain -H:+ReportExceptionStackTraces --no-server HelloWorld ./helloworld | fgrep 'Hello World' @@ -234,49 +244,38 @@ let } ${# --static flag doesn't work for darwin - lib.optionalString (stdenv.isLinux && useMusl) '' + lib.optionalString (withNativeImageSvm && stdenv.isLinux && useMusl) '' echo "Ahead-Of-Time compilation with --static and --libc=musl" $out/bin/native-image --no-server --libc=musl --static HelloWorld ./helloworld | fgrep 'Hello World' '' } - ${# TODO: Doesn't work on MacOS, we have this error: - # "Launching JShell execution engine threw: Operation not permitted (Bind failed)" - lib.optionalString (stdenv.isLinux) '' + ${ + lib.optionalString withWasmSvm '' echo "Testing Jshell" echo '1 + 1' | $out/bin/jshell '' } ${ - lib.optionalString (builtins.any (a: a == "python-installable-svm") platform.products) '' + lib.optionalString withPythonSvm '' echo "Testing GraalPython" $out/bin/graalpython -c 'print(1 + 1)' echo '1 + 1' | $out/bin/graalpython '' } - echo "Testing TruffleRuby" ${ - lib.optionalString (builtins.any (a: a == "ruby-installable-svm") platform.products) '' - # Hide warnings about wrong locale - export LANG=C - export LC_ALL=C - $out/bin/ruby -e 'puts(1 + 1)' - '' - } - ${# FIXME: irb is broken in all platforms - # TODO: `irb` on MacOS gives an error saying "Could not find OpenSSL - # headers, install via Homebrew or MacPorts or set OPENSSL_PREFIX", even - # though `openssl` is in `propagatedBuildInputs`. For more details see: - # https://github.com/NixOS/nixpkgs/pull/105815 - # TODO: "truffleruby: an internal exception escaped out of the interpreter" - # error on linux-aarch64 - # TODO: "core/kernel.rb:234:in `gem_original_require': - # /nix/store/wlc5xalzj2ip1l83siqw8ac5fjd52ngm-graalvm11-ce/languages/llvm/native/lib: - # cannot read file data: Is a directory (RuntimeError)" error on linux-amd64 - lib.optionalString false '' + lib.optionalString withRubySvm '' + echo "Testing TruffleRuby" + # Hide warnings about wrong locale + export LANG=C + export LC_ALL=C + $out/bin/ruby -e 'puts(1 + 1)' + '' + # FIXME: irb is broken in all platforms + + lib.optionalString false '' echo '1 + 1' | $out/bin/irb '' } diff --git a/pkgs/development/compilers/graalvm/community-edition/update.nix b/pkgs/development/compilers/graalvm/community-edition/update.nix index 191f3cb45a15..6201ab100177 100644 --- a/pkgs/development/compilers/graalvm/community-edition/update.nix +++ b/pkgs/development/compilers/graalvm/community-edition/update.nix @@ -8,6 +8,7 @@ , writeShellScript , jq , gnused +, forceUpdate ? false }: /* @@ -199,7 +200,7 @@ let */ updateScriptText = newVersion: currentVersion: - if isNew newVersion currentVersion + if (forceUpdate || (isNew newVersion currentVersion)) then let versionKey = versionKeyInDefaultNix currentVersion; From 4f8562f6824e99973c67dd220617fb4517d41209 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Fri, 15 Apr 2022 20:34:09 +0100 Subject: [PATCH 3/6] nixos/doc: add note about the recent graalvmXX-ce changes --- .../manual/from_md/release-notes/rl-2205.section.xml | 11 +++++++++++ nixos/doc/manual/release-notes/rl-2205.section.md | 2 ++ 2 files changed, 13 insertions(+) diff --git a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml index 96dbfd59c83b..1521efc72aa6 100644 --- a/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml +++ b/nixos/doc/manual/from_md/release-notes/rl-2205.section.xml @@ -1393,6 +1393,17 @@ pkgs.cosmoc. + + + pkgs.graalvmXX-ce packages no longer + provide support for Python/Ruby/WASM, instead focusing only in + Java and Native Image Support. If you need to add support + back, please see the + pkgs.graalvmCEPackages.mkGraal function to + create your own customized version of GraalVM with support for + what you need. + +
diff --git a/nixos/doc/manual/release-notes/rl-2205.section.md b/nixos/doc/manual/release-notes/rl-2205.section.md index a1b0212fafc3..ef683e519c8a 100644 --- a/nixos/doc/manual/release-notes/rl-2205.section.md +++ b/nixos/doc/manual/release-notes/rl-2205.section.md @@ -479,6 +479,8 @@ In addition to numerous new and upgraded packages, this release has the followin - `pkgs.cosmopolitan` no longer provides the `cosmoc` command. It has been moved to `pkgs.cosmoc`. +- `pkgs.graalvmXX-ce` packages no longer provide support for Python/Ruby/WASM, instead focusing only in Java and Native Image Support. If you need to add support back, please see the `pkgs.graalvmCEPackages.mkGraal` function to create your own customized version of GraalVM with support for what you need. + ## Other Notable Changes {#sec-release-22.05-notable-changes} From 158b0e037f175cd3a93ed5766be8cc4d10f4b3ef Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Fri, 15 Apr 2022 20:49:29 +0100 Subject: [PATCH 4/6] graalvm17-ce: re-enable it on aarch64-linux However without support for Native Image, since it is failing to build. --- .../graalvm/community-edition/default.nix | 14 +++++++++----- .../community-edition/graalvm17-ce-sources.json | 6 ++++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix index b4448cda9c39..32b77d0f6e1e 100644 --- a/pkgs/development/compilers/graalvm/community-edition/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/default.nix @@ -52,11 +52,6 @@ in platforms = builtins.attrNames config; }; - # TODO: fix aarch64-linux, failing during Native Image compilation - # "Caused by: java.io.IOException: Cannot run program - # "/nix/store/1q1mif7h3lgxdaxg6j39hli5azikrfla-gcc-wrapper-9.3.0/bin/gcc" (in - # directory"/tmp/SVM-4194439592488143713"): error=0, Failed to exec spawn - # helper: pid: 19865, exit value: 1" graalvm17-ce = mkGraal rec { config = { x86_64-darwin = { @@ -72,6 +67,15 @@ in arch = "darwin-aarch64"; version = graalvm17-ce-dev-version; }; + aarch64-linux = { + # TODO: error with native-image-installable-svm in aarch64-linux: + # "Caused by: java.io.IOException: Cannot run program + # "/nix/store/00000000000000000000000000000000-gcc-wrapper-9.3.0/bin/gcc" (in + # directory"/tmp/SVM-0000000000000000000"): error=0, Failed to exec spawn + # helper: pid: 19865, exit value: 1" + products = [ "graalvm-ce" ]; + arch = "linux-aarch64"; + }; }; defaultVersion = graalvm17-ce-release-version; javaVersion = "17"; diff --git a/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json b/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json index 861f5e454e27..475c0feb050b 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json +++ b/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json @@ -19,6 +19,12 @@ "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" } }, + "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" + } + }, "linux-amd64": { "graalvm-ce|java17|22.0.0.2": { "sha256": "4f743e0ed3d974b7d619ca2ed6014554e8c12e5ebbb38b9bc9e820b182169bd4", From 44a44019456f9a0b9697dcae4664724ab340f700 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Fri, 15 Apr 2022 23:20:52 +0100 Subject: [PATCH 5/6] buildGraalvmNativeImage: mark as broken if Native Image is not available --- .../build-support/build-graalvm-native-image/default.nix | 2 ++ .../compilers/graalvm/community-edition/mkGraal.nix | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/build-graalvm-native-image/default.nix b/pkgs/build-support/build-graalvm-native-image/default.nix index d34f562bc537..760896706ac2 100644 --- a/pkgs/build-support/build-graalvm-native-image/default.nix +++ b/pkgs/build-support/build-graalvm-native-image/default.nix @@ -55,5 +55,7 @@ stdenv.mkDerivation (args // { platforms = graalvmDrv.meta.platforms; # default to executable name mainProgram = executable; + # need to have native-image-installable-svm available + broken = !(builtins.elem "native-image-installable-svm" graalvmDrv.products); } // meta; }) diff --git a/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix b/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix index 9758ca020671..8f4aaba44f08 100644 --- a/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix +++ b/pkgs/development/compilers/graalvm/community-edition/mkGraal.nix @@ -59,10 +59,10 @@ let (writeShellScriptBin "${stdenv.system}-musl-gcc" ''${lib.getDev musl}/bin/musl-gcc "$@"'') ]); - withNativeImageSvm = builtins.any (p: p == "native-image-installable-svm") platform.products; - withRubySvm = builtins.any (p: p == "ruby-installable-svm") platform.products; - withPythonSvm = builtins.any (p: p == "python-installable-svm") platform.products; - withWasmSvm = builtins.any (p: p == "wasm-installable-svm") platform.products; + withNativeImageSvm = builtins.elem "native-image-installable-svm" platform.products; + withRubySvm = builtins.elem "ruby-installable-svm" platform.products; + withPythonSvm = builtins.elem "python-installable-svm" platform.products; + withWasmSvm = builtins.elem "wasm-installable-svm" platform.products; graalvmXXX-ce = stdenv.mkDerivation rec { inherit version; @@ -282,6 +282,7 @@ let ''; passthru = { + inherit (platform) products; home = graalvmXXX-ce; updateScript = import ./update.nix { inherit lib writeShellScript jq sourcesFilename name config gnused defaultVersion; From bc73bc21ce933a4a9b31ff2ee64deb655498fb2d Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 16 Apr 2022 11:05:22 +0100 Subject: [PATCH 6/6] graalvm17-ce: enable Native Image in aarch64-linux Co-authored-by: tricktron --- .../graalvm/community-edition/default.nix | 7 +------ .../community-edition/graalvm17-ce-sources.json | 16 ++++++++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix index 32b77d0f6e1e..e45c89b3f1be 100644 --- a/pkgs/development/compilers/graalvm/community-edition/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/default.nix @@ -68,12 +68,7 @@ in version = graalvm17-ce-dev-version; }; aarch64-linux = { - # TODO: error with native-image-installable-svm in aarch64-linux: - # "Caused by: java.io.IOException: Cannot run program - # "/nix/store/00000000000000000000000000000000-gcc-wrapper-9.3.0/bin/gcc" (in - # directory"/tmp/SVM-0000000000000000000"): error=0, Failed to exec spawn - # helper: pid: 19865, exit value: 1" - products = [ "graalvm-ce" ]; + inherit products; arch = "linux-aarch64"; }; }; diff --git a/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json b/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json index 475c0feb050b..57fdd4c28846 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json +++ b/pkgs/development/compilers/graalvm/community-edition/graalvm17-ce-sources.json @@ -1,12 +1,12 @@ { "darwin-aarch64": { - "graalvm-ce|java17|22.2.0-dev-20220414_2112": { - "sha256": "1ae8991d95814945d33cf8758a1e7072c48660680d1d90ec5629671e25f99344", - "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220414_2112/graalvm-ce-java17-darwin-aarch64-dev.tar.gz" + "graalvm-ce|java17|22.2.0-dev-20220415_1945": { + "sha256": "1dbb0e0b9c85391ea6f1a0bd95ae252a396152d83e3a0e79cffd988144259e68", + "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220415_1945/graalvm-ce-java17-darwin-aarch64-dev.tar.gz" }, - "native-image-installable-svm|java17|22.2.0-dev-20220414_2112": { - "sha256": "8a35491ea5487e755c087072fc827d81ec37a23075dcb29850e6f6cd5ff9630f", - "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220414_2112/native-image-installable-svm-java17-darwin-aarch64-dev.jar" + "native-image-installable-svm|java17|22.2.0-dev-20220415_1945": { + "sha256": "029499c011ceb1a4560957db651805325a201488b5f0b7467f007c7385d004e2", + "url": "https://github.com/graalvm/graalvm-ce-dev-builds/releases/download/22.2.0-dev-20220415_1945/native-image-installable-svm-java17-darwin-aarch64-dev.jar" } }, "darwin-amd64": { @@ -23,6 +23,10 @@ "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" } }, "linux-amd64": {