comparison mx/mx_graal.py @ 18887:19d99eec8876

Fix mx igv: do not use Java < 1.8, handle the case where no JDKs are supported. Give some hints when the igv ant build fails.
author Gilles Duboscq <gilles.m.duboscq@oracle.com>
date Wed, 21 Jan 2015 11:43:22 +0100
parents c446d00f2cdf
children 31960077ea9d
comparison
equal deleted inserted replaced
18886:9afe8fbe088c 18887:19d99eec8876
1631 deoptalot(['15', '-Xmx48m']) 1631 deoptalot(['15', '-Xmx48m'])
1632 1632
1633 dacapo(['100', 'eclipse', '-esa']) 1633 dacapo(['100', 'eclipse', '-esa'])
1634 1634
1635 def _igvFallbackJDK(env): 1635 def _igvFallbackJDK(env):
1636 igvHomes = [h for h in mx._java_homes if h.version < mx.VersionSpec("1.8.0_20") or h.version >= mx.VersionSpec("1.8.0_40")] 1636 v8u20 = mx.VersionSpec("1.8.0_20")
1637 if igvHomes[0] != mx._java_homes[0]: 1637 v8u40 = mx.VersionSpec("1.8.0_40")
1638 v8 = mx.VersionSpec("1.8")
1639 igvHomes = [h for h in mx._java_homes if h.version >= v8 and (h.version < v8u20 or h.version >= v8u40)]
1640 defaultJava = mx.java()
1641 if defaultJava not in igvHomes:
1642 if not igvHomes:
1643 mx.abort("No JDK available for building IGV. Must have JDK >= 1.8 and < 1.8.0u20 or >= 1.8.0u40 in JAVA_HOME or EXTRA_JAVA_HOMES")
1638 env = dict(env) 1644 env = dict(env)
1639 fallbackJDK = igvHomes[0] 1645 fallbackJDK = igvHomes[0]
1640 mx.logv("1.8.0_20 has a known javac bug (JDK-8043926), thus falling back to " + str(fallbackJDK.version)) 1646 mx.logv("1.8.0_20 has a known javac bug (JDK-8043926), thus falling back to " + str(fallbackJDK.version))
1641 env['JAVA_HOME'] = str(fallbackJDK.jdk) 1647 env['JAVA_HOME'] = str(fallbackJDK.jdk)
1642 return env 1648 return env
1643 1649
1644 def igv(args): 1650 def igv(args):
1645 """run the Ideal Graph Visualizer""" 1651 """run the Ideal Graph Visualizer"""
1646 with open(join(_graal_home, '.ideal_graph_visualizer.log'), 'w') as fp: 1652 logFile = '.ideal_graph_visualizer.log'
1653 with open(join(_graal_home, logFile), 'w') as fp:
1647 # When the http_proxy environment variable is set, convert it to the proxy settings that ant needs 1654 # When the http_proxy environment variable is set, convert it to the proxy settings that ant needs
1648 env = dict(os.environ) 1655 env = dict(os.environ)
1649 proxy = os.environ.get('http_proxy') 1656 proxy = os.environ.get('http_proxy')
1650 if not (proxy is None) and len(proxy) > 0: 1657 if not (proxy is None) and len(proxy) > 0:
1651 if '://' in proxy: 1658 if '://' in proxy:
1671 elif supportedVersion < currentVersion: 1678 elif supportedVersion < currentVersion:
1672 mx.log('Supported NetBeans version in igv command should be updated to ' + str(currentVersion)) 1679 mx.log('Supported NetBeans version in igv command should be updated to ' + str(currentVersion))
1673 1680
1674 if not exists(nbplatform): 1681 if not exists(nbplatform):
1675 mx.logv('[This execution may take a while as the NetBeans platform needs to be downloaded]') 1682 mx.logv('[This execution may take a while as the NetBeans platform needs to be downloaded]')
1676 mx.run(['ant', '-f', mx._cygpathU2W(join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml')), '-l', mx._cygpathU2W(fp.name), 'run'], env=env) 1683 if mx.run(['ant', '-f', mx._cygpathU2W(join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml')), '-l', mx._cygpathU2W(fp.name), 'run'], env=env, nonZeroIsFatal=False):
1684 mx.abort("IGV ant build & launch failed. Check '" + logFile + "'. You can also try to delete 'src/share/tools/IdealGraphVisualizer/nbplatform'.")
1677 1685
1678 def maven_install_truffle(args): 1686 def maven_install_truffle(args):
1679 """install Truffle into your local Maven repository""" 1687 """install Truffle into your local Maven repository"""
1680 for name in ['TRUFFLE', 'TRUFFLE-DSL-PROCESSOR']: 1688 for name in ['TRUFFLE', 'TRUFFLE-DSL-PROCESSOR']:
1681 mx.archive(["@" + name]) 1689 mx.archive(["@" + name])