comparison mx/mx_truffle.py @ 21955:aab974a50deb

Removing --installed-jdks option
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 17 Jun 2015 11:17:40 +0200
parents a518c4f74ca4
children 4e3e8d522120
comparison
equal deleted inserted replaced
21954:a518c4f74ca4 21955:aab974a50deb
71 It can also be temporarily set by using of a VM context manager object in a 'with' statement. """ 71 It can also be temporarily set by using of a VM context manager object in a 'with' statement. """
72 _vmbuild = _vmbuildChoices[0] 72 _vmbuild = _vmbuildChoices[0]
73 73
74 """ The current working directory to switch to before running the VM. """ 74 """ The current working directory to switch to before running the VM. """
75 _vm_cwd = None 75 _vm_cwd = None
76
77 """ The base directory in which the JDKs cloned from $JAVA_HOME exist. """
78 _installed_jdks = None
79 76
80 """ Prefix for running the VM. """ 77 """ Prefix for running the VM. """
81 _vm_prefix = None 78 _vm_prefix = None
82 79
83 _make_eclipse_launch = False 80 _make_eclipse_launch = False
196 elif os.path.isfile(name): 193 elif os.path.isfile(name):
197 os.unlink(name) 194 os.unlink(name)
198 195
199 rmIfExists(join(_graal_home, 'build')) 196 rmIfExists(join(_graal_home, 'build'))
200 rmIfExists(join(_graal_home, 'build-nojvmci')) 197 rmIfExists(join(_graal_home, 'build-nojvmci'))
201 # rmIfExists(_jdksDir())
202 198
203 def export(args): 199 def export(args):
204 """create archives of builds split by vmbuild and vm""" 200 """create archives of builds split by vmbuild and vm"""
205 201
206 parser = ArgumentParser(prog='mx export') 202 parser = ArgumentParser(prog='mx export')
395 if mxos == "windows" or mxos == "cygwin": 391 if mxos == "windows" or mxos == "cygwin":
396 return join(jdk, 'jre', 'lib', mx.get_arch(), jvmCfgFile) 392 return join(jdk, 'jre', 'lib', mx.get_arch(), jvmCfgFile)
397 return join(_vmLibDirInJdk(jdk), jvmCfgFile) 393 return join(_vmLibDirInJdk(jdk), jvmCfgFile)
398 394
399 def _jdksDir(): 395 def _jdksDir():
400 return os.path.abspath(join(_installed_jdks if _installed_jdks else _graal_home, 'jdk' + str(mx.java().version))) 396 return os.path.abspath(join(_graal_home, 'jdk' + str(mx.java().version)))
401 397
402 def _handle_missing_VM(bld, vm=None): 398 def _handle_missing_VM(bld, vm=None):
403 if not vm: 399 if not vm:
404 vm = _get_vm() 400 vm = _get_vm()
405 mx.log('The ' + bld + ' ' + vm + ' VM has not been created') 401 mx.log('The ' + bld + ' ' + vm + ' VM has not been created')
485 hsdis([], copyToDir=_vmLibDirInJdk(jdk)) 481 hsdis([], copyToDir=_vmLibDirInJdk(jdk))
486 except SystemExit: 482 except SystemExit:
487 pass 483 pass
488 else: 484 else:
489 if not exists(jdk): 485 if not exists(jdk):
490 if _installed_jdks:
491 mx.log("The selected JDK directory does not (yet) exist: " + jdk)
492 _handle_missing_VM(build, vmToCheck) 486 _handle_missing_VM(build, vmToCheck)
493 487
494 if installJars: 488 if installJars:
495 for jdkDist in _jdkDeployedDists: 489 for jdkDist in _jdkDeployedDists:
496 dist = mx.distribution(jdkDist.name) 490 dist = mx.distribution(jdkDist.name)
865 str(_vmbuildChoices) + ')') 859 str(_vmbuildChoices) + ')')
866 860
867 if vm is None: 861 if vm is None:
868 vm = _get_vm() 862 vm = _get_vm()
869 863
870 if _installed_jdks and _installed_jdks != _graal_home:
871 if not mx.ask_yes_no("Warning: building while --installed-jdks is set (" + _installed_jdks + ") is not recommanded - are you sure you want to continue", 'n'):
872 mx.abort(1)
873
874 def vmg(args): 864 def vmg(args):
875 """run the debug build of VM selected by the '--vm' option""" 865 """run the debug build of VM selected by the '--vm' option"""
876 return vm(args, vmbuild='debug') 866 return vm(args, vmbuild='debug')
877 867
878 def vmfg(args): 868 def vmfg(args):
2230 'jol' : [jol, ''], 2220 'jol' : [jol, ''],
2231 'makefile' : [mx_graal_makefile.build_makefile, 'build makefiles for JDK build'], 2221 'makefile' : [mx_graal_makefile.build_makefile, 'build makefiles for JDK build'],
2232 } 2222 }
2233 2223
2234 mx.add_argument('--vmcwd', dest='vm_cwd', help='current directory will be changed to <path> before the VM is executed', default=None, metavar='<path>') 2224 mx.add_argument('--vmcwd', dest='vm_cwd', help='current directory will be changed to <path> before the VM is executed', default=None, metavar='<path>')
2235 mx.add_argument('--installed-jdks', help='the base directory in which the JDKs cloned from $JAVA_HOME exist. ' +
2236 'The VM selected by --vm and --vmbuild options is under this directory (i.e., ' +
2237 join('<path>', '<jdk-version>', '<vmbuild>', 'jre', 'lib', '<vm>', mx.add_lib_prefix(mx.add_lib_suffix('jvm'))) + ')', default=None, metavar='<path>')
2238 2225
2239 if _vmSourcesAvailable: 2226 if _vmSourcesAvailable:
2240 mx.add_argument('--vm', action='store', dest='vm', choices=_vmChoices.keys(), help='the VM type to build/run') 2227 mx.add_argument('--vm', action='store', dest='vm', choices=_vmChoices.keys(), help='the VM type to build/run')
2241 mx.add_argument('--vmbuild', action='store', dest='vmbuild', choices=_vmbuildChoices, help='the VM build to build/run (default: ' + _vmbuildChoices[0] + ')') 2228 mx.add_argument('--vmbuild', action='store', dest='vmbuild', choices=_vmbuildChoices, help='the VM build to build/run (default: ' + _vmbuildChoices[0] + ')')
2242 mx.add_argument('--ecl', action='store_true', dest='make_eclipse_launch', help='create launch configuration for running VM execution(s) in Eclipse') 2229 mx.add_argument('--ecl', action='store_true', dest='make_eclipse_launch', help='create launch configuration for running VM execution(s) in Eclipse')
2267 _vmbuild = opts.vmbuild 2254 _vmbuild = opts.vmbuild
2268 global _make_eclipse_launch 2255 global _make_eclipse_launch
2269 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) 2256 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False)
2270 global _vm_cwd 2257 global _vm_cwd
2271 _vm_cwd = opts.vm_cwd 2258 _vm_cwd = opts.vm_cwd
2272 global _installed_jdks
2273 _installed_jdks = opts.installed_jdks
2274 global _vm_prefix 2259 global _vm_prefix
2275 _vm_prefix = opts.vm_prefix 2260 _vm_prefix = opts.vm_prefix
2276 2261
2277 for jdkDist in _jdkDeployedDists: 2262 for jdkDist in _jdkDeployedDists:
2278 def _close(jdkDeployable): 2263 def _close(jdkDeployable):