graalvm 1.0.0-rc8 fixes

This commit is contained in:
volth 2018-11-04 03:27:58 +00:00 committed by Tim Steinbach
parent df8817087e
commit 7bd773832c

View file

@ -11,7 +11,6 @@ let
install -D ${fetchurl { inherit url sha1; }} $out/${name}
echo -n ${sha1} > $out/${name}.sha1
'') list}
find $out -exec touch -c -m -r '{}' --date="1980-01-01" '{}' \;
'';
};
@ -51,6 +50,9 @@ let
rec { sha1 = "280c265b789e041c02e5c97815793dfc283fb1e6"; name = "LIBFFI_${sha1}/libffi.tar.gz"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/libffi-3.2.1.tar.gz; }
rec { sha1 = "8819cea8bfe22c9c63f55465e296b3855ea41786"; name = "TruffleJSON_${sha1}/trufflejson.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/trufflejson-20180130.jar; }
rec { sha1 = "9712a8124c40298015f04a74f61b3d81a51513af"; name = "CHECKSTYLE_8.8_${sha1}/checkstyle-8.8.jar"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/checkstyle-8.8-all.jar; }
rec { sha1 = "a828a4f32caf9ac0b74f2548f87310959558c526"; name = "VISUALVM_COMMON_${sha1}/visualvm-common.tar.gz"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/visualvm-612.tar.gz; }
rec { sha1 = "7ac829f0c9a37f5cc39afd2265588a365480720d"; name = "VISUALVM_PLATFORM_SPECIFIC_${sha1}/visualvm-platform-specific.tar.gz"; url = https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/visualvm-612-linux-amd64.tar.gz; }
rec { sha1 = "e6e60889b7211a80b21052a249bd7e0f88f79fee"; name = "Java-WebSocket_${sha1}/java-websocket.jar"; url = mirror://maven/org/java-websocket/Java-WebSocket/1.3.9/Java-WebSocket-1.3.9.jar; }
];
findbugs = fetchzip {
@ -80,6 +82,11 @@ in rec {
'def download(path, urls, verbose=False, abortOnError=True, verifyOnly=False):
print("FAKE download(path={} urls={} verbose={} abortOnError={} verifyOnly={})".format(path, urls, verbose, abortOnError, verifyOnly))
return True'
# avoid crash with 'ValueError: ZIP does not support timestamps before 1980'
substituteInPlace mx.py --replace \
'zipfile.ZipInfo(arcname, time.localtime(os.path.getmtime(join(root, f)))[:6])' \
'zipfile.ZipInfo(arcname, time.strptime ("1 Jan 1980", "%d %b %Y" )[:6])'
'';
installPhase = ''
mkdir -p $out/bin
@ -87,7 +94,6 @@ in rec {
wrapProgram $out/bin/mx \
--prefix PATH : ${lib.makeBinPath [ python27 mercurial ]} \
--set FINDBUGS_HOME ${findbugs}
find $out -exec touch -c -m -r '{}' --date="1980-01-01" '{}' \;
'';
meta = with stdenv.lib; {
homepage = https://github.com/graalvm/mx;
@ -101,7 +107,7 @@ in rec {
jvmci8 = stdenv.mkDerivation rec {
version = "0.49";
name = let
n = "jvmci8u191-${version}";
n = "jvmci${/*"8u191"*/ lib.removePrefix "oraclejdk-" oraclejdk8.name}-${version}";
in if (lib.stringLength n) == (lib.stringLength oraclejdk8.name) then
n
else
@ -134,7 +140,6 @@ in rec {
export MX_ALT_OUTPUT_ROOT=$NIX_BUILD_TOP/mxbuild
export MX_CACHE_DIR=${makeMxCache jvmci8-mxcache}
find $NIX_BUILD_TOP -exec touch -c -m -r '{}' --date="1980-01-01" '{}' \;
mx --java-home $(pwd)/writable-copy-of-jdk build
'';
installPhase = ''
@ -173,6 +178,12 @@ in rec {
hg checkout ${lib.escapeShellArg src.rev}
)
'';
postPatch = ''
substituteInPlace substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/headers/PosixDirectives.java \
--replace '<zlib.h>' '<${zlib.dev}/include/zlib.h>'
substituteInPlace substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/CCLinkerInvocation.java \
--replace 'cmd.add("-v");' 'cmd.add("-v"); cmd.add("-L${zlib}/lib");'
'';
buildPhase = ''
# make a copy of jvmci8
cp -dpR ${jvmci8} $out
@ -188,7 +199,7 @@ in rec {
mx --java-home $out build
# bootstrap native-image (that was removed from mx build in https://github.com/oracle/graal/commit/140d7a7edf54ec5872a8ff45869cd1ae499efde4)
mx --java-home $out native-image -cp $MX_ALT_OUTPUT_ROOT/substratevm/dists/svm-driver.jar com.oracle.svm.driver.NativeImage
mx --java-home $out native-image -cp $MX_ALT_OUTPUT_ROOT/substratevm/dists/jdk1.8/svm-driver.jar com.oracle.svm.driver.NativeImage
)
( cd tools
mx --java-home $out build
@ -199,17 +210,17 @@ in rec {
mkdir -p $out/jre/tools/{profiler,chromeinspector,truffle/builder} $out/jre/lib/{graal,include,truffle/include}
cp -vpLR substratevm/svmbuild/native-image-root/lib/* $out/jre/lib/ || true # ignore "same file" error when dereferencing symlinks
cp -vp $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/bin/* $out/jre/lib/amd64/
cp -vp $MX_ALT_OUTPUT_ROOT/compiler/dists/graal-*processor*.jar $out/jre/lib/graal/
cp -vp $MX_ALT_OUTPUT_ROOT/compiler/dists/jdk1.8/graal-*processor*.jar $out/jre/lib/graal/
cp -vp $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/include/* $out/jre/lib/include/
cp -vp $MX_ALT_OUTPUT_ROOT/compiler/dists/graal-management.jar $out/jre/lib/jvmci/
cp -vp $MX_ALT_OUTPUT_ROOT/compiler/dists/jdk1.8/graal-management.jar $out/jre/lib/jvmci/
cp -vdpR $out/jre/lib/svm/clibraries $out/jre/lib/svm/builder/
cp -vpR $MX_ALT_OUTPUT_ROOT/truffle/dists/* $out/jre/lib/truffle/
cp -vpR $MX_ALT_OUTPUT_ROOT/truffle/dists/jdk1.8/* $out/jre/lib/truffle/
cp -vp $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/include/* $out/jre/lib/truffle/include/
cp -vpLR substratevm/svmbuild/native-image-root/tools/* $out/jre/tools/
cp -vpR $MX_ALT_OUTPUT_ROOT/tools/dists/chromeinspector* $out/jre/tools/chromeinspector/
cp -vpR $MX_ALT_OUTPUT_ROOT/tools/dists/truffle-profiler* $out/jre/tools/profiler/
cp -vpR $MX_ALT_OUTPUT_ROOT/truffle/linux-amd64/truffle-nfi-native/* $out/jre/tools/truffle/
cp -vp $MX_ALT_OUTPUT_ROOT/truffle/dists/truffle-nfi.jar $out/jre/tools/truffle/builder/
cp -vp $MX_ALT_OUTPUT_ROOT/truffle/dists/jdk1.8/truffle-nfi.jar $out/jre/tools/truffle/builder/
echo "name=GraalVM ${version}" > $out/jre/lib/amd64/server/vm.properties
echo -n "graal" > $out/jre/lib/jvmci/compiler-name