diff mx/mx_graal.py @ 17388:9e5abd0e7916

mx/igv: fallback mechanism to work around a javac bug in jdk8u20
author Bernhard Urban <bernhard.urban@jku.at>
date Thu, 09 Oct 2014 14:51:39 +0200
parents d42e11af980d
children 9c241dc74cfc
line wrap: on
line diff
--- a/mx/mx_graal.py	Thu Oct 09 13:19:31 2014 +0200
+++ b/mx/mx_graal.py	Thu Oct 09 14:51:39 2014 +0200
@@ -1452,8 +1452,9 @@
     _jacoco = 'off'
 
     t = Task('CleanAndBuildIdealGraphVisualizer')
+    env = _igvFallbackJDK(os.environ)
     buildxml = mx._cygpathU2W(join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml'))
-    mx.run(['ant', '-f', buildxml, '-q', 'clean', 'build'])
+    mx.run(['ant', '-f', buildxml, '-q', 'clean', 'build'], env=env)
     tasks.append(t.stop())
 
     # Prevent Graal modifications from breaking the standard builds
@@ -1599,6 +1600,13 @@
 
     dacapo(['100', 'eclipse', '-esa'])
 
+def _igvFallbackJDK(env):
+    if mx._java_homes[0].version == mx.VersionSpec("1.8.0_20"):
+        fallbackJDK = mx._java_homes[1]
+        mx.logv("1.8.0_20 has a known javac bug (JDK-8043926), thus falling back to " + str(fallbackJDK.version))
+        env['JAVA_HOME'] = str(fallbackJDK.jdk)
+    return env
+
 def igv(args):
     """run the Ideal Graph Visualizer"""
     with open(join(_graal_home, '.ideal_graph_visualizer.log'), 'w') as fp:
@@ -1613,6 +1621,7 @@
             proxyName, proxyPort = proxy.split(':', 1)
             proxyEnv = '-DproxyHost="' + proxyName + '" -DproxyPort=' + proxyPort
             env['ANT_OPTS'] = proxyEnv
+        _igvFallbackJDK(env)
 
         mx.logv('[Ideal Graph Visualizer log is in ' + fp.name + ']')
         nbplatform = join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'nbplatform')