lol

Merge pull request #216228 from thiagokokada/graalvm-ce-add-more-products

graalvmCEPackages.{js,python,wasm,ruby,llvm}-installable-svm: init at 22.3.1

authored by

Thiago Kenji Okada and committed by
GitHub
3a1c146e f28f1a1c

+472 -44
+39 -11
pkgs/development/compilers/graalvm/community-edition/buildGraalvm.nix
··· 4 4 , autoPatchelfHook 5 5 , cairo 6 6 , cups 7 + , darwin 7 8 , fontconfig 8 - , Foundation 9 9 , glib 10 10 , gtk3 11 - , gtkSupport ? stdenv.isLinux 12 11 , makeWrapper 13 12 , setJavaClassPath 14 13 , unzip 15 14 , xorg 16 15 , zlib 17 - }: 18 - { javaVersion 16 + # extra params 17 + , javaVersion 19 18 , meta ? { } 20 19 , products ? [ ] 21 - , ... } @ args: 20 + , gtkSupport ? stdenv.isLinux 21 + , ... 22 + } @ args: 22 23 23 24 let 25 + extraArgs = builtins.removeAttrs args [ 26 + "lib" 27 + "stdenv" 28 + "alsa-lib" 29 + "autoPatchelfHook" 30 + "cairo" 31 + "cups" 32 + "darwin" 33 + "fontconfig" 34 + "glib" 35 + "gtk3" 36 + "makeWrapper" 37 + "setJavaClassPath" 38 + "unzip" 39 + "xorg" 40 + "zlib" 41 + "javaVersion" 42 + "meta" 43 + "products" 44 + "gtkSupport" 45 + ]; 24 46 runtimeLibraryPath = lib.makeLibraryPath 25 47 ([ cups ] ++ lib.optionals gtkSupport [ cairo glib gtk3 ]); 26 - mapProducts = key: default: (map (p: p.${key} or default) products); 48 + mapProducts = key: default: (map (p: p.graalvmPhases.${key} or default) products); 27 49 concatProducts = key: lib.concatStringsSep "\n" (mapProducts key ""); 28 50 29 - graalvmXXX-ce = stdenv.mkDerivation (args // { 51 + graalvmXXX-ce = stdenv.mkDerivation ({ 30 52 pname = "graalvm${javaVersion}-ce"; 31 53 32 54 unpackPhase = '' ··· 71 93 ++ lib.optional stdenv.isLinux autoPatchelfHook; 72 94 73 95 propagatedBuildInputs = [ setJavaClassPath zlib ] 74 - ++ lib.optional stdenv.isDarwin Foundation; 96 + ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Foundation; 75 97 76 98 buildInputs = lib.optionals stdenv.isLinux [ 77 99 alsa-lib # libasound.so wanted by lib/libjsound.so ··· 109 131 installCheckPhase = '' 110 132 runHook preInstallCheck 111 133 134 + ${# broken in darwin 135 + lib.optionalString stdenv.isLinux '' 136 + echo "Testing Jshell" 137 + echo '1 + 1' | $out/bin/jshell 138 + ''} 139 + 112 140 echo ${ 113 141 lib.escapeShellArg '' 114 142 public class HelloWorld { ··· 136 164 }; 137 165 138 166 meta = with lib; ({ 139 - inherit platforms; 140 167 homepage = "https://www.graalvm.org/"; 141 168 description = "High-Performance Polyglot VM"; 142 169 license = with licenses; [ upl gpl2Classpath bsd3 ]; ··· 144 171 mainProgram = "java"; 145 172 maintainers = with maintainers; teams.graalvm-ce.members ++ [ ]; 146 173 } // meta); 147 - }); 148 - in graalvmXXX-ce 174 + } // extraArgs); 175 + in 176 + graalvmXXX-ce
+38 -16
pkgs/development/compilers/graalvm/community-edition/buildGraalvmProduct.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , autoPatchelfHook 4 + , graalvm-ce 4 5 , makeWrapper 5 6 , perl 6 7 , unzip 7 8 , zlib 8 - }: 9 - { product 9 + # extra params 10 + , product 10 11 , javaVersion 12 + , extraBuildInputs ? [ ] 11 13 , extraNativeBuildInputs ? [ ] 12 - , extraBuildInputs ? [ ] 14 + , graalvmPhases ? { } 13 15 , meta ? { } 14 16 , passthru ? { } 15 - , ... } @ args: 17 + , ... 18 + } @ args: 16 19 17 - stdenv.mkDerivation (args // { 20 + let 21 + extraArgs = builtins.removeAttrs args [ 22 + "lib" 23 + "stdenv" 24 + "autoPatchelfHook" 25 + "graalvm-ce" 26 + "makeWrapper" 27 + "perl" 28 + "unzip" 29 + "zlib" 30 + "product" 31 + "javaVersion" 32 + "extraBuildInputs" 33 + "extraNativeBuildInputs" 34 + "graalvmPhases" 35 + "meta" 36 + "passthru" 37 + ]; 38 + in 39 + stdenv.mkDerivation ({ 18 40 pname = "${product}-java${javaVersion}"; 19 41 20 42 nativeBuildInputs = [ perl unzip makeWrapper ] ··· 55 77 dontInstall = true; 56 78 dontBuild = true; 57 79 dontStrip = true; 58 - # installCheckPhase is going to run in GraalVM main derivation (see buildGraalvm.nix) 59 - # to make sure that it has everything it needs to run correctly. 60 - # Other hooks like fixupPhase/installPhase are also going to run there for the 61 - # same reason. 62 - doInstallCheck = false; 63 80 64 - passthru = { inherit product; } // passthru; 81 + passthru = { 82 + inherit product javaVersion; 83 + # build phases that are going to run during GraalVM derivation build, 84 + # since they depend in having the fully setup GraalVM environment 85 + # e.g.: graalvmPhases.installCheckPhase will run the checks only after 86 + # GraalVM+products is build 87 + # see buildGraalvm.nix file for the available phases 88 + inherit graalvmPhases; 89 + } // passthru; 65 90 66 91 meta = with lib; ({ 67 - homepage = "https://www.graalvm.org/"; 92 + inherit (graalvm-ce.meta) homepage license sourceProvenance maintainers platforms; 68 93 description = "High-Performance Polyglot VM (Product: ${product})"; 69 - license = with licenses; [ upl gpl2Classpath bsd3 ]; 70 - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; 71 - maintainers = with maintainers; teams.graalvm-ce.members ++ [ ]; 72 94 } // meta); 73 - }) 95 + } // extraArgs)
+90 -4
pkgs/development/compilers/graalvm/community-edition/default.nix
··· 2 2 , stdenv 3 3 , callPackage 4 4 , fetchurl 5 - , Foundation 6 5 }: 7 6 8 7 let 9 - buildGraalvm = callPackage ./buildGraalvm.nix { inherit Foundation; }; 10 - buildGraalvmProduct = callPackage ./buildGraalvmProduct.nix { }; 8 + buildGraalvm = callPackage ./buildGraalvm.nix; 9 + buildGraalvmProduct = callPackage ./buildGraalvmProduct.nix; 11 10 javaPlatform = { 12 11 "aarch64-linux" = "linux-aarch64"; 13 12 "x86_64-linux" = "linux-amd64"; ··· 16 15 }; 17 16 javaPlatformVersion = javaVersion: 18 17 "${javaVersion}-${javaPlatform.${stdenv.system} or (throw "Unsupported platform: ${stdenv.system}")}"; 19 - source = product: javaVersion: (import ./hashes.nix).${product}.${javaPlatformVersion javaVersion}; 18 + source = product: javaVersion: (import ./hashes.nix).${product}.${javaPlatformVersion javaVersion} 19 + or (throw "Unsupported product combination: product=${product} java=${javaVersion} system=${stdenv.system}"); 20 20 21 21 in 22 22 rec { ··· 30 30 products = [ native-image-installable-svm-java11 ]; 31 31 }; 32 32 33 + # Mostly available for testing, not to be exposed at the top level 34 + graalvm11-ce-full = graalvm11-ce.override { 35 + products = [ 36 + js-installable-svm-java11 37 + llvm-installable-svm-java11 38 + native-image-installable-svm-java11 39 + python-installable-svm-java11 40 + ruby-installable-svm-java11 41 + wasm-installable-svm-java11 42 + ]; 43 + }; 44 + 45 + js-installable-svm-java11 = callPackage ./js-installable-svm.nix rec { 46 + javaVersion = "11"; 47 + version = "22.3.1"; 48 + src = fetchurl (source "js-installable-svm" javaVersion); 49 + }; 50 + 51 + llvm-installable-svm-java11 = callPackage ./llvm-installable-svm.nix rec { 52 + javaVersion = "11"; 53 + version = "22.3.1"; 54 + src = fetchurl (source "llvm-installable-svm" javaVersion); 55 + }; 56 + 33 57 native-image-installable-svm-java11 = callPackage ./native-image-installable-svm.nix rec { 34 58 javaVersion = "11"; 35 59 version = "22.3.1"; 36 60 src = fetchurl (source "native-image-installable-svm" javaVersion); 37 61 }; 38 62 63 + python-installable-svm-java11 = callPackage ./python-installable-svm.nix rec { 64 + javaVersion = "11"; 65 + version = "22.3.1"; 66 + src = fetchurl (source "python-installable-svm" javaVersion); 67 + }; 68 + 69 + ruby-installable-svm-java11 = callPackage ./ruby-installable-svm.nix rec { 70 + javaVersion = "11"; 71 + version = "22.3.1"; 72 + src = fetchurl (source "ruby-installable-svm" javaVersion); 73 + llvm-installable-svm = llvm-installable-svm-java11; 74 + }; 75 + 76 + wasm-installable-svm-java11 = callPackage ./wasm-installable-svm.nix rec { 77 + javaVersion = "11"; 78 + version = "22.3.1"; 79 + src = fetchurl (source "wasm-installable-svm" javaVersion); 80 + }; 81 + 39 82 graalvm17-ce = buildGraalvm rec { 40 83 version = "22.3.1"; 41 84 javaVersion = "17"; ··· 44 87 products = [ native-image-installable-svm-java17 ]; 45 88 }; 46 89 90 + # Mostly available for testing, not to be exposed at the top level 91 + graalvm17-ce-full = graalvm17-ce.override { 92 + products = [ 93 + js-installable-svm-java17 94 + llvm-installable-svm-java17 95 + native-image-installable-svm-java17 96 + python-installable-svm-java17 97 + ruby-installable-svm-java17 98 + wasm-installable-svm-java17 99 + ]; 100 + }; 101 + 102 + js-installable-svm-java17 = callPackage ./js-installable-svm.nix rec { 103 + javaVersion = "17"; 104 + version = "22.3.1"; 105 + src = fetchurl (source "js-installable-svm" javaVersion); 106 + }; 107 + 108 + llvm-installable-svm-java17 = callPackage ./llvm-installable-svm.nix rec { 109 + javaVersion = "17"; 110 + version = "22.3.1"; 111 + src = fetchurl (source "llvm-installable-svm" javaVersion); 112 + }; 113 + 47 114 native-image-installable-svm-java17 = callPackage ./native-image-installable-svm.nix rec { 48 115 javaVersion = "17"; 49 116 version = "22.3.1"; 50 117 src = fetchurl (source "native-image-installable-svm" javaVersion); 118 + }; 119 + 120 + python-installable-svm-java17 = callPackage ./python-installable-svm.nix rec { 121 + javaVersion = "17"; 122 + version = "22.3.1"; 123 + src = fetchurl (source "python-installable-svm" javaVersion); 124 + }; 125 + 126 + ruby-installable-svm-java17 = callPackage ./ruby-installable-svm.nix rec { 127 + javaVersion = "17"; 128 + version = "22.3.1"; 129 + src = fetchurl (source "ruby-installable-svm" javaVersion); 130 + llvm-installable-svm = llvm-installable-svm-java17; 131 + }; 132 + 133 + wasm-installable-svm-java17 = callPackage ./wasm-installable-svm.nix rec { 134 + javaVersion = "17"; 135 + version = "22.3.1"; 136 + src = fetchurl (source "wasm-installable-svm" javaVersion); 51 137 }; 52 138 }
+162
pkgs/development/compilers/graalvm/community-edition/hashes.nix
··· 1 1 # Generated by pkgs/development/compilers/graalvm/community-edition/update.sh script 2 2 { 3 + "llvm-installable-svm" = { 4 + "11-linux-aarch64" = { 5 + sha256 = "0h8xkvsixcwak5dymkj3jgjv11w3ivnd6d45v5pdbymd0m2ifia8"; 6 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/llvm-installable-svm-java11-linux-aarch64-22.3.1.jar"; 7 + }; 8 + "17-linux-aarch64" = { 9 + sha256 = "1zww45z7m3mvzg47fwc3jgqz3hkra220isf4ih8sv6kjg1jc4y14"; 10 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/llvm-installable-svm-java17-linux-aarch64-22.3.1.jar"; 11 + }; 12 + "11-linux-amd64" = { 13 + sha256 = "133m9vg9rlp2xkndh3d6b8ybq8vwch99rj1b50xr6bz8r6306ara"; 14 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/llvm-installable-svm-java11-linux-amd64-22.3.1.jar"; 15 + }; 16 + "17-linux-amd64" = { 17 + sha256 = "0nz09idp8wawm3yinsplzvxhld8yav06l1nqj02gxrc1kxd5nsr1"; 18 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/llvm-installable-svm-java17-linux-amd64-22.3.1.jar"; 19 + }; 20 + "11-darwin-aarch64" = { 21 + sha256 = "0ngcm3ara7g1xz4kh515igpyrjhr1k5z9nf4vsaw4lpa5sqljv7z"; 22 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/llvm-installable-svm-java11-darwin-aarch64-22.3.1.jar"; 23 + }; 24 + "17-darwin-aarch64" = { 25 + sha256 = "1lr8kk82c3l9hx7wc5hqmpqfgvpk72xg1h07b6cgibry1bm6baj6"; 26 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/llvm-installable-svm-java17-darwin-aarch64-22.3.1.jar"; 27 + }; 28 + "11-darwin-amd64" = { 29 + sha256 = "058pzrd90xx4yi7mm2fvs2npqcdkb2nzhqfwfz5v202038igi61g"; 30 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/llvm-installable-svm-java11-darwin-amd64-22.3.1.jar"; 31 + }; 32 + "17-darwin-amd64" = { 33 + sha256 = "10rfz8ddq82zpf6cy2y0gx1bx0zhjzm3gwwdb1j7mll0hvwp84sg"; 34 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/llvm-installable-svm-java17-darwin-amd64-22.3.1.jar"; 35 + }; 36 + }; 37 + "wasm-installable-svm" = { 38 + "11-linux-aarch64" = { 39 + sha256 = "1d67jm41psypkhpy77cb2l00smhni3pgkybwx79z7dzcyid7p2l1"; 40 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/wasm-installable-svm-java11-linux-aarch64-22.3.1.jar"; 41 + }; 42 + "17-linux-aarch64" = { 43 + sha256 = "1cg9zxyjirfl0afr9cppg2h17j8qdidi4llbal2g5w1p2v9zq78b"; 44 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/wasm-installable-svm-java17-linux-aarch64-22.3.1.jar"; 45 + }; 46 + "11-linux-amd64" = { 47 + sha256 = "19v7jqhvijmzzb0i9q6hbvrmqnmmzbyvai3il9f357qvv6r6lylb"; 48 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/wasm-installable-svm-java11-linux-amd64-22.3.1.jar"; 49 + }; 50 + "17-linux-amd64" = { 51 + sha256 = "0sfnsy0r4qf7ni9mh437dad1d8sidajcra2azsmy5qdmh091zhj5"; 52 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/wasm-installable-svm-java17-linux-amd64-22.3.1.jar"; 53 + }; 54 + "11-darwin-amd64" = { 55 + sha256 = "0764d97mla5cii4iyvyb43v62dk8ff3plqjmdc69qqxx8mdzpwqv"; 56 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/wasm-installable-svm-java11-darwin-amd64-22.3.1.jar"; 57 + }; 58 + "17-darwin-amd64" = { 59 + sha256 = "1ip6ybm7p28bs2lifxqhq6fyvfm3wmacv6dqziyl2v7v7yl0iw4i"; 60 + url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/wasm-installable-svm-java17-darwin-amd64-22.3.1.jar"; 61 + }; 62 + }; 63 + "js-installable-svm" = { 64 + "11-linux-aarch64" = { 65 + sha256 = "1b8vnjjsa548c6j3dycxp57i9xmyvndiz2xhv7fm10izcplyspxq"; 66 + url = "https://github.com/graalvm/graaljs/releases/download/vm-22.3.1/js-installable-svm-java11-linux-aarch64-22.3.1.jar"; 67 + }; 68 + "17-linux-aarch64" = { 69 + sha256 = "1kcy3mjk908zs7f3k95awp6294cwr06hand4cbw1lsnfvp0qwhk7"; 70 + url = "https://github.com/graalvm/graaljs/releases/download/vm-22.3.1/js-installable-svm-java17-linux-aarch64-22.3.1.jar"; 71 + }; 72 + "11-linux-amd64" = { 73 + sha256 = "0sq80a4nnvik560whgv5vwlsszi8z02idvpd92p0caf03bra9x2b"; 74 + url = "https://github.com/graalvm/graaljs/releases/download/vm-22.3.1/js-installable-svm-java11-linux-amd64-22.3.1.jar"; 75 + }; 76 + "17-linux-amd64" = { 77 + sha256 = "0fd160yxsi09m97z7vqh5kwf1g0p0hn4niy48glj9jhirfqzzw0c"; 78 + url = "https://github.com/graalvm/graaljs/releases/download/vm-22.3.1/js-installable-svm-java17-linux-amd64-22.3.1.jar"; 79 + }; 80 + "11-darwin-aarch64" = { 81 + sha256 = "18g0xixzk45yrxv3zfs7qrdyj0b3ksp59jhbcis0vwy9gx8094wq"; 82 + url = "https://github.com/graalvm/graaljs/releases/download/vm-22.3.1/js-installable-svm-java11-darwin-aarch64-22.3.1.jar"; 83 + }; 84 + "17-darwin-aarch64" = { 85 + sha256 = "0cf4iivkniilvbqyniqxcz1qf49cs4lxi0axjsk9sz1zmxcq0bnk"; 86 + url = "https://github.com/graalvm/graaljs/releases/download/vm-22.3.1/js-installable-svm-java17-darwin-aarch64-22.3.1.jar"; 87 + }; 88 + "11-darwin-amd64" = { 89 + sha256 = "0ibcz6ivx068ndf45j9pghm8qwq287glqxf0xx08kjxnhms67p52"; 90 + url = "https://github.com/graalvm/graaljs/releases/download/vm-22.3.1/js-installable-svm-java11-darwin-amd64-22.3.1.jar"; 91 + }; 92 + "17-darwin-amd64" = { 93 + sha256 = "16q7whnvdrk8lb4fp96qr3p567kggyk9q5iqcn081qk8xjkbx0zv"; 94 + url = "https://github.com/graalvm/graaljs/releases/download/vm-22.3.1/js-installable-svm-java17-darwin-amd64-22.3.1.jar"; 95 + }; 96 + }; 97 + "python-installable-svm" = { 98 + "11-linux-aarch64" = { 99 + sha256 = "1yl36x5svld7qnm3m6vmacm2n4d6l9vhdxhaypvlv2bbfbnym3c5"; 100 + url = "https://github.com/graalvm/graalpython/releases/download/vm-22.3.1/python-installable-svm-java11-linux-aarch64-22.3.1.jar"; 101 + }; 102 + "17-linux-aarch64" = { 103 + sha256 = "0ggx5rwz3qnnxgz407r8yx12556pcbirhnc44972l77r320rdmqc"; 104 + url = "https://github.com/graalvm/graalpython/releases/download/vm-22.3.1/python-installable-svm-java17-linux-aarch64-22.3.1.jar"; 105 + }; 106 + "11-linux-amd64" = { 107 + sha256 = "11c19a20v3ff83dxzs9hf1z89kh0qich41b03gx8mancf12jfwnl"; 108 + url = "https://github.com/graalvm/graalpython/releases/download/vm-22.3.1/python-installable-svm-java11-linux-amd64-22.3.1.jar"; 109 + }; 110 + "17-linux-amd64" = { 111 + sha256 = "0pga44whhvm98d8j2v2bpl9rkbvr9bv947rc4imlbf01cyxjwl71"; 112 + url = "https://github.com/graalvm/graalpython/releases/download/vm-22.3.1/python-installable-svm-java17-linux-amd64-22.3.1.jar"; 113 + }; 114 + "11-darwin-aarch64" = { 115 + sha256 = "0qnh8i9nazrv25jhn13wp7qqm9wwhcz4kpp2ygvsdmf9s3d2f5lf"; 116 + url = "https://github.com/graalvm/graalpython/releases/download/vm-22.3.1/python-installable-svm-java11-darwin-aarch64-22.3.1.jar"; 117 + }; 118 + "17-darwin-aarch64" = { 119 + sha256 = "0j13xvy9d19glipz4wdma2y02g0cnksg1iij4247fjhpqh0axkdz"; 120 + url = "https://github.com/graalvm/graalpython/releases/download/vm-22.3.1/python-installable-svm-java17-darwin-aarch64-22.3.1.jar"; 121 + }; 122 + "11-darwin-amd64" = { 123 + sha256 = "1ny5664h7pibvskmm51mlxrxkbbj2dvxsv2yqbq6v51a57wm1yzn"; 124 + url = "https://github.com/graalvm/graalpython/releases/download/vm-22.3.1/python-installable-svm-java11-darwin-amd64-22.3.1.jar"; 125 + }; 126 + "17-darwin-amd64" = { 127 + sha256 = "01jjncx8jm1yrps2nj217vgcmjaqclmpb27rdp3qn7k64w5wzipg"; 128 + url = "https://github.com/graalvm/graalpython/releases/download/vm-22.3.1/python-installable-svm-java17-darwin-amd64-22.3.1.jar"; 129 + }; 130 + }; 3 131 "native-image-installable-svm" = { 4 132 "11-linux-aarch64" = { 5 133 sha256 = "0z9rbmci6yz7f7mqd3xzsxc5ih4hq72lyzqfchan7fr6mh38d6gw"; ··· 66 194 "17-darwin-amd64" = { 67 195 sha256 = "02lclv2j3v850izh84wdvksi3d3xmgpfl7x85vzifhgsvagm6sz4"; 68 196 url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.3.1/graalvm-ce-java17-darwin-amd64-22.3.1.tar.gz"; 197 + }; 198 + }; 199 + "ruby-installable-svm" = { 200 + "11-linux-aarch64" = { 201 + sha256 = "10wm1sq7smywy63mzlsbn21kzd65yaqj8yismpq8bz19h9skas7w"; 202 + url = "https://github.com/oracle/truffleruby/releases/download/vm-22.3.1/ruby-installable-svm-java11-linux-aarch64-22.3.1.jar"; 203 + }; 204 + "17-linux-aarch64" = { 205 + sha256 = "0kh1w49yp3kpfvhqw19bbx51ay1wgzq80gsrfqax4zm5ixz4wsbz"; 206 + url = "https://github.com/oracle/truffleruby/releases/download/vm-22.3.1/ruby-installable-svm-java17-linux-aarch64-22.3.1.jar"; 207 + }; 208 + "11-linux-amd64" = { 209 + sha256 = "0avsawgfkqbgqc2hm8zmz37qg9ag3ddni3my8g73kvzfkghsdabh"; 210 + url = "https://github.com/oracle/truffleruby/releases/download/vm-22.3.1/ruby-installable-svm-java11-linux-amd64-22.3.1.jar"; 211 + }; 212 + "17-linux-amd64" = { 213 + sha256 = "1ib00pqdhzl24y97j16mm86qwrijqjnmhjmk3g5vdhyhh099vjp1"; 214 + url = "https://github.com/oracle/truffleruby/releases/download/vm-22.3.1/ruby-installable-svm-java17-linux-amd64-22.3.1.jar"; 215 + }; 216 + "11-darwin-aarch64" = { 217 + sha256 = "1im75qad89xa2nbl80csnwn56k6n11zv5g91xlkqq4xk300v1saj"; 218 + url = "https://github.com/oracle/truffleruby/releases/download/vm-22.3.1/ruby-installable-svm-java11-darwin-aarch64-22.3.1.jar"; 219 + }; 220 + "17-darwin-aarch64" = { 221 + sha256 = "1pfzsisf4sgzxmk3r1p4apzqkwipjpf8naly3v94i5v3b5gbnczx"; 222 + url = "https://github.com/oracle/truffleruby/releases/download/vm-22.3.1/ruby-installable-svm-java17-darwin-aarch64-22.3.1.jar"; 223 + }; 224 + "11-darwin-amd64" = { 225 + sha256 = "1jfls71y92hw09s869v2qw8pypgl1fciqz3m9zcd2602hikysq6c"; 226 + url = "https://github.com/oracle/truffleruby/releases/download/vm-22.3.1/ruby-installable-svm-java11-darwin-amd64-22.3.1.jar"; 227 + }; 228 + "17-darwin-amd64" = { 229 + sha256 = "03x2h4sw72l05xxg73xj9mzzkxffbjpv8hdi59rgxxljnz0ai6rx"; 230 + url = "https://github.com/oracle/truffleruby/releases/download/vm-22.3.1/ruby-installable-svm-java17-darwin-amd64-22.3.1.jar"; 69 231 }; 70 232 }; 71 233 }
+18
pkgs/development/compilers/graalvm/community-edition/js-installable-svm.nix
··· 1 + { lib 2 + , stdenv 3 + , graalvm-ce 4 + , graalvmCEPackages 5 + , javaVersion 6 + , src 7 + , version 8 + }: 9 + 10 + graalvmCEPackages.buildGraalvmProduct rec { 11 + inherit src javaVersion version; 12 + product = "js-installable-svm"; 13 + 14 + graalvmPhases.installCheckPhase = '' 15 + echo "Testing GraalJS" 16 + echo '1 + 1' | $out/bin/js 17 + ''; 18 + }
+22
pkgs/development/compilers/graalvm/community-edition/llvm-installable-svm.nix
··· 1 + { lib 2 + , stdenv 3 + , graalvmCEPackages 4 + , javaVersion 5 + , src 6 + , version 7 + }: 8 + 9 + graalvmCEPackages.buildGraalvmProduct rec { 10 + inherit src javaVersion version; 11 + product = "llvm-installable-svm"; 12 + 13 + postUnpack = '' 14 + ln -s $out/languages/llvm/native/lib/*.so $out/lib 15 + ''; 16 + 17 + # TODO: improve this test 18 + graalvmPhases.installCheckPhase = '' 19 + echo "Testing llvm" 20 + $out/bin/lli --help 21 + ''; 22 + }
+6 -4
pkgs/development/compilers/graalvm/community-edition/native-image-installable-svm.nix
··· 27 27 inherit src javaVersion version; 28 28 product = "native-image-installable-svm"; 29 29 30 - postInstall = lib.optionalString stdenv.isLinux '' 30 + graalvmPhases.postInstall = lib.optionalString stdenv.isLinux '' 31 31 wrapProgram $out/bin/native-image \ 32 32 --prefix PATH : ${binPath} \ 33 33 ${lib.concatStringsSep " " 34 34 (map (l: "--add-flags '-H:CLibraryPath=${l}/lib'") cLibs)} 35 35 ''; 36 36 37 - installCheckPhase = '' 37 + graalvmPhases.installCheckPhase = '' 38 38 echo "Ahead-Of-Time compilation" 39 39 $out/bin/native-image -H:-CheckToolchain -H:+ReportExceptionStackTraces HelloWorld 40 40 ./helloworld | fgrep 'Hello World' 41 41 42 - ${lib.optionalString (stdenv.isLinux && !useMusl) '' 42 + ${# --static is only available in Linux 43 + lib.optionalString (stdenv.isLinux && !useMusl) '' 43 44 echo "Ahead-Of-Time compilation with -H:+StaticExecutableWithDynamicLibC" 44 45 $out/bin/native-image -H:+StaticExecutableWithDynamicLibC HelloWorld 45 46 ./helloworld | fgrep 'Hello World' ··· 49 50 ./helloworld | fgrep 'Hello World' 50 51 ''} 51 52 52 - ${lib.optionalString (stdenv.isLinux && useMusl) '' 53 + ${# --static is only available in Linux 54 + lib.optionalString (stdenv.isLinux && useMusl) '' 53 55 echo "Ahead-Of-Time compilation with --static and --libc=musl" 54 56 $out/bin/native-image --static HelloWorld --libc=musl 55 57 ./helloworld | fgrep 'Hello World'
+18
pkgs/development/compilers/graalvm/community-edition/python-installable-svm.nix
··· 1 + { lib 2 + , stdenv 3 + , graalvmCEPackages 4 + , javaVersion 5 + , src 6 + , version 7 + }: 8 + 9 + graalvmCEPackages.buildGraalvmProduct rec { 10 + inherit src javaVersion version; 11 + product = "python-installable-svm"; 12 + 13 + graalvmPhases.installCheckPhase = '' 14 + echo "Testing GraalPython" 15 + $out/bin/graalpy -c 'print(1 + 1)' 16 + echo '1 + 1' | $out/bin/graalpy 17 + ''; 18 + }
+38
pkgs/development/compilers/graalvm/community-edition/ruby-installable-svm.nix
··· 1 + { lib 2 + , stdenv 3 + , graalvmCEPackages 4 + , openssl 5 + , javaVersion 6 + , musl 7 + , src 8 + , version 9 + , llvm-installable-svm 10 + }: 11 + 12 + graalvmCEPackages.buildGraalvmProduct rec { 13 + inherit src javaVersion version; 14 + product = "ruby-installable-svm"; 15 + 16 + extraBuildInputs = [ 17 + llvm-installable-svm 18 + openssl 19 + ]; 20 + 21 + preFixup = lib.optionalString stdenv.isLinux '' 22 + patchelf $out/languages/ruby/lib/mri/openssl.so \ 23 + --replace-needed libssl.so.10 libssl.so \ 24 + --replace-needed libcrypto.so.10 libcrypto.so 25 + ''; 26 + 27 + graalvmPhases.installCheckPhase = '' 28 + echo "Testing TruffleRuby" 29 + # Fixup/silence warnings about wrong locale 30 + export LANG=C 31 + export LC_ALL=C 32 + $out/bin/ruby -e 'puts(1 + 1)' 33 + ${# broken in darwin with sandbox enabled 34 + lib.optionalString stdenv.isLinux '' 35 + echo '1 + 1' | $out/bin/irb 36 + ''} 37 + ''; 38 + }
+18 -6
pkgs/development/compilers/graalvm/community-edition/update.sh
··· 14 14 [ "$1" = "$(echo -e "$1\n$2" | sort -V | head -n1)" ] 15 15 } 16 16 17 + readonly hashes_nix="hashes.nix" 17 18 readonly nixpkgs=../../../../.. 18 19 19 - readonly current_version="$(nix-instantiate "$nixpkgs" --eval --strict -A graalvm-ce.version | tr -d \")" 20 + readonly current_version="$(nix-instantiate "$nixpkgs" --eval --strict -A graalvm-ce.version --json | jq -r)" 20 21 21 22 if [[ -z "${1:-}" ]]; then 22 23 readonly gh_version="$(curl \ ··· 39 40 40 41 declare -r -A products_urls=( 41 42 [graalvm-ce]="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${new_version}/graalvm-ce-java@platform@-${new_version}.tar.gz" 43 + [js-installable-svm]="https://github.com/graalvm/graaljs/releases/download/vm-${new_version}/js-installable-svm-java@platform@-${new_version}.jar" 44 + [llvm-installable-svm]="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${new_version}/llvm-installable-svm-java@platform@-${new_version}.jar" 42 45 [native-image-installable-svm]="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${new_version}/native-image-installable-svm-java@platform@-${new_version}.jar" 43 - # [ruby-installable-svm]="https://github.com/oracle/truffleruby/releases/download/vm-${new_version}/ruby-installable-svm-java@platform@-${new_version}.jar" 44 - # [wasm-installable-svm]="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${new_version}/wasm-installable-svm-java@platform@-${new_version}.jar" 45 - # [python-installable-svm]="https://github.com/graalvm/graalpython/releases/download/vm-${new_version}/python-installable-svm-java@platform@-${new_version}.jar" 46 + [python-installable-svm]="https://github.com/graalvm/graalpython/releases/download/vm-${new_version}/python-installable-svm-java@platform@-${new_version}.jar" 47 + [ruby-installable-svm]="https://github.com/oracle/truffleruby/releases/download/vm-${new_version}/ruby-installable-svm-java@platform@-${new_version}.jar" 48 + [wasm-installable-svm]="https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${new_version}/wasm-installable-svm-java@platform@-${new_version}.jar" 46 49 ) 47 50 48 51 readonly platforms=( ··· 65 68 url="${products_urls["${product}"]}" 66 69 echo_file " \"$product\" = {" 67 70 for platform in "${platforms[@]}"; do 68 - if hash="$(nix-prefetch-url "${url//@platform@/$platform}")"; then 71 + # Reuse cache as long the version is the same 72 + if [[ "$current_version" == "$new_version" ]]; then 73 + previous_hash="$(nix-instantiate --eval "$hashes_nix" -A "$product.$platform.sha256" --json | jq -r || true)" 74 + else 75 + previous_hash="" 76 + fi 77 + # Lack of quoting in $previous_hash is proposital 78 + if hash="$(nix-prefetch-url "${url//@platform@/$platform}" $previous_hash)"; then 69 79 echo_file " \"$platform\" = {" 70 80 echo_file " sha256 = \"$hash\";" 71 81 echo_file " url = \"${url//@platform@/${platform}}\";" 72 82 echo_file " };" 83 + else 84 + info "Error while downloading '$product' for '$platform'. Skipping it..." 73 85 fi 74 86 done 75 87 echo_file " };" ··· 81 93 sed "s|$current_version|$new_version|" -i default.nix 82 94 83 95 info "Moving the temporary file to hashes.nix" 84 - mv "$tmpfile" hashes.nix 96 + mv "$tmpfile" "$hashes_nix" 85 97 86 98 info "Done!"
+22
pkgs/development/compilers/graalvm/community-edition/wasm-installable-svm.nix
··· 1 + { lib 2 + , stdenv 3 + , graalvm-ce 4 + , graalvmCEPackages 5 + , javaVersion 6 + , src 7 + , version 8 + }: 9 + 10 + graalvmCEPackages.buildGraalvmProduct rec { 11 + inherit src javaVersion version; 12 + product = "wasm-installable-svm"; 13 + 14 + # TODO: improve this test 15 + graalvmPhases.installCheckPhase = '' 16 + echo "Testing wasm" 17 + $out/bin/wasm --help 18 + ''; 19 + 20 + # Not supported in aarch64-darwin yet as GraalVM 22.3.1 release 21 + meta.platforms = builtins.filter (p: p != "aarch64-darwin") graalvm-ce.meta.platforms; 22 + }
+1 -3
pkgs/top-level/all-packages.nix
··· 15017 15017 openjdk_headless = jdk_headless; 15018 15018 15019 15019 graalvmCEPackages = 15020 - recurseIntoAttrs (callPackage ../development/compilers/graalvm/community-edition { 15021 - inherit (darwin.apple_sdk.frameworks) Foundation; 15022 - }); 15020 + recurseIntoAttrs (callPackage ../development/compilers/graalvm/community-edition { }); 15023 15021 graalvm-ce = graalvm11-ce; 15024 15022 graalvm11-ce = graalvmCEPackages.graalvm11-ce; 15025 15023 graalvm17-ce = graalvmCEPackages.graalvm17-ce;