graalvmCEPackages.buildGraalvmProduct: add passthru.graalvmPhases
This way it is easier to differentiate between phases running in the `buildGraalvmProduct` and `buildGraalvm`.
This commit is contained in:
parent
140046c422
commit
acf8579307
@ -23,10 +23,10 @@
|
||||
let
|
||||
runtimeLibraryPath = lib.makeLibraryPath
|
||||
([ cups ] ++ lib.optionals gtkSupport [ cairo glib gtk3 ]);
|
||||
mapProducts = key: default: (map (p: p.${key} or default) products);
|
||||
mapProducts = key: default: (map (p: p.graalvmPhases.${key} or default) products);
|
||||
concatProducts = key: lib.concatStringsSep "\n" (mapProducts key "");
|
||||
|
||||
graalvmXXX-ce = stdenv.mkDerivation (args // {
|
||||
graalvmXXX-ce = stdenv.mkDerivation ({
|
||||
pname = "graalvm${javaVersion}-ce";
|
||||
|
||||
unpackPhase = ''
|
||||
@ -146,5 +146,5 @@ let
|
||||
mainProgram = "java";
|
||||
maintainers = with maintainers; teams.graalvm-ce.members ++ [ ];
|
||||
} // meta);
|
||||
});
|
||||
} // (builtins.removeAttrs args [ "javaVersion" "meta" "products" ]));
|
||||
in graalvmXXX-ce
|
||||
|
@ -9,13 +9,14 @@
|
||||
}:
|
||||
{ product
|
||||
, javaVersion
|
||||
, extraNativeBuildInputs ? [ ]
|
||||
, extraBuildInputs ? [ ]
|
||||
, extraNativeBuildInputs ? [ ]
|
||||
, graalvmPhases ? { }
|
||||
, meta ? { }
|
||||
, passthru ? { }
|
||||
, ... } @ args:
|
||||
|
||||
stdenv.mkDerivation (args // {
|
||||
stdenv.mkDerivation ({
|
||||
pname = "${product}-java${javaVersion}";
|
||||
|
||||
nativeBuildInputs = [ perl unzip makeWrapper ]
|
||||
@ -56,16 +57,27 @@ stdenv.mkDerivation (args // {
|
||||
dontInstall = true;
|
||||
dontBuild = true;
|
||||
dontStrip = true;
|
||||
# installCheckPhase is going to run in GraalVM main derivation (see buildGraalvm.nix)
|
||||
# to make sure that it has everything it needs to run correctly.
|
||||
# Other hooks like fixupPhase/installPhase are also going to run there for the
|
||||
# same reason.
|
||||
doInstallCheck = false;
|
||||
|
||||
passthru = { inherit product; } // passthru;
|
||||
passthru = {
|
||||
inherit product javaVersion;
|
||||
# build phases that are going to run during GraalVM derivation build,
|
||||
# since they depend in having the fully setup GraalVM environment
|
||||
# e.g.: graalvmPhases.installCheckPhase will run the checks only after
|
||||
# GraalVM+products is build
|
||||
# see buildGraalvm.nix file for the available phases
|
||||
inherit graalvmPhases;
|
||||
} // passthru;
|
||||
|
||||
meta = with lib; ({
|
||||
inherit (graalvm-ce.meta) homepage license sourceProvenance maintainers platforms;
|
||||
description = "High-Performance Polyglot VM (Product: ${product})";
|
||||
} // meta);
|
||||
})
|
||||
} // (builtins.removeAttrs args [
|
||||
"product"
|
||||
"javaVersion"
|
||||
"extraBuildInputs"
|
||||
"extraNativeBuildInputs"
|
||||
"graalvmPhases"
|
||||
"meta"
|
||||
"passthru"
|
||||
]))
|
||||
|
@ -15,7 +15,7 @@ graalvmCEPackages.buildGraalvmProduct rec {
|
||||
'';
|
||||
|
||||
# TODO: improve this test
|
||||
installCheckPhase = ''
|
||||
graalvmPhases.installCheckPhase = ''
|
||||
echo "Testing llvm"
|
||||
$out/bin/lli --help
|
||||
'';
|
||||
|
@ -27,14 +27,14 @@ graalvmCEPackages.buildGraalvmProduct rec {
|
||||
inherit src javaVersion version;
|
||||
product = "native-image-installable-svm";
|
||||
|
||||
postInstall = lib.optionalString stdenv.isLinux ''
|
||||
graalvmPhases.postInstall = lib.optionalString stdenv.isLinux ''
|
||||
wrapProgram $out/bin/native-image \
|
||||
--prefix PATH : ${binPath} \
|
||||
${lib.concatStringsSep " "
|
||||
(map (l: "--add-flags '-H:CLibraryPath=${l}/lib'") cLibs)}
|
||||
'';
|
||||
|
||||
installCheckPhase = ''
|
||||
graalvmPhases.installCheckPhase = ''
|
||||
echo "Ahead-Of-Time compilation"
|
||||
$out/bin/native-image -H:-CheckToolchain -H:+ReportExceptionStackTraces HelloWorld
|
||||
./helloworld | fgrep 'Hello World'
|
||||
|
@ -10,7 +10,7 @@ graalvmCEPackages.buildGraalvmProduct rec {
|
||||
inherit src javaVersion version;
|
||||
product = "python-installable-svm";
|
||||
|
||||
installCheckPhase = ''
|
||||
graalvmPhases.installCheckPhase = ''
|
||||
echo "Testing GraalPython"
|
||||
$out/bin/graalpy -c 'print(1 + 1)'
|
||||
echo '1 + 1' | $out/bin/graalpy
|
||||
|
@ -24,7 +24,7 @@ graalvmCEPackages.buildGraalvmProduct rec {
|
||||
--replace-needed libcrypto.so.10 libcrypto.so
|
||||
'';
|
||||
|
||||
installCheckPhase = ''
|
||||
graalvmPhases.installCheckPhase = ''
|
||||
echo "Testing TruffleRuby"
|
||||
# Hide warnings about wrong locale
|
||||
export LANG=C
|
||||
|
@ -12,7 +12,7 @@ graalvmCEPackages.buildGraalvmProduct rec {
|
||||
product = "wasm-installable-svm";
|
||||
|
||||
# TODO: improve this test
|
||||
installCheckPhase = ''
|
||||
graalvmPhases.installCheckPhase = ''
|
||||
echo "Testing wasm"
|
||||
$out/bin/wasm --help
|
||||
'';
|
||||
|
Loading…
Reference in New Issue
Block a user