Mercurial > hg > graal-jvmci-8
comparison mx/mx_graal.py @ 21741:b6ee5d3f3255
Exclude distributions from exporting which are delivered with HotSpot (JBS:GRAAL-52)
author | Stefan Anzinger <stefan.anzinger@oracle.com> |
---|---|
date | Fri, 05 Jun 2015 13:04:40 +0200 |
parents | 6c3c21d9b5ef |
children | c1610658bba0 894f82515e38 |
comparison
equal
deleted
inserted
replaced
21740:6c3c21d9b5ef | 21741:b6ee5d3f3255 |
---|---|
493 _handle_missing_VM(build, vmToCheck) | 493 _handle_missing_VM(build, vmToCheck) |
494 | 494 |
495 if installJars: | 495 if installJars: |
496 for jdkDist in _jdkDeployedDists: | 496 for jdkDist in _jdkDeployedDists: |
497 dist = mx.distribution(jdkDist.name) | 497 dist = mx.distribution(jdkDist.name) |
498 if exists(dist.path): | 498 if exists(dist.path) and jdkDist.partOfHotSpot: |
499 _installDistInJdks(jdkDist) | 499 _installDistInJdks(jdkDist) |
500 | 500 |
501 if vmToCheck is not None: | 501 if vmToCheck is not None: |
502 jvmCfg = _vmCfgInJdk(jdk) | 502 jvmCfg = _vmCfgInJdk(jdk) |
503 found = False | 503 found = False |
664 | 664 |
665 def _installDistInJdks(deployableDist): | 665 def _installDistInJdks(deployableDist): |
666 """ | 666 """ |
667 Installs the jar(s) for a given Distribution into all existing JVMCI JDKs | 667 Installs the jar(s) for a given Distribution into all existing JVMCI JDKs |
668 """ | 668 """ |
669 | |
670 dist = mx.distribution(deployableDist.name) | 669 dist = mx.distribution(deployableDist.name) |
671 if dist.name == 'GRAAL': | 670 if dist.name == 'GRAAL': |
672 _patchGraalVersionConstant(dist) | 671 _patchGraalVersionConstant(dist) |
673 | 672 |
674 jdks = _jdksDir() | 673 jdks = _jdksDir() |
837 def build(args, vm=None): | 836 def build(args, vm=None): |
838 """build the VM binary | 837 """build the VM binary |
839 | 838 |
840 The global '--vm' and '--vmbuild' options select which VM type and build target to build.""" | 839 The global '--vm' and '--vmbuild' options select which VM type and build target to build.""" |
841 | 840 |
841 # Turn all jdk distributions into non HotSpot; this is only necessary as long we support building/exporting JVMCI with make and mx | |
842 if not ("-m" in args or "--use-make" in args): | |
843 for jdkDist in _jdkDeployedDists: | |
844 if jdkDist.partOfHotSpot: | |
845 jdkDist.partOfHotSpot = False | |
846 | |
842 # Override to fail quickly if extra arguments are given | 847 # Override to fail quickly if extra arguments are given |
843 # at the end of the command line. This allows for a more | 848 # at the end of the command line. This allows for a more |
844 # helpful error message. | 849 # helpful error message. |
845 class AP(ArgumentParser): | 850 class AP(ArgumentParser): |
846 def __init__(self): | 851 def __init__(self): |
872 defs = fp.read() | 877 defs = fp.read() |
873 jvmciJars = [] | 878 jvmciJars = [] |
874 jdkJars = [] | 879 jdkJars = [] |
875 for jdkDist in _jdkDeployedDists: | 880 for jdkDist in _jdkDeployedDists: |
876 dist = mx.distribution(jdkDist.name) | 881 dist = mx.distribution(jdkDist.name) |
877 exportedByMx = not(opts2.use_make and jdkDist.partOfHotSpot) | 882 jdkJars.append(join(_graal_home, dist.path)) |
878 if exportedByMx: | |
879 jdkJars.append(join(_graal_home, dist.path)) | |
880 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/' + basename(dist.path) | 883 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/' + basename(dist.path) |
881 if jdkDist.isExtension: | 884 if jdkDist.isExtension: |
882 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_EXT_DIR)/' + basename(dist.path) | 885 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_EXT_DIR)/' + basename(dist.path) |
883 elif jdkDist.usesJVMCIClassLoader: | 886 elif jdkDist.usesJVMCIClassLoader: |
884 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_JVMCI_DIR)/' + basename(dist.path) | 887 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_JVMCI_DIR)/' + basename(dist.path) |
885 if exportedByMx: | 888 jvmciJars.append(dist.path) |
886 jvmciJars.append(dist.path) | |
887 else: | 889 else: |
888 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/' + basename(dist.path) | 890 defLine = 'EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/' + basename(dist.path) |
889 if defLine not in defs: | 891 if defLine not in defs: |
890 mx.abort('Missing following line in ' + defsPath + '\n' + defLine) | 892 mx.abort('Missing following line in ' + defsPath + '\n' + defLine) |
891 if exportedByMx: | |
892 shutil.copy(dist.path, opts2.export_dir) | 893 shutil.copy(dist.path, opts2.export_dir) |
893 | 894 |
894 services, optionsFiles = _extractJVMCIFiles(jdkJars, jvmciJars, join(opts2.export_dir, 'services'), join(opts2.export_dir, 'options')) | 895 services, optionsFiles = _extractJVMCIFiles(jdkJars, jvmciJars, join(opts2.export_dir, 'services'), join(opts2.export_dir, 'options')) |
895 if not opts2.use_make: | 896 if not opts2.use_make: |
896 for service in services: | 897 for service in services: |
1101 f.write(vmKnown) | 1102 f.write(vmKnown) |
1102 if vm == 'jvmci': | 1103 if vm == 'jvmci': |
1103 # Legacy support | 1104 # Legacy support |
1104 f.write('-graal ALIASED_TO -jvmci\n') | 1105 f.write('-graal ALIASED_TO -jvmci\n') |
1105 | 1106 |
1107 for jdkDist in _jdkDeployedDists: # Install non HotSpot distribution | |
1108 if not jdkDist.partOfHotSpot: | |
1109 _installDistInJdks(jdkDist) | |
1106 if exists(timestampFile): | 1110 if exists(timestampFile): |
1107 os.utime(timestampFile, None) | 1111 os.utime(timestampFile, None) |
1108 else: | 1112 else: |
1109 file(timestampFile, 'a') | 1113 file(timestampFile, 'a') |
1110 | 1114 |
2706 | 2710 |
2707 for jdkDist in _jdkDeployedDists: | 2711 for jdkDist in _jdkDeployedDists: |
2708 def _close(jdkDeployable): | 2712 def _close(jdkDeployable): |
2709 def _install(dist): | 2713 def _install(dist): |
2710 assert dist.name == jdkDeployable.name, dist.name + "!=" + jdkDeployable.name | 2714 assert dist.name == jdkDeployable.name, dist.name + "!=" + jdkDeployable.name |
2711 _installDistInJdks(jdkDeployable) | 2715 if not jdkDist.partOfHotSpot: |
2716 _installDistInJdks(jdkDeployable) | |
2712 return _install | 2717 return _install |
2713 mx.distribution(jdkDist.name).add_update_listener(_close(jdkDist)) | 2718 mx.distribution(jdkDist.name).add_update_listener(_close(jdkDist)) |