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
|
let
|
||||||
runtimeLibraryPath = lib.makeLibraryPath
|
runtimeLibraryPath = lib.makeLibraryPath
|
||||||
([ cups ] ++ lib.optionals gtkSupport [ cairo glib gtk3 ]);
|
([ 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 "");
|
concatProducts = key: lib.concatStringsSep "\n" (mapProducts key "");
|
||||||
|
|
||||||
graalvmXXX-ce = stdenv.mkDerivation (args // {
|
graalvmXXX-ce = stdenv.mkDerivation ({
|
||||||
pname = "graalvm${javaVersion}-ce";
|
pname = "graalvm${javaVersion}-ce";
|
||||||
|
|
||||||
unpackPhase = ''
|
unpackPhase = ''
|
||||||
@ -146,5 +146,5 @@ let
|
|||||||
mainProgram = "java";
|
mainProgram = "java";
|
||||||
maintainers = with maintainers; teams.graalvm-ce.members ++ [ ];
|
maintainers = with maintainers; teams.graalvm-ce.members ++ [ ];
|
||||||
} // meta);
|
} // meta);
|
||||||
});
|
} // (builtins.removeAttrs args [ "javaVersion" "meta" "products" ]));
|
||||||
in graalvmXXX-ce
|
in graalvmXXX-ce
|
||||||
|
@ -9,13 +9,14 @@
|
|||||||
}:
|
}:
|
||||||
{ product
|
{ product
|
||||||
, javaVersion
|
, javaVersion
|
||||||
, extraNativeBuildInputs ? [ ]
|
|
||||||
, extraBuildInputs ? [ ]
|
, extraBuildInputs ? [ ]
|
||||||
|
, extraNativeBuildInputs ? [ ]
|
||||||
|
, graalvmPhases ? { }
|
||||||
, meta ? { }
|
, meta ? { }
|
||||||
, passthru ? { }
|
, passthru ? { }
|
||||||
, ... } @ args:
|
, ... } @ args:
|
||||||
|
|
||||||
stdenv.mkDerivation (args // {
|
stdenv.mkDerivation ({
|
||||||
pname = "${product}-java${javaVersion}";
|
pname = "${product}-java${javaVersion}";
|
||||||
|
|
||||||
nativeBuildInputs = [ perl unzip makeWrapper ]
|
nativeBuildInputs = [ perl unzip makeWrapper ]
|
||||||
@ -56,16 +57,27 @@ stdenv.mkDerivation (args // {
|
|||||||
dontInstall = true;
|
dontInstall = true;
|
||||||
dontBuild = true;
|
dontBuild = true;
|
||||||
dontStrip = 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; ({
|
meta = with lib; ({
|
||||||
inherit (graalvm-ce.meta) homepage license sourceProvenance maintainers platforms;
|
inherit (graalvm-ce.meta) homepage license sourceProvenance maintainers platforms;
|
||||||
description = "High-Performance Polyglot VM (Product: ${product})";
|
description = "High-Performance Polyglot VM (Product: ${product})";
|
||||||
} // meta);
|
} // meta);
|
||||||
})
|
} // (builtins.removeAttrs args [
|
||||||
|
"product"
|
||||||
|
"javaVersion"
|
||||||
|
"extraBuildInputs"
|
||||||
|
"extraNativeBuildInputs"
|
||||||
|
"graalvmPhases"
|
||||||
|
"meta"
|
||||||
|
"passthru"
|
||||||
|
]))
|
||||||
|
@ -15,7 +15,7 @@ graalvmCEPackages.buildGraalvmProduct rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
# TODO: improve this test
|
# TODO: improve this test
|
||||||
installCheckPhase = ''
|
graalvmPhases.installCheckPhase = ''
|
||||||
echo "Testing llvm"
|
echo "Testing llvm"
|
||||||
$out/bin/lli --help
|
$out/bin/lli --help
|
||||||
'';
|
'';
|
||||||
|
@ -27,14 +27,14 @@ graalvmCEPackages.buildGraalvmProduct rec {
|
|||||||
inherit src javaVersion version;
|
inherit src javaVersion version;
|
||||||
product = "native-image-installable-svm";
|
product = "native-image-installable-svm";
|
||||||
|
|
||||||
postInstall = lib.optionalString stdenv.isLinux ''
|
graalvmPhases.postInstall = lib.optionalString stdenv.isLinux ''
|
||||||
wrapProgram $out/bin/native-image \
|
wrapProgram $out/bin/native-image \
|
||||||
--prefix PATH : ${binPath} \
|
--prefix PATH : ${binPath} \
|
||||||
${lib.concatStringsSep " "
|
${lib.concatStringsSep " "
|
||||||
(map (l: "--add-flags '-H:CLibraryPath=${l}/lib'") cLibs)}
|
(map (l: "--add-flags '-H:CLibraryPath=${l}/lib'") cLibs)}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installCheckPhase = ''
|
graalvmPhases.installCheckPhase = ''
|
||||||
echo "Ahead-Of-Time compilation"
|
echo "Ahead-Of-Time compilation"
|
||||||
$out/bin/native-image -H:-CheckToolchain -H:+ReportExceptionStackTraces HelloWorld
|
$out/bin/native-image -H:-CheckToolchain -H:+ReportExceptionStackTraces HelloWorld
|
||||||
./helloworld | fgrep 'Hello World'
|
./helloworld | fgrep 'Hello World'
|
||||||
|
@ -10,7 +10,7 @@ graalvmCEPackages.buildGraalvmProduct rec {
|
|||||||
inherit src javaVersion version;
|
inherit src javaVersion version;
|
||||||
product = "python-installable-svm";
|
product = "python-installable-svm";
|
||||||
|
|
||||||
installCheckPhase = ''
|
graalvmPhases.installCheckPhase = ''
|
||||||
echo "Testing GraalPython"
|
echo "Testing GraalPython"
|
||||||
$out/bin/graalpy -c 'print(1 + 1)'
|
$out/bin/graalpy -c 'print(1 + 1)'
|
||||||
echo '1 + 1' | $out/bin/graalpy
|
echo '1 + 1' | $out/bin/graalpy
|
||||||
|
@ -24,7 +24,7 @@ graalvmCEPackages.buildGraalvmProduct rec {
|
|||||||
--replace-needed libcrypto.so.10 libcrypto.so
|
--replace-needed libcrypto.so.10 libcrypto.so
|
||||||
'';
|
'';
|
||||||
|
|
||||||
installCheckPhase = ''
|
graalvmPhases.installCheckPhase = ''
|
||||||
echo "Testing TruffleRuby"
|
echo "Testing TruffleRuby"
|
||||||
# Hide warnings about wrong locale
|
# Hide warnings about wrong locale
|
||||||
export LANG=C
|
export LANG=C
|
||||||
|
@ -12,7 +12,7 @@ graalvmCEPackages.buildGraalvmProduct rec {
|
|||||||
product = "wasm-installable-svm";
|
product = "wasm-installable-svm";
|
||||||
|
|
||||||
# TODO: improve this test
|
# TODO: improve this test
|
||||||
installCheckPhase = ''
|
graalvmPhases.installCheckPhase = ''
|
||||||
echo "Testing wasm"
|
echo "Testing wasm"
|
||||||
$out/bin/wasm --help
|
$out/bin/wasm --help
|
||||||
'';
|
'';
|
||||||
|
Loading…
Reference in New Issue
Block a user