comparison mx/mx_graal.py @ 17437:d65ca887868d

mx igv: make a copy of env and fix minor cygwin path issue
author Bernhard Urban <bernhard.urban@jku.at>
date Tue, 14 Oct 2014 17:33:51 +0200
parents 6d82c240d83e
children b8d89559915d
comparison
equal deleted inserted replaced
17436:b0e8bc17af1b 17437:d65ca887868d
1605 1605
1606 dacapo(['100', 'eclipse', '-esa']) 1606 dacapo(['100', 'eclipse', '-esa'])
1607 1607
1608 def _igvFallbackJDK(env): 1608 def _igvFallbackJDK(env):
1609 if mx._java_homes[0].version == mx.VersionSpec("1.8.0_20"): 1609 if mx._java_homes[0].version == mx.VersionSpec("1.8.0_20"):
1610 env = dict(env)
1610 fallbackJDK = mx._java_homes[1] 1611 fallbackJDK = mx._java_homes[1]
1611 mx.logv("1.8.0_20 has a known javac bug (JDK-8043926), thus falling back to " + str(fallbackJDK.version)) 1612 mx.logv("1.8.0_20 has a known javac bug (JDK-8043926), thus falling back to " + str(fallbackJDK.version))
1612 env['JAVA_HOME'] = str(fallbackJDK.jdk) 1613 env['JAVA_HOME'] = str(fallbackJDK.jdk)
1613 return env 1614 return env
1614 1615
1615 def igv(args): 1616 def igv(args):
1616 """run the Ideal Graph Visualizer""" 1617 """run the Ideal Graph Visualizer"""
1617 with open(join(_graal_home, '.ideal_graph_visualizer.log'), 'w') as fp: 1618 with open(join(_graal_home, '.ideal_graph_visualizer.log'), 'w') as fp:
1618 # When the http_proxy environment variable is set, convert it to the proxy settings that ant needs 1619 # When the http_proxy environment variable is set, convert it to the proxy settings that ant needs
1619 env = os.environ 1620 env = dict(os.environ)
1620 proxy = os.environ.get('http_proxy') 1621 proxy = os.environ.get('http_proxy')
1621 if not (proxy is None) and len(proxy) > 0: 1622 if not (proxy is None) and len(proxy) > 0:
1622 if '://' in proxy: 1623 if '://' in proxy:
1623 # Remove the http:// prefix (or any other protocol prefix) 1624 # Remove the http:// prefix (or any other protocol prefix)
1624 proxy = proxy.split('://', 1)[1] 1625 proxy = proxy.split('://', 1)[1]
1625 # Separate proxy server name and port number 1626 # Separate proxy server name and port number
1626 proxyName, proxyPort = proxy.split(':', 1) 1627 proxyName, proxyPort = proxy.split(':', 1)
1627 proxyEnv = '-DproxyHost="' + proxyName + '" -DproxyPort=' + proxyPort 1628 proxyEnv = '-DproxyHost="' + proxyName + '" -DproxyPort=' + proxyPort
1628 env['ANT_OPTS'] = proxyEnv 1629 env['ANT_OPTS'] = proxyEnv
1629 _igvFallbackJDK(env) 1630 env = _igvFallbackJDK(env)
1630 1631
1631 mx.logv('[Ideal Graph Visualizer log is in ' + fp.name + ']') 1632 mx.logv('[Ideal Graph Visualizer log is in ' + fp.name + ']')
1632 nbplatform = join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'nbplatform') 1633 nbplatform = join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'nbplatform')
1633 1634
1634 # Remove NetBeans platform if it is earlier than the current supported version 1635 # Remove NetBeans platform if it is earlier than the current supported version
1642 elif supportedVersion < currentVersion: 1643 elif supportedVersion < currentVersion:
1643 mx.log('Supported NetBeans version in igv command should be updated to ' + str(currentVersion)) 1644 mx.log('Supported NetBeans version in igv command should be updated to ' + str(currentVersion))
1644 1645
1645 if not exists(nbplatform): 1646 if not exists(nbplatform):
1646 mx.logv('[This execution may take a while as the NetBeans platform needs to be downloaded]') 1647 mx.logv('[This execution may take a while as the NetBeans platform needs to be downloaded]')
1647 mx.run(['ant', '-f', join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml'), '-l', fp.name, 'run'], env=env) 1648 mx.run(['ant', '-f', mx._cygpathU2W(join(_graal_home, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml')), '-l', mx._cygpathU2W(fp.name), 'run'], env=env)
1648 1649
1649 def maven_install_truffle(args): 1650 def maven_install_truffle(args):
1650 """install Truffle into your local Maven repository""" 1651 """install Truffle into your local Maven repository"""
1651 for name in ['TRUFFLE', 'TRUFFLE-DSL-PROCESSOR']: 1652 for name in ['TRUFFLE', 'TRUFFLE-DSL-PROCESSOR']:
1652 mx.archive(["@" + name]) 1653 mx.archive(["@" + name])