Mercurial > hg > graal-jvmci-8
annotate mx.jvmci/mx_jvmci.py @ 22277:a48774f9b97a
renamed mx_jvmci.get_jdk() to mx_jvmci.get_jvmci_jdk()
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 22 Jul 2015 11:54:12 +0200 |
parents | ed0b8310ac56 |
children | 224416477bab |
rev | line source |
---|---|
3718 | 1 # |
2 # ---------------------------------------------------------------------------------------------------- | |
3 # | |
18897
9afee75cee46
mx: add microbench command to run JMH benchmarks
Roland Schatz <roland.schatz@oracle.com>
parents:
18894
diff
changeset
|
4 # Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. |
3718 | 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6 # | |
7 # This code is free software; you can redistribute it and/or modify it | |
8 # under the terms of the GNU General Public License version 2 only, as | |
9 # published by the Free Software Foundation. | |
10 # | |
11 # This code is distributed in the hope that it will be useful, but WITHOUT | |
12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 # version 2 for more details (a copy is included in the LICENSE file that | |
15 # accompanied this code). | |
16 # | |
17 # You should have received a copy of the GNU General Public License version | |
18 # 2 along with this work; if not, write to the Free Software Foundation, | |
19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
20 # | |
21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
22 # or visit www.oracle.com if you need additional information or have any | |
23 # questions. | |
24 # | |
25 # ---------------------------------------------------------------------------------------------------- | |
26 | |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
27 import os, stat, errno, sys, shutil, zipfile, tarfile, tempfile, re, time, datetime, platform, subprocess, socket |
16419
7520833c6e7f
eliminate JUnitWrapper
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
16417
diff
changeset
|
28 from os.path import join, exists, dirname, basename |
22020
36a7ec14279d
moved unit test support from mx_graal.py to mx.py
Doug Simon <doug.simon@oracle.com>
parents:
22019
diff
changeset
|
29 from argparse import ArgumentParser, REMAINDER |
13472
72e2ec923b7b
added support to replace NetBeans platform used by IGV if it is out of date (GRAAL-420)
Doug Simon <doug.simon@oracle.com>
parents:
13471
diff
changeset
|
30 import xml.dom.minidom |
9116
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
31 import json, textwrap |
22031
434fbaaf53d7
moved findbugs support from mx_graal.py to mx_findbugs.py
Doug Simon <doug.simon@oracle.com>
parents:
22024
diff
changeset
|
32 |
434fbaaf53d7
moved findbugs support from mx_graal.py to mx_findbugs.py
Doug Simon <doug.simon@oracle.com>
parents:
22024
diff
changeset
|
33 import mx |
434fbaaf53d7
moved findbugs support from mx_graal.py to mx_findbugs.py
Doug Simon <doug.simon@oracle.com>
parents:
22024
diff
changeset
|
34 import mx_unittest |
22274
ed0b8310ac56
import unittest from mx_unittest.py
Doug Simon <doug.simon@oracle.com>
parents:
22273
diff
changeset
|
35 from mx_unittest import unittest |
22031
434fbaaf53d7
moved findbugs support from mx_graal.py to mx_findbugs.py
Doug Simon <doug.simon@oracle.com>
parents:
22024
diff
changeset
|
36 import mx_findbugs |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
37 import mx_jvmci_makefile |
3718 | 38 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
39 _suite = mx.suite('jvmci') |
4417
648a7873cea2
Made it possible to build and run the client and server VM with a new '--vm' option to 'mx build' and a global option of the same name.
Doug Simon <doug.simon@oracle.com>
parents:
4407
diff
changeset
|
40 |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
41 """ The VMs that can be built and run along with an optional description. Only VMs with a |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
42 description are listed in the dialogue for setting the default VM (see get_vm()). """ |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
43 _vmChoices = { |
22099
10b08d53b060
removed TRUFFLE distribution - only use TRUFFLE library
Doug Simon <doug.simon@oracle.com>
parents:
22096
diff
changeset
|
44 'jvmci' : 'VM triggered compilation is performed with a tiered system (C1 + Graal) and Graal is available for hosted compilation.', |
10b08d53b060
removed TRUFFLE distribution - only use TRUFFLE library
Doug Simon <doug.simon@oracle.com>
parents:
22096
diff
changeset
|
45 'server' : 'Normal compilation is performed with a tiered system (C1 + C2) and Graal is available for hosted compilation.', |
10b08d53b060
removed TRUFFLE distribution - only use TRUFFLE library
Doug Simon <doug.simon@oracle.com>
parents:
22096
diff
changeset
|
46 'client' : None, # VM compilation with client compiler, hosted compilation with Graal |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
47 'server-nojvmci' : None, # all compilation with tiered system (i.e., client + server), JVMCI omitted |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
48 'client-nojvmci' : None, # all compilation with client compiler, JVMCI omitted |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
49 'original' : None, # default VM copied from bootstrap JDK |
21584
9bb04af58490
support DEFAULT_VM=graal in mx/env
Doug Simon <doug.simon@oracle.com>
parents:
21580
diff
changeset
|
50 'graal' : None, # alias for jvmci |
21640
11f68b116a07
mx: added support for server-nograal and client-nograal aliases
Doug Simon <doug.simon@oracle.com>
parents:
21639
diff
changeset
|
51 'server-nograal' : None, # alias for server-nojvmci |
11f68b116a07
mx: added support for server-nograal and client-nograal aliases
Doug Simon <doug.simon@oracle.com>
parents:
21639
diff
changeset
|
52 'client-nograal' : None, # alias for client-nojvmci |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
53 } |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
54 |
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
55 """ The VM that will be run by the 'vm' command and built by default by the 'build' command. |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
56 This can be set via the global '--vm' option or the DEFAULT_VM environment variable. |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
57 It can also be temporarily set by using of a VM context manager object in a 'with' statement. """ |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
58 _vm = None |
4417
648a7873cea2
Made it possible to build and run the client and server VM with a new '--vm' option to 'mx build' and a global option of the same name.
Doug Simon <doug.simon@oracle.com>
parents:
4407
diff
changeset
|
59 |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
60 """ The VM builds that will be run by the 'vm' command - default is first in list """ |
9157
a38d748d4130
Add support for the 'optimized' build in mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9130
diff
changeset
|
61 _vmbuildChoices = ['product', 'fastdebug', 'debug', 'optimized'] |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
62 |
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
63 """ The VM build that will be run by the 'vm' command. |
11371
74414b248381
mx: added --vmbuild global option, removed --product, --fastdebug, --debug options as well as suffix of build command
Doug Simon <doug.simon@oracle.com>
parents:
11368
diff
changeset
|
64 This can be set via the global '--vmbuild' option. |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
65 It can also be temporarily set by using of a VM context manager object in a 'with' statement. """ |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
66 _vmbuild = _vmbuildChoices[0] |
3718 | 67 |
5024
7ccdae96e98a
Allow JaCoCon to append to the execution file
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5016
diff
changeset
|
68 _jacoco = 'off' |
4684
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
69 |
11401
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
70 """ The current working directory to switch to before running the VM. """ |
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
71 _vm_cwd = None |
10454
590b0c26877f
mx: add --workdir argument
Bernhard Urban <bernhard.urban@jku.at>
parents:
10417
diff
changeset
|
72 |
11401
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
73 """ The base directory in which the JDKs cloned from $JAVA_HOME exist. """ |
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
74 _installed_jdks = None |
10570
2f80624df8a2
Add a --vmdir argument to mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10568
diff
changeset
|
75 |
11401
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
76 """ Prefix for running the VM. """ |
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
77 _vm_prefix = None |
5875
000fb0550afe
Add an option to launch the vm from a debugger in mx's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5871
diff
changeset
|
78 |
5194
a6eceb5efb0e
added --ecl option to mx for saving VM execution(s) as Eclipse launch configurations
Doug Simon <doug.simon@oracle.com>
parents:
5189
diff
changeset
|
79 _make_eclipse_launch = False |
a6eceb5efb0e
added --ecl option to mx for saving VM execution(s) as Eclipse launch configurations
Doug Simon <doug.simon@oracle.com>
parents:
5189
diff
changeset
|
80 |
15594
62738ce98804
mx: set _minVersion to 1.8
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15593
diff
changeset
|
81 _minVersion = mx.VersionSpec('1.8') |
7916
9bff64f43299
Better java version numbers support in mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7788
diff
changeset
|
82 |
20102
6e5df2d60fbd
mx: fix compliance check for EXTRA_JAVA_HOMES, add maximum JAVA_HOME version in mx_graal
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
20032
diff
changeset
|
83 # max version (first _unsupported_ version) |
20805
379471b334cb
Lift 8u40 mx restriction
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
20102
diff
changeset
|
84 _untilVersion = None |
20102
6e5df2d60fbd
mx: fix compliance check for EXTRA_JAVA_HOMES, add maximum JAVA_HOME version in mx_graal
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
20032
diff
changeset
|
85 |
16902
0583d157992a
formalized the set of distribution jars that are installed into the JDK to ensure both mx and the HotSpot make system do the necessary deployment
Doug Simon <doug.simon@oracle.com>
parents:
16877
diff
changeset
|
86 class JDKDeployedDist: |
21740
6c3c21d9b5ef
Add -m switch to mx build, which builds/exports JVMCI with the make/jvmci.make file
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21720
diff
changeset
|
87 def __init__(self, name, isExtension=False, usesJVMCIClassLoader=False, partOfHotSpot=False): |
16902
0583d157992a
formalized the set of distribution jars that are installed into the JDK to ensure both mx and the HotSpot make system do the necessary deployment
Doug Simon <doug.simon@oracle.com>
parents:
16877
diff
changeset
|
88 self.name = name |
0583d157992a
formalized the set of distribution jars that are installed into the JDK to ensure both mx and the HotSpot make system do the necessary deployment
Doug Simon <doug.simon@oracle.com>
parents:
16877
diff
changeset
|
89 self.isExtension = isExtension |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
90 self.usesJVMCIClassLoader = usesJVMCIClassLoader |
21740
6c3c21d9b5ef
Add -m switch to mx build, which builds/exports JVMCI with the make/jvmci.make file
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21720
diff
changeset
|
91 self.partOfHotSpot = partOfHotSpot # true when this distribution is delivered with HotSpot |
16902
0583d157992a
formalized the set of distribution jars that are installed into the JDK to ensure both mx and the HotSpot make system do the necessary deployment
Doug Simon <doug.simon@oracle.com>
parents:
16877
diff
changeset
|
92 |
22143
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
93 def onPostJdkInstall(self, jdkDir, targetDir): |
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
94 ''' |
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
95 Called after the jar(s) for this dist have been deployed to 'targetDir' which |
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
96 is in the JDK at 'jdkDir'. |
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
97 ''' |
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
98 pass |
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
99 |
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
100 def dist(self): |
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
101 return mx.distribution(self.name) |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
102 |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
103 """ |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
104 List of distributions that are deployed into a JDK by mx. |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
105 """ |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
106 jdkDeployedDists = [ |
21740
6c3c21d9b5ef
Add -m switch to mx build, which builds/exports JVMCI with the make/jvmci.make file
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21720
diff
changeset
|
107 JDKDeployedDist('JVMCI_SERVICE', partOfHotSpot=True), |
6c3c21d9b5ef
Add -m switch to mx build, which builds/exports JVMCI with the make/jvmci.make file
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21720
diff
changeset
|
108 JDKDeployedDist('JVMCI_API', usesJVMCIClassLoader=True, partOfHotSpot=True), |
6c3c21d9b5ef
Add -m switch to mx build, which builds/exports JVMCI with the make/jvmci.make file
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21720
diff
changeset
|
109 JDKDeployedDist('JVMCI_HOTSPOT', usesJVMCIClassLoader=True, partOfHotSpot=True), |
16902
0583d157992a
formalized the set of distribution jars that are installed into the JDK to ensure both mx and the HotSpot make system do the necessary deployment
Doug Simon <doug.simon@oracle.com>
parents:
16877
diff
changeset
|
110 ] |
0583d157992a
formalized the set of distribution jars that are installed into the JDK to ensure both mx and the HotSpot make system do the necessary deployment
Doug Simon <doug.simon@oracle.com>
parents:
16877
diff
changeset
|
111 |
16627
68deb37eed70
mx: fix permissions of copied bootstrap JDK files (don't make everything executable)
Bernhard Urban <bernhard.urban@jku.at>
parents:
16623
diff
changeset
|
112 JDK_UNIX_PERMISSIONS_DIR = 0755 |
68deb37eed70
mx: fix permissions of copied bootstrap JDK files (don't make everything executable)
Bernhard Urban <bernhard.urban@jku.at>
parents:
16623
diff
changeset
|
113 JDK_UNIX_PERMISSIONS_FILE = 0644 |
16782
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
114 JDK_UNIX_PERMISSIONS_EXEC = 0755 |
13919
9d70445ea369
mx: set correct permissions for graal.jar
Bernhard Urban <bernhard.urban@jku.at>
parents:
13846
diff
changeset
|
115 |
14602
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
116 def isVMSupported(vm): |
18799
750db34c9fe1
client-nograal is supported on Mac
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18733
diff
changeset
|
117 if 'client' == vm and len(platform.mac_ver()[0]) != 0: |
14602
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
118 # Client VM not supported: java launcher on Mac OS X translates '-client' to '-server' |
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
119 return False |
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
120 return True |
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
121 |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
122 def get_vm_cwd(): |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
123 """ |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
124 Get the current working directory to switch to before running the VM. |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
125 """ |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
126 return _vm_cwd |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
127 |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
128 def get_installed_jdks(): |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
129 """ |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
130 Get the base directory in which the JDKs cloned from $JAVA_HOME exist. |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
131 """ |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
132 return _installed_jdks |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
133 |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
134 def get_vm_prefix(): |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
135 """ |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
136 Get the prefix for running the VM ("/usr/bin/gdb --args"). |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
137 """ |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
138 return _vm_prefix |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
139 |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
140 def get_vm_choices(): |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
141 return _vmChoices |
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
142 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
143 def get_vm(): |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
144 """ |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
145 Gets the configured VM, presenting a dialogue if there is no currently configured VM. |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
146 """ |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
147 global _vm |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
148 if _vm: |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
149 return _vm |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
150 vm = mx.get_env('DEFAULT_VM') |
22018
11ed27b2abe8
remove hard-coded use of 'mx' to refer to the mxDir for the graal suite
Doug Simon <doug.simon@oracle.com>
parents:
22017
diff
changeset
|
151 envPath = join(_suite.mxDir, 'env') |
21640
11f68b116a07
mx: added support for server-nograal and client-nograal aliases
Doug Simon <doug.simon@oracle.com>
parents:
21639
diff
changeset
|
152 if vm and 'graal' in vm: |
21584
9bb04af58490
support DEFAULT_VM=graal in mx/env
Doug Simon <doug.simon@oracle.com>
parents:
21580
diff
changeset
|
153 if exists(envPath): |
9bb04af58490
support DEFAULT_VM=graal in mx/env
Doug Simon <doug.simon@oracle.com>
parents:
21580
diff
changeset
|
154 with open(envPath) as fp: |
21642 | 155 if 'DEFAULT_VM=' + vm in fp.read(): |
21640
11f68b116a07
mx: added support for server-nograal and client-nograal aliases
Doug Simon <doug.simon@oracle.com>
parents:
21639
diff
changeset
|
156 mx.log('Please update the DEFAULT_VM value in ' + envPath + ' to replace "graal" with "jvmci"') |
11f68b116a07
mx: added support for server-nograal and client-nograal aliases
Doug Simon <doug.simon@oracle.com>
parents:
21639
diff
changeset
|
157 vm = vm.replace('graal', 'jvmci') |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
158 if vm is None: |
21169
41ec6d89cb84
mx: fix calls to is_interactive()
Andreas Woess <andreas.woess@oracle.com>
parents:
21166
diff
changeset
|
159 if not mx.is_interactive(): |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
160 mx.abort('Need to specify VM with --vm option or DEFAULT_VM environment variable') |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
161 mx.log('Please select the VM to be executed from the following: ') |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
162 items = [k for k in _vmChoices.keys() if _vmChoices[k] is not None] |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
163 descriptions = [_vmChoices[k] for k in _vmChoices.keys() if _vmChoices[k] is not None] |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
164 vm = mx.select_items(items, descriptions, allowMultiple=False) |
21976
36e37644f91e
mx: improve first usage experience:
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21975
diff
changeset
|
165 mx.ask_persist_env('DEFAULT_VM', vm) |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
166 _vm = vm |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
167 return vm |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
168 |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
169 """ |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
170 A context manager that can be used with the 'with' statement to set the VM |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
171 used by all VM executions within the scope of the 'with' statement. For example: |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
172 |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
173 with VM('server'): |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
174 dacapo(['pmd']) |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
175 """ |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
176 class VM: |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
177 def __init__(self, vm=None, build=None): |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
178 assert vm is None or vm in _vmChoices.keys() |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
179 assert build is None or build in _vmbuildChoices |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
180 self.vm = vm if vm else _vm |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
181 self.build = build if build else _vmbuild |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
182 self.previousVm = _vm |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
183 self.previousBuild = _vmbuild |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
184 |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
185 def __enter__(self): |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
186 global _vm, _vmbuild |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
187 _vm = self.vm |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
188 _vmbuild = self.build |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
189 |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
190 def __exit__(self, exc_type, exc_value, traceback): |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
191 global _vm, _vmbuild |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
192 _vm = self.previousVm |
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
193 _vmbuild = self.previousBuild |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
194 |
16627
68deb37eed70
mx: fix permissions of copied bootstrap JDK files (don't make everything executable)
Bernhard Urban <bernhard.urban@jku.at>
parents:
16623
diff
changeset
|
195 def chmodRecursive(dirname, chmodFlagsDir): |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
196 if mx.get_os() == 'windows': |
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
197 return |
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
198 |
16627
68deb37eed70
mx: fix permissions of copied bootstrap JDK files (don't make everything executable)
Bernhard Urban <bernhard.urban@jku.at>
parents:
16623
diff
changeset
|
199 def _chmodDir(chmodFlags, dirname, fnames): |
68deb37eed70
mx: fix permissions of copied bootstrap JDK files (don't make everything executable)
Bernhard Urban <bernhard.urban@jku.at>
parents:
16623
diff
changeset
|
200 os.chmod(dirname, chmodFlagsDir) |
6705
0cb1ac637dd0
Added recursive chmod for cases where JAVA_HOME is not owned by graal workspace owner.
Laurent Daynes <Laurent.Daynes@oracle.com>
parents:
6702
diff
changeset
|
201 |
16627
68deb37eed70
mx: fix permissions of copied bootstrap JDK files (don't make everything executable)
Bernhard Urban <bernhard.urban@jku.at>
parents:
16623
diff
changeset
|
202 os.path.walk(dirname, _chmodDir, chmodFlagsDir) |
6705
0cb1ac637dd0
Added recursive chmod for cases where JAVA_HOME is not owned by graal workspace owner.
Laurent Daynes <Laurent.Daynes@oracle.com>
parents:
6702
diff
changeset
|
203 |
4144
34527a24bcf8
Adopted mxtool changes.
Doug Simon <doug.simon@oracle.com>
parents:
3736
diff
changeset
|
204 def clean(args): |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
205 """clean the source tree""" |
4247
3f6c6e61614e
Changed 'mx build' such that all Java sources for a project are compiled together instead of by source directory.
Doug Simon <doug.simon@oracle.com>
parents:
4244
diff
changeset
|
206 opts = mx.clean(args, parser=ArgumentParser(prog='mx clean')) |
15580
ce201bb843b4
mx clean: try to change permission if deletion fails on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
15577
diff
changeset
|
207 |
4226
e03ff10d4bfc
Made the gate clean the Java projects only.
Doug Simon <doug.simon@oracle.com>
parents:
4225
diff
changeset
|
208 if opts.native: |
15580
ce201bb843b4
mx clean: try to change permission if deletion fails on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
15577
diff
changeset
|
209 def handleRemoveReadonly(func, path, exc): |
ce201bb843b4
mx clean: try to change permission if deletion fails on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
15577
diff
changeset
|
210 excvalue = exc[1] |
ce201bb843b4
mx clean: try to change permission if deletion fails on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
15577
diff
changeset
|
211 if mx.get_os() == 'windows' and func in (os.rmdir, os.remove) and excvalue.errno == errno.EACCES: |
15870
fe608a56e3f7
made HotSpotOptions processing faster by removing use of service loader in VM startup and only doing work for options specified on the command line
Doug Simon <doug.simon@oracle.com>
parents:
15862
diff
changeset
|
212 os.chmod(path, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) # 0777 |
15580
ce201bb843b4
mx clean: try to change permission if deletion fails on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
15577
diff
changeset
|
213 func(path) |
ce201bb843b4
mx clean: try to change permission if deletion fails on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
15577
diff
changeset
|
214 else: |
ce201bb843b4
mx clean: try to change permission if deletion fails on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
15577
diff
changeset
|
215 raise |
ce201bb843b4
mx clean: try to change permission if deletion fails on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
15577
diff
changeset
|
216 |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
217 def rmIfExists(name): |
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
218 if os.path.isdir(name): |
15580
ce201bb843b4
mx clean: try to change permission if deletion fails on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
15577
diff
changeset
|
219 shutil.rmtree(name, ignore_errors=False, onerror=handleRemoveReadonly) |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
220 elif os.path.isfile(name): |
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
221 os.unlink(name) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
222 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
223 rmIfExists(join(_suite.dir, 'build')) |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
224 rmIfExists(join(_suite.dir, 'build-nojvmci')) |
9119
0c9c4ae236b2
refactoring to ensure the path to the JDKs dir is consistent between the _jdk() and clean() command
Doug Simon <doug.simon@oracle.com>
parents:
9118
diff
changeset
|
225 rmIfExists(_jdksDir()) |
3718 | 226 |
4156
843c8d6720da
Added 'export' command for creating a GraalVM zip file distribution without the Mercurial data or VM sources.
Doug Simon <doug.simon@oracle.com>
parents:
4155
diff
changeset
|
227 def export(args): |
15420
5947bb02474f
mx export: change the way of marking a repo as dirty
Bernhard Urban <bernhard.urban@jku.at>
parents:
15405
diff
changeset
|
228 """create archives of builds split by vmbuild and vm""" |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
229 |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
230 parser = ArgumentParser(prog='mx export') |
4156
843c8d6720da
Added 'export' command for creating a GraalVM zip file distribution without the Mercurial data or VM sources.
Doug Simon <doug.simon@oracle.com>
parents:
4155
diff
changeset
|
231 args = parser.parse_args(args) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
232 |
15405
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
233 # collect data about export |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
234 infos = dict() |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
235 infos['timestamp'] = time.time() |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
236 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
237 hgcfg = mx.HgConfig() |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
238 hgcfg.check() |
15420
5947bb02474f
mx export: change the way of marking a repo as dirty
Bernhard Urban <bernhard.urban@jku.at>
parents:
15405
diff
changeset
|
239 infos['revision'] = hgcfg.tip('.') + ('+' if hgcfg.isDirty('.') else '') |
15405
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
240 # TODO: infos['repository'] |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
241 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
242 infos['jdkversion'] = str(mx.java().version) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
243 |
17012
ad10671d1bbd
mx: move get_arch() to mxtool
Bernhard Urban <bernhard.urban@jku.at>
parents:
16983
diff
changeset
|
244 infos['architecture'] = mx.get_arch() |
15405
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
245 infos['platform'] = mx.get_os() |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
246 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
247 if mx.get_os != 'windows': |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
248 pass |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
249 # infos['ccompiler'] |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
250 # infos['linker'] |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
251 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
252 infos['hostname'] = socket.gethostname() |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
253 |
15405
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
254 def _writeJson(suffix, properties): |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
255 d = infos.copy() |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
256 for k, v in properties.iteritems(): |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
257 assert not d.has_key(k) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
258 d[k] = v |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
259 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
260 jsonFileName = 'export-' + suffix + '.json' |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
261 with open(jsonFileName, 'w') as f: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
262 print >> f, json.dumps(d) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
263 return jsonFileName |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
264 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
265 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
266 def _genFileName(archivtype, middle): |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
267 idPrefix = infos['revision'] + '_' |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
268 idSuffix = '.tar.gz' |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
269 return join(_suite.dir, "graalvm_" + archivtype + "_" + idPrefix + middle + idSuffix) |
15405
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
270 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
271 def _genFileArchPlatformName(archivtype, middle): |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
272 return _genFileName(archivtype, infos['platform'] + '_' + infos['architecture'] + '_' + middle) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
273 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
274 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
275 # archive different build types of hotspot |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
276 for vmBuild in _vmbuildChoices: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
277 jdkpath = join(_jdksDir(), vmBuild) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
278 if not exists(jdkpath): |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
279 mx.logv("skipping " + vmBuild) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
280 continue |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
281 |
15405
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
282 tarName = _genFileArchPlatformName('basejdk', vmBuild) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
283 mx.logv("creating basejdk " + tarName) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
284 vmSet = set() |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
285 with tarfile.open(tarName, 'w:gz') as tar: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
286 for root, _, files in os.walk(jdkpath): |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
287 if basename(root) in _vmChoices.keys(): |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
288 # TODO: add some assert to check path assumption |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
289 vmSet.add(root) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
290 continue |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
291 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
292 for f in files: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
293 name = join(root, f) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
294 # print name |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
295 tar.add(name, name) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
296 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
297 n = _writeJson("basejdk-" + vmBuild, {'vmbuild' : vmBuild}) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
298 tar.add(n, n) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
299 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
300 # create a separate archive for each VM |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
301 for vm in vmSet: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
302 bVm = basename(vm) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
303 vmTarName = _genFileArchPlatformName('vm', vmBuild + '_' + bVm) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
304 mx.logv("creating vm " + vmTarName) |
4156
843c8d6720da
Added 'export' command for creating a GraalVM zip file distribution without the Mercurial data or VM sources.
Doug Simon <doug.simon@oracle.com>
parents:
4155
diff
changeset
|
305 |
15405
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
306 debugFiles = set() |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
307 with tarfile.open(vmTarName, 'w:gz') as tar: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
308 for root, _, files in os.walk(vm): |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
309 for f in files: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
310 # TODO: mac, windows, solaris? |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
311 if any(map(f.endswith, [".debuginfo"])): |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
312 debugFiles.add(f) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
313 else: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
314 name = join(root, f) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
315 # print name |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
316 tar.add(name, name) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
317 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
318 n = _writeJson("vm-" + vmBuild + "-" + bVm, {'vmbuild' : vmBuild, 'vm' : bVm}) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
319 tar.add(n, n) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
320 |
15405
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
321 if len(debugFiles) > 0: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
322 debugTarName = _genFileArchPlatformName('debugfilesvm', vmBuild + '_' + bVm) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
323 mx.logv("creating debugfilesvm " + debugTarName) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
324 with tarfile.open(debugTarName, 'w:gz') as tar: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
325 for f in debugFiles: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
326 name = join(root, f) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
327 # print name |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
328 tar.add(name, name) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
329 |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
330 n = _writeJson("debugfilesvm-" + vmBuild + "-" + bVm, {'vmbuild' : vmBuild, 'vm' : bVm}) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
331 tar.add(n, n) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
332 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
333 # jvmci directory |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
334 jvmciDirTarName = _genFileName('classfiles', 'javac') |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
335 mx.logv("creating jvmci " + jvmciDirTarName) |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
336 with tarfile.open(jvmciDirTarName, 'w:gz') as tar: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
337 for root, _, files in os.walk("jvmci"): |
15405
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
338 for f in [f for f in files if not f.endswith('.java')]: |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
339 name = join(root, f) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
340 # print name |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
341 tar.add(name, name) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
342 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
343 n = _writeJson("jvmci", {'javacompiler' : 'javac'}) |
15405
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
344 tar.add(n, n) |
5dcf0ae606f3
mx: new export command
Bernhard Urban <bernhard.urban@jku.at>
parents:
15404
diff
changeset
|
345 |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
346 def vmLibDirInJdk(jdk): |
4607
ee87cfe2f8f9
Made GraalVM build work on Mac OS X.
Doug Simon <doug.simon@oracle.com>
parents:
4602
diff
changeset
|
347 """ |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
348 Gets the directory within a JDK where the server and client |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
349 sub-directories are located. |
4607
ee87cfe2f8f9
Made GraalVM build work on Mac OS X.
Doug Simon <doug.simon@oracle.com>
parents:
4602
diff
changeset
|
350 """ |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
351 mxos = mx.get_os() |
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
352 if mxos == 'darwin': |
4607
ee87cfe2f8f9
Made GraalVM build work on Mac OS X.
Doug Simon <doug.simon@oracle.com>
parents:
4602
diff
changeset
|
353 return join(jdk, 'jre', 'lib') |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
354 if mxos == 'windows' or mxos == 'cygwin': |
5680
87fc13b59258
Split _vmLibDirInJdk into _vmLibDirInJdk and _vmCfgInJdk to account for Windows jdk layout
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5649
diff
changeset
|
355 return join(jdk, 'jre', 'bin') |
17012
ad10671d1bbd
mx: move get_arch() to mxtool
Bernhard Urban <bernhard.urban@jku.at>
parents:
16983
diff
changeset
|
356 return join(jdk, 'jre', 'lib', mx.get_arch()) |
4607
ee87cfe2f8f9
Made GraalVM build work on Mac OS X.
Doug Simon <doug.simon@oracle.com>
parents:
4602
diff
changeset
|
357 |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
358 def getVmJliLibDirs(jdk): |
17014
6a30738791f7
mx: add helper for determine jli location
Bernhard Urban <bernhard.urban@jku.at>
parents:
17012
diff
changeset
|
359 """ |
6a30738791f7
mx: add helper for determine jli location
Bernhard Urban <bernhard.urban@jku.at>
parents:
17012
diff
changeset
|
360 Get the directories within a JDK where the jli library designates to. |
6a30738791f7
mx: add helper for determine jli location
Bernhard Urban <bernhard.urban@jku.at>
parents:
17012
diff
changeset
|
361 """ |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
362 mxos = mx.get_os() |
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
363 if mxos == 'darwin': |
17014
6a30738791f7
mx: add helper for determine jli location
Bernhard Urban <bernhard.urban@jku.at>
parents:
17012
diff
changeset
|
364 return [join(jdk, 'jre', 'lib', 'jli')] |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
365 if mxos == 'windows' or mxos == 'cygwin': |
17014
6a30738791f7
mx: add helper for determine jli location
Bernhard Urban <bernhard.urban@jku.at>
parents:
17012
diff
changeset
|
366 return [join(jdk, 'jre', 'bin'), join(jdk, 'bin')] |
6a30738791f7
mx: add helper for determine jli location
Bernhard Urban <bernhard.urban@jku.at>
parents:
17012
diff
changeset
|
367 return [join(jdk, 'jre', 'lib', mx.get_arch(), 'jli'), join(jdk, 'lib', mx.get_arch(), 'jli')] |
6a30738791f7
mx: add helper for determine jli location
Bernhard Urban <bernhard.urban@jku.at>
parents:
17012
diff
changeset
|
368 |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
369 def getVmCfgInJdk(jdk, jvmCfgFile='jvm.cfg'): |
5680
87fc13b59258
Split _vmLibDirInJdk into _vmLibDirInJdk and _vmCfgInJdk to account for Windows jdk layout
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5649
diff
changeset
|
370 """ |
87fc13b59258
Split _vmLibDirInJdk into _vmLibDirInJdk and _vmCfgInJdk to account for Windows jdk layout
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5649
diff
changeset
|
371 Get the jvm.cfg file. |
87fc13b59258
Split _vmLibDirInJdk into _vmLibDirInJdk and _vmCfgInJdk to account for Windows jdk layout
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5649
diff
changeset
|
372 """ |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
373 mxos = mx.get_os() |
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
374 if mxos == "windows" or mxos == "cygwin": |
17015
ffddcdca8e74
mx: support different name for jvm.cfg
Bernhard Urban <bernhard.urban@jku.at>
parents:
17014
diff
changeset
|
375 return join(jdk, 'jre', 'lib', mx.get_arch(), jvmCfgFile) |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
376 return join(vmLibDirInJdk(jdk), jvmCfgFile) |
5680
87fc13b59258
Split _vmLibDirInJdk into _vmLibDirInJdk and _vmCfgInJdk to account for Windows jdk layout
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5649
diff
changeset
|
377 |
9119
0c9c4ae236b2
refactoring to ensure the path to the JDKs dir is consistent between the _jdk() and clean() command
Doug Simon <doug.simon@oracle.com>
parents:
9118
diff
changeset
|
378 def _jdksDir(): |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
379 return os.path.abspath(join(_installed_jdks if _installed_jdks else _suite.dir, 'jdk' + str(mx.java().version))) |
9119
0c9c4ae236b2
refactoring to ensure the path to the JDKs dir is consistent between the _jdk() and clean() command
Doug Simon <doug.simon@oracle.com>
parents:
9118
diff
changeset
|
380 |
17055
3e4d3be0b6bf
mx: fix default handling of vm config and build type
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
17052
diff
changeset
|
381 def _handle_missing_VM(bld, vm=None): |
3e4d3be0b6bf
mx: fix default handling of vm config and build type
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
17052
diff
changeset
|
382 if not vm: |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
383 vm = get_vm() |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
384 mx.log('The ' + bld + ' ' + vm + ' VM has not been created') |
21169
41ec6d89cb84
mx: fix calls to is_interactive()
Andreas Woess <andreas.woess@oracle.com>
parents:
21166
diff
changeset
|
385 if mx.is_interactive(): |
11511
3110bea9a6b0
mx: add helper method for yes/no question
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11493
diff
changeset
|
386 if mx.ask_yes_no('Build it now', 'y'): |
11371
74414b248381
mx: added --vmbuild global option, removed --product, --fastdebug, --debug options as well as suffix of build command
Doug Simon <doug.simon@oracle.com>
parents:
11368
diff
changeset
|
387 with VM(vm, bld): |
74414b248381
mx: added --vmbuild global option, removed --product, --fastdebug, --debug options as well as suffix of build command
Doug Simon <doug.simon@oracle.com>
parents:
11368
diff
changeset
|
388 build([]) |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
389 return |
11493
94779c895aad
fixed documentation of --installed-jdks mx option
Doug Simon <doug.simon@oracle.com>
parents:
11424
diff
changeset
|
390 mx.abort('You need to run "mx --vm ' + vm + ' --vmbuild ' + bld + ' build" to build the selected VM') |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
391 |
22277
a48774f9b97a
renamed mx_jvmci.get_jdk() to mx_jvmci.get_jvmci_jdk()
Doug Simon <doug.simon@oracle.com>
parents:
22274
diff
changeset
|
392 def get_jvmci_jdk(build=None, vmToCheck=None, create=False, installJars=True): |
4155
394404b2d9bd
Removed strict requirement for GRAAL environment variable. It only needs to be set now if the graal directory is not in the directory hierarchy of GraalVM JDK.
Doug Simon <doug.simon@oracle.com>
parents:
4153
diff
changeset
|
393 """ |
22277
a48774f9b97a
renamed mx_jvmci.get_jdk() to mx_jvmci.get_jvmci_jdk()
Doug Simon <doug.simon@oracle.com>
parents:
22274
diff
changeset
|
394 Gets the JDK into which JVMCI is installed, creating it first if necessary. |
4155
394404b2d9bd
Removed strict requirement for GRAAL environment variable. It only needs to be set now if the graal directory is not in the directory hierarchy of GraalVM JDK.
Doug Simon <doug.simon@oracle.com>
parents:
4153
diff
changeset
|
395 """ |
17055
3e4d3be0b6bf
mx: fix default handling of vm config and build type
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
17052
diff
changeset
|
396 if not build: |
22019
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
397 build = _vmbuild |
9119
0c9c4ae236b2
refactoring to ensure the path to the JDKs dir is consistent between the _jdk() and clean() command
Doug Simon <doug.simon@oracle.com>
parents:
9118
diff
changeset
|
398 jdk = join(_jdksDir(), build) |
4582
b24386206122
Made all vm builds go into subdirectories, even product builds to simplify building the various types of VMs (server, client and graal).
Doug Simon <doug.simon@oracle.com>
parents:
4577
diff
changeset
|
399 if create: |
10574
0cad5096735e
commands.py: Make sure _jdk returns an absolute path. Use _jdk and _jdksDir where necessary
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10570
diff
changeset
|
400 srcJdk = mx.java().jdk |
4582
b24386206122
Made all vm builds go into subdirectories, even product builds to simplify building the various types of VMs (server, client and graal).
Doug Simon <doug.simon@oracle.com>
parents:
4577
diff
changeset
|
401 if not exists(jdk): |
b24386206122
Made all vm builds go into subdirectories, even product builds to simplify building the various types of VMs (server, client and graal).
Doug Simon <doug.simon@oracle.com>
parents:
4577
diff
changeset
|
402 mx.log('Creating ' + jdk + ' from ' + srcJdk) |
13525
7cbd4f2194aa
mx: omit weird logic to copy bootstrap jdk, just do cp -R
Bernhard Urban <bernhard.urban@jku.at>
parents:
13524
diff
changeset
|
403 shutil.copytree(srcJdk, jdk) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
404 |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
405 # Make a copy of the default VM so that this JDK can be |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
406 # reliably used as the bootstrap for a HotSpot build. |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
407 jvmCfg = getVmCfgInJdk(jdk) |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
408 if not exists(jvmCfg): |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
409 mx.abort(jvmCfg + ' does not exist') |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
410 |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
411 defaultVM = None |
8647
5f8299106dd9
A server0 "build" needs to create a jdk copy if it does not exist yet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8646
diff
changeset
|
412 jvmCfgLines = [] |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
413 with open(jvmCfg) as f: |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
414 for line in f: |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
415 if line.startswith('-') and defaultVM is None: |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
416 parts = line.split() |
12540
0aa37fd2f33e
mx: fix detection for sparc. ignore unparsable lines in jvm.cfg
Bernhard Urban <bernhard.urban@jku.at>
parents:
12497
diff
changeset
|
417 if len(parts) == 2: |
0aa37fd2f33e
mx: fix detection for sparc. ignore unparsable lines in jvm.cfg
Bernhard Urban <bernhard.urban@jku.at>
parents:
12497
diff
changeset
|
418 assert parts[1] == 'KNOWN', parts[1] |
0aa37fd2f33e
mx: fix detection for sparc. ignore unparsable lines in jvm.cfg
Bernhard Urban <bernhard.urban@jku.at>
parents:
12497
diff
changeset
|
419 defaultVM = parts[0][1:] |
0aa37fd2f33e
mx: fix detection for sparc. ignore unparsable lines in jvm.cfg
Bernhard Urban <bernhard.urban@jku.at>
parents:
12497
diff
changeset
|
420 jvmCfgLines += ['# default VM is a copy of the unmodified ' + defaultVM + ' VM\n'] |
0aa37fd2f33e
mx: fix detection for sparc. ignore unparsable lines in jvm.cfg
Bernhard Urban <bernhard.urban@jku.at>
parents:
12497
diff
changeset
|
421 jvmCfgLines += ['-original KNOWN\n'] |
0aa37fd2f33e
mx: fix detection for sparc. ignore unparsable lines in jvm.cfg
Bernhard Urban <bernhard.urban@jku.at>
parents:
12497
diff
changeset
|
422 else: |
0aa37fd2f33e
mx: fix detection for sparc. ignore unparsable lines in jvm.cfg
Bernhard Urban <bernhard.urban@jku.at>
parents:
12497
diff
changeset
|
423 # skip lines which we cannot parse (e.g. '-hotspot ALIASED_TO -client') |
12583
110c3faa57e9
mx: print warning if encounter a non-parsable line in jvm.cfg
Bernhard Urban <bernhard.urban@jku.at>
parents:
12540
diff
changeset
|
424 mx.log("WARNING: skipping not parsable line \"" + line + "\"") |
8647
5f8299106dd9
A server0 "build" needs to create a jdk copy if it does not exist yet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8646
diff
changeset
|
425 else: |
5f8299106dd9
A server0 "build" needs to create a jdk copy if it does not exist yet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8646
diff
changeset
|
426 jvmCfgLines += [line] |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
427 |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
428 assert defaultVM is not None, 'Could not find default VM in ' + jvmCfg |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
429 chmodRecursive(jdk, JDK_UNIX_PERMISSIONS_DIR) |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
430 shutil.move(join(vmLibDirInJdk(jdk), defaultVM), join(vmLibDirInJdk(jdk), 'original')) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
431 |
18733
d7ec30ebb0f2
Properly chmod files modified when creating JDK image
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18714
diff
changeset
|
432 if mx.get_os() != 'windows': |
d7ec30ebb0f2
Properly chmod files modified when creating JDK image
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18714
diff
changeset
|
433 os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS_FILE) |
8261
2237260c6fdb
the contents of jvm.cfg are reset when copying the JDK so that the non-default VMs must be built before being run
Doug Simon <doug.simon@oracle.com>
parents:
8223
diff
changeset
|
434 with open(jvmCfg, 'w') as fp: |
8647
5f8299106dd9
A server0 "build" needs to create a jdk copy if it does not exist yet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8646
diff
changeset
|
435 for line in jvmCfgLines: |
5f8299106dd9
A server0 "build" needs to create a jdk copy if it does not exist yet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8646
diff
changeset
|
436 fp.write(line) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
437 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
438 # patch 'release' file (append jvmci revision) |
13523
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
439 releaseFile = join(jdk, 'release') |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
440 if exists(releaseFile): |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
441 releaseFileLines = [] |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
442 with open(releaseFile) as f: |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
443 for line in f: |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
444 releaseFileLines.append(line) |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
445 |
18733
d7ec30ebb0f2
Properly chmod files modified when creating JDK image
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18714
diff
changeset
|
446 if mx.get_os() != 'windows': |
d7ec30ebb0f2
Properly chmod files modified when creating JDK image
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18714
diff
changeset
|
447 os.chmod(releaseFile, JDK_UNIX_PERMISSIONS_FILE) |
13523
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
448 with open(releaseFile, 'w') as fp: |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
449 for line in releaseFileLines: |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
450 if line.startswith("SOURCE="): |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
451 try: |
13695
b688e7da4c69
refined class path used by unittest to only include dependencies of the tests that will be run
Doug Simon <doug.simon@oracle.com>
parents:
13526
diff
changeset
|
452 sourceLine = line[0:-2] # remove last char |
13523
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
453 hgcfg = mx.HgConfig() |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
454 hgcfg.check() |
13695
b688e7da4c69
refined class path used by unittest to only include dependencies of the tests that will be run
Doug Simon <doug.simon@oracle.com>
parents:
13526
diff
changeset
|
455 revision = hgcfg.tip('.')[:12] # take first 12 chars |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
456 fp.write(sourceLine + ' jvmci:' + revision + '\"\n') |
13523
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
457 except: |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
458 fp.write(line) |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
459 else: |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
460 fp.write(line) |
137142009b0b
mx: append graal revision to release file of jdk
Bernhard Urban <bernhard.urban@jku.at>
parents:
13522
diff
changeset
|
461 |
5596
e4b1bc5e29e0
hsdis library is downloaded into newly created Graal JDK
Doug Simon <doug.simon@oracle.com>
parents:
5517
diff
changeset
|
462 # Install a copy of the disassembler library |
e4b1bc5e29e0
hsdis library is downloaded into newly created Graal JDK
Doug Simon <doug.simon@oracle.com>
parents:
5517
diff
changeset
|
463 try: |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
464 hsdis([], copyToDir=vmLibDirInJdk(jdk)) |
5596
e4b1bc5e29e0
hsdis library is downloaded into newly created Graal JDK
Doug Simon <doug.simon@oracle.com>
parents:
5517
diff
changeset
|
465 except SystemExit: |
e4b1bc5e29e0
hsdis library is downloaded into newly created Graal JDK
Doug Simon <doug.simon@oracle.com>
parents:
5517
diff
changeset
|
466 pass |
3718 | 467 else: |
4582
b24386206122
Made all vm builds go into subdirectories, even product builds to simplify building the various types of VMs (server, client and graal).
Doug Simon <doug.simon@oracle.com>
parents:
4577
diff
changeset
|
468 if not exists(jdk): |
11797
65dbed1fdf46
be verbose when the JDK specified by --installed-jdks is missing
Doug Simon <doug.simon@oracle.com>
parents:
11784
diff
changeset
|
469 if _installed_jdks: |
65dbed1fdf46
be verbose when the JDK specified by --installed-jdks is missing
Doug Simon <doug.simon@oracle.com>
parents:
11784
diff
changeset
|
470 mx.log("The selected JDK directory does not (yet) exist: " + jdk) |
17055
3e4d3be0b6bf
mx: fix default handling of vm config and build type
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
17052
diff
changeset
|
471 _handle_missing_VM(build, vmToCheck) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
472 |
16623
addc0564e5b5
split com.oracle.graal.truffle.* projects into a separate graal-truffle.jar and added truffle.jar to the boot class path
Doug Simon <doug.simon@oracle.com>
parents:
16622
diff
changeset
|
473 if installJars: |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
474 for jdkDist in jdkDeployedDists: |
16902
0583d157992a
formalized the set of distribution jars that are installed into the JDK to ensure both mx and the HotSpot make system do the necessary deployment
Doug Simon <doug.simon@oracle.com>
parents:
16877
diff
changeset
|
475 dist = mx.distribution(jdkDist.name) |
21741
b6ee5d3f3255
Exclude distributions from exporting which are delivered with HotSpot (JBS:GRAAL-52)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21740
diff
changeset
|
476 if exists(dist.path) and jdkDist.partOfHotSpot: |
21031
e1c063565b3c
Graal Services: use services files in jre/lib/graal/services
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
20996
diff
changeset
|
477 _installDistInJdks(jdkDist) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
478 |
8261
2237260c6fdb
the contents of jvm.cfg are reset when copying the JDK so that the non-default VMs must be built before being run
Doug Simon <doug.simon@oracle.com>
parents:
8223
diff
changeset
|
479 if vmToCheck is not None: |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
480 jvmCfg = getVmCfgInJdk(jdk) |
8261
2237260c6fdb
the contents of jvm.cfg are reset when copying the JDK so that the non-default VMs must be built before being run
Doug Simon <doug.simon@oracle.com>
parents:
8223
diff
changeset
|
481 found = False |
2237260c6fdb
the contents of jvm.cfg are reset when copying the JDK so that the non-default VMs must be built before being run
Doug Simon <doug.simon@oracle.com>
parents:
8223
diff
changeset
|
482 with open(jvmCfg) as f: |
2237260c6fdb
the contents of jvm.cfg are reset when copying the JDK so that the non-default VMs must be built before being run
Doug Simon <doug.simon@oracle.com>
parents:
8223
diff
changeset
|
483 for line in f: |
2237260c6fdb
the contents of jvm.cfg are reset when copying the JDK so that the non-default VMs must be built before being run
Doug Simon <doug.simon@oracle.com>
parents:
8223
diff
changeset
|
484 if line.strip() == '-' + vmToCheck + ' KNOWN': |
2237260c6fdb
the contents of jvm.cfg are reset when copying the JDK so that the non-default VMs must be built before being run
Doug Simon <doug.simon@oracle.com>
parents:
8223
diff
changeset
|
485 found = True |
2237260c6fdb
the contents of jvm.cfg are reset when copying the JDK so that the non-default VMs must be built before being run
Doug Simon <doug.simon@oracle.com>
parents:
8223
diff
changeset
|
486 break |
2237260c6fdb
the contents of jvm.cfg are reset when copying the JDK so that the non-default VMs must be built before being run
Doug Simon <doug.simon@oracle.com>
parents:
8223
diff
changeset
|
487 if not found: |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
488 _handle_missing_VM(build, vmToCheck) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
489 |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
490 return jdk |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
491 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
492 def _updateInstalledJVMCIOptionsFile(jdk): |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
493 jvmciOptions = join(_suite.dir, 'jvmci.options') |
11936
4cdf7623fbe6
ensure graal.options in the JDK is deployed/updated/deleted each time the VM is run
Doug Simon <doug.simon@oracle.com>
parents:
11867
diff
changeset
|
494 jreLibDir = join(jdk, 'jre', 'lib') |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
495 if exists(jvmciOptions): |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
496 shutil.copy(jvmciOptions, join(jreLibDir, 'jvmci.options')) |
11936
4cdf7623fbe6
ensure graal.options in the JDK is deployed/updated/deleted each time the VM is run
Doug Simon <doug.simon@oracle.com>
parents:
11867
diff
changeset
|
497 else: |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
498 toDelete = join(jreLibDir, 'jvmci.options') |
11936
4cdf7623fbe6
ensure graal.options in the JDK is deployed/updated/deleted each time the VM is run
Doug Simon <doug.simon@oracle.com>
parents:
11867
diff
changeset
|
499 if exists(toDelete): |
4cdf7623fbe6
ensure graal.options in the JDK is deployed/updated/deleted each time the VM is run
Doug Simon <doug.simon@oracle.com>
parents:
11867
diff
changeset
|
500 os.unlink(toDelete) |
4cdf7623fbe6
ensure graal.options in the JDK is deployed/updated/deleted each time the VM is run
Doug Simon <doug.simon@oracle.com>
parents:
11867
diff
changeset
|
501 |
16605
c55478e640e1
generalized check that VM is up-to-date with all generated sources
Doug Simon <doug.simon@oracle.com>
parents:
16600
diff
changeset
|
502 def _makeHotspotGeneratedSourcesDir(): |
16628
d3fec84757ed
improved generated sources up-to-date check by using SHA1 digests
Doug Simon <doug.simon@oracle.com>
parents:
16627
diff
changeset
|
503 """ |
d3fec84757ed
improved generated sources up-to-date check by using SHA1 digests
Doug Simon <doug.simon@oracle.com>
parents:
16627
diff
changeset
|
504 Gets the directory containing all the HotSpot sources generated from |
21551
5324104ac4f3
moved com.oracle.graal.hotspot.jvmci classes to com.oracle.jvmci.hotspot module (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21537
diff
changeset
|
505 JVMCI Java sources. This directory will be created if it doesn't yet exist. |
16628
d3fec84757ed
improved generated sources up-to-date check by using SHA1 digests
Doug Simon <doug.simon@oracle.com>
parents:
16627
diff
changeset
|
506 """ |
22054 | 507 hsSrcGenDir = join(mx.project('jdk.internal.jvmci.hotspot').source_gen_dir(), 'hotspot') |
16600
6e7311d571ff
modify the 'mx vm' command to check that the VM is up-to-date with respect to graalRuntime.inline.hpp
Doug Simon <doug.simon@oracle.com>
parents:
16599
diff
changeset
|
508 if not exists(hsSrcGenDir): |
6e7311d571ff
modify the 'mx vm' command to check that the VM is up-to-date with respect to graalRuntime.inline.hpp
Doug Simon <doug.simon@oracle.com>
parents:
16599
diff
changeset
|
509 os.makedirs(hsSrcGenDir) |
16605
c55478e640e1
generalized check that VM is up-to-date with all generated sources
Doug Simon <doug.simon@oracle.com>
parents:
16600
diff
changeset
|
510 return hsSrcGenDir |
c55478e640e1
generalized check that VM is up-to-date with all generated sources
Doug Simon <doug.simon@oracle.com>
parents:
16600
diff
changeset
|
511 |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
512 def copyToJdk(src, dst, permissions=JDK_UNIX_PERMISSIONS_FILE): |
16782
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
513 name = os.path.basename(src) |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
514 dstLib = join(dst, name) |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
515 if mx.get_env('SYMLINK_GRAAL_JAR', None) == 'true': |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
516 # Using symlinks is much faster than copying but may |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
517 # cause issues if the lib is being updated while |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
518 # the VM is running. |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
519 if not os.path.islink(dstLib) or not os.path.realpath(dstLib) == src: |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
520 if exists(dstLib): |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
521 os.remove(dstLib) |
16858
a8af2abc2039
fixed regression in mx causing problems for the SYMLINK_GRAAL_JAR feature
Doug Simon <doug.simon@oracle.com>
parents:
16782
diff
changeset
|
522 os.symlink(src, dstLib) |
16782
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
523 else: |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
524 # do a copy and then a move to get atomic updating (on Unix) |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
525 fd, tmp = tempfile.mkstemp(suffix='', prefix=name, dir=dst) |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
526 shutil.copyfile(src, tmp) |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
527 os.close(fd) |
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
528 shutil.move(tmp, dstLib) |
16863
0d2e3399acfe
mx: add argument for permissions to copyToJdk()
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16862
diff
changeset
|
529 os.chmod(dstLib, permissions) |
16782
9f5e33cf8d52
Factored out the '_copyToJdk' function and allow copying files to jre/lib/ext.
Danilo Ansaloni <danilo.ansaloni@oracle.com>
parents:
16729
diff
changeset
|
530 |
22140
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
531 def _extractJVMCIFiles(jdkJars, jvmciJars, servicesDir, optionsDir, obsoleteCheck): |
22079
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
532 |
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
533 oldServices = os.listdir(servicesDir) if exists(servicesDir) else os.makedirs(servicesDir) |
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
534 oldOptions = os.listdir(optionsDir) if exists(optionsDir) else os.makedirs(optionsDir) |
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
535 |
21937
3a292e8b9e51
replaced Service marker interface with non-standard META-INF directory names to differentiate JVMCI providers from standard service providers
Doug Simon <doug.simon@oracle.com>
parents:
21936
diff
changeset
|
536 jvmciServices = {} |
21518
c2e58b2a2a76
Extract options file to build
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21514
diff
changeset
|
537 optionsFiles = [] |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
538 for jar in jvmciJars: |
21070
2ee48d02afe3
mx: Merge graal service files
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21059
diff
changeset
|
539 if os.path.isfile(jar): |
2ee48d02afe3
mx: Merge graal service files
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21059
diff
changeset
|
540 with zipfile.ZipFile(jar) as zf: |
2ee48d02afe3
mx: Merge graal service files
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21059
diff
changeset
|
541 for member in zf.namelist(): |
22079
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
542 if member.startswith('META-INF/jvmci.services/') and member != 'META-INF/jvmci.services/': |
21937
3a292e8b9e51
replaced Service marker interface with non-standard META-INF directory names to differentiate JVMCI providers from standard service providers
Doug Simon <doug.simon@oracle.com>
parents:
21936
diff
changeset
|
543 service = basename(member) |
22079
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
544 assert service != "", member |
21518
c2e58b2a2a76
Extract options file to build
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21514
diff
changeset
|
545 with zf.open(member) as serviceFile: |
21937
3a292e8b9e51
replaced Service marker interface with non-standard META-INF directory names to differentiate JVMCI providers from standard service providers
Doug Simon <doug.simon@oracle.com>
parents:
21936
diff
changeset
|
546 providers = jvmciServices.setdefault(service, []) |
21518
c2e58b2a2a76
Extract options file to build
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21514
diff
changeset
|
547 for line in serviceFile.readlines(): |
c2e58b2a2a76
Extract options file to build
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21514
diff
changeset
|
548 line = line.strip() |
22173
1a7f71d13b6e
avoid duplicate declarations of JVMCI service providers
Doug Simon <doug.simon@oracle.com>
parents:
22171
diff
changeset
|
549 if line and line not in providers: |
21937
3a292e8b9e51
replaced Service marker interface with non-standard META-INF directory names to differentiate JVMCI providers from standard service providers
Doug Simon <doug.simon@oracle.com>
parents:
21936
diff
changeset
|
550 providers.append(line) |
22079
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
551 elif member.startswith('META-INF/jvmci.options/') and member != 'META-INF/jvmci.options/': |
21518
c2e58b2a2a76
Extract options file to build
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21514
diff
changeset
|
552 filename = basename(member) |
22079
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
553 assert filename != "", member |
21518
c2e58b2a2a76
Extract options file to build
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21514
diff
changeset
|
554 targetpath = join(optionsDir, filename) |
c2e58b2a2a76
Extract options file to build
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21514
diff
changeset
|
555 optionsFiles.append(filename) |
c2e58b2a2a76
Extract options file to build
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21514
diff
changeset
|
556 with zf.open(member) as optionsFile, \ |
c2e58b2a2a76
Extract options file to build
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21514
diff
changeset
|
557 file(targetpath, "wb") as target: |
22140
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
558 if not obsoleteCheck: |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
559 shutil.copyfileobj(optionsFile, target) |
22079
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
560 if oldOptions and filename in oldOptions: |
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
561 oldOptions.remove(filename) |
21937
3a292e8b9e51
replaced Service marker interface with non-standard META-INF directory names to differentiate JVMCI providers from standard service providers
Doug Simon <doug.simon@oracle.com>
parents:
21936
diff
changeset
|
562 for service, providers in jvmciServices.iteritems(): |
22140
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
563 if not obsoleteCheck: |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
564 fd, tmp = tempfile.mkstemp(prefix=service) |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
565 f = os.fdopen(fd, 'w+') |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
566 for provider in providers: |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
567 f.write(provider + os.linesep) |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
568 target = join(servicesDir, service) |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
569 f.close() |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
570 shutil.move(tmp, target) |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
571 if mx.get_os() != 'windows': |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
572 os.chmod(target, JDK_UNIX_PERMISSIONS_FILE) |
22079
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
573 if oldServices and service in oldServices: |
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
574 oldServices.remove(service) |
21562 | 575 |
22140
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
576 if obsoleteCheck: |
22079
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
577 for d, files in [(servicesDir, oldServices), (optionsDir, oldOptions)]: |
22140
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
578 if files: |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
579 print 'These files in ' + d + ' look obsolete:\n ' + '\n '.join(files) |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
580 if mx.is_interactive() and mx.ask_yes_no('Delete them', 'n'): |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
581 for f in files: |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
582 path = join(d, f) |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
583 os.remove(path) |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
584 mx.log('Deleted ' + path) |
22079
59b0fd9e6b27
instead of cleaning jvmci/services and jvmci/options directories in a JDK, look for stale entries and offer to delete them if mx is running interactively
Doug Simon <doug.simon@oracle.com>
parents:
22077
diff
changeset
|
585 |
22140
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
586 def _updateJVMCIFiles(jdkDir, obsoleteCheck=False): |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
587 jreJVMCIDir = join(jdkDir, 'jre', 'lib', 'jvmci') |
21607
71b338926f2e
moved JVMCI classes into their own distributions (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21604
diff
changeset
|
588 jvmciJars = [join(jreJVMCIDir, e) for e in os.listdir(jreJVMCIDir) if e.endswith('.jar')] |
21671
8d0c2aabfc2d
missed Graal -> JVMCI renamings
Doug Simon <doug.simon@oracle.com>
parents:
21642
diff
changeset
|
589 jreJVMCIServicesDir = join(jreJVMCIDir, 'services') |
8d0c2aabfc2d
missed Graal -> JVMCI renamings
Doug Simon <doug.simon@oracle.com>
parents:
21642
diff
changeset
|
590 jreJVMCIOptionsDir = join(jreJVMCIDir, 'options') |
22140
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
591 _extractJVMCIFiles(_getJdkDeployedJars(jdkDir), jvmciJars, jreJVMCIServicesDir, jreJVMCIOptionsDir, obsoleteCheck) |
21070
2ee48d02afe3
mx: Merge graal service files
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21059
diff
changeset
|
592 |
21031
e1c063565b3c
Graal Services: use services files in jre/lib/graal/services
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
20996
diff
changeset
|
593 def _installDistInJdks(deployableDist): |
16623
addc0564e5b5
split com.oracle.graal.truffle.* projects into a separate graal-truffle.jar and added truffle.jar to the boot class path
Doug Simon <doug.simon@oracle.com>
parents:
16622
diff
changeset
|
594 """ |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
595 Installs the jar(s) for a given Distribution into all existing JVMCI JDKs |
16623
addc0564e5b5
split com.oracle.graal.truffle.* projects into a separate graal-truffle.jar and added truffle.jar to the boot class path
Doug Simon <doug.simon@oracle.com>
parents:
16622
diff
changeset
|
596 """ |
21031
e1c063565b3c
Graal Services: use services files in jre/lib/graal/services
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
20996
diff
changeset
|
597 dist = mx.distribution(deployableDist.name) |
10574
0cad5096735e
commands.py: Make sure _jdk returns an absolute path. Use _jdk and _jdksDir where necessary
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
10570
diff
changeset
|
598 jdks = _jdksDir() |
8134
6e3ebc6fd5a4
graal.jar is installed in all JDKs every time it is updated (GRAAL-136)
Doug Simon <doug.simon@oracle.com>
parents:
8132
diff
changeset
|
599 if exists(jdks): |
6e3ebc6fd5a4
graal.jar is installed in all JDKs every time it is updated (GRAAL-136)
Doug Simon <doug.simon@oracle.com>
parents:
8132
diff
changeset
|
600 for e in os.listdir(jdks): |
21070
2ee48d02afe3
mx: Merge graal service files
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21059
diff
changeset
|
601 jdkDir = join(jdks, e) |
2ee48d02afe3
mx: Merge graal service files
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21059
diff
changeset
|
602 jreLibDir = join(jdkDir, 'jre', 'lib') |
8134
6e3ebc6fd5a4
graal.jar is installed in all JDKs every time it is updated (GRAAL-136)
Doug Simon <doug.simon@oracle.com>
parents:
8132
diff
changeset
|
603 if exists(jreLibDir): |
21040
12e94cba3696
Graal Loader: load all jars matching lib/graal/graal*.jar
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21032
diff
changeset
|
604 if deployableDist.isExtension: |
12e94cba3696
Graal Loader: load all jars matching lib/graal/graal*.jar
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21032
diff
changeset
|
605 targetDir = join(jreLibDir, 'ext') |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
606 elif deployableDist.usesJVMCIClassLoader: |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
607 targetDir = join(jreLibDir, 'jvmci') |
21040
12e94cba3696
Graal Loader: load all jars matching lib/graal/graal*.jar
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21032
diff
changeset
|
608 else: |
12e94cba3696
Graal Loader: load all jars matching lib/graal/graal*.jar
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21032
diff
changeset
|
609 targetDir = jreLibDir |
12e94cba3696
Graal Loader: load all jars matching lib/graal/graal*.jar
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21032
diff
changeset
|
610 if not exists(targetDir): |
12e94cba3696
Graal Loader: load all jars matching lib/graal/graal*.jar
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21032
diff
changeset
|
611 os.makedirs(targetDir) |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
612 copyToJdk(dist.path, targetDir) |
16623
addc0564e5b5
split com.oracle.graal.truffle.* projects into a separate graal-truffle.jar and added truffle.jar to the boot class path
Doug Simon <doug.simon@oracle.com>
parents:
16622
diff
changeset
|
613 if dist.sourcesPath: |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
614 copyToJdk(dist.sourcesPath, jdkDir) |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
615 if deployableDist.usesJVMCIClassLoader: |
21070
2ee48d02afe3
mx: Merge graal service files
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21059
diff
changeset
|
616 # deploy service files |
21562 | 617 _updateJVMCIFiles(jdkDir) |
22143
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
618 deployableDist.onPostJdkInstall(jdkDir, targetDir) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
619 |
22140
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
620 def _check_for_obsolete_jvmci_files(): |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
621 jdks = _jdksDir() |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
622 if exists(jdks): |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
623 for e in os.listdir(jdks): |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
624 jdkDir = join(jdks, e) |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
625 _updateJVMCIFiles(jdkDir, obsoleteCheck=True) |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
626 |
21613
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
627 def _getJdkDeployedJars(jdkDir): |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
628 """ |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
629 Gets jar paths for all deployed distributions in the context of |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
630 a given JDK directory. |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
631 """ |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
632 jreLibDir = join(jdkDir, 'jre', 'lib') |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
633 jars = [] |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
634 for dist in jdkDeployedDists: |
21613
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
635 jar = basename(mx.distribution(dist.name).path) |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
636 if dist.isExtension: |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
637 jars.append(join(jreLibDir, 'ext', jar)) |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
638 elif dist.usesJVMCIClassLoader: |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
639 jars.append(join(jreLibDir, 'jvmci', jar)) |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
640 else: |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
641 jars.append(join(jreLibDir, jar)) |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
642 return jars |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
643 |
60154926b513
replaced use of javap with a small Java utility for refining service class list to only those implementing com.oracle.jvmci.service.Service
Doug Simon <doug.simon@oracle.com>
parents:
21607
diff
changeset
|
644 |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
645 # run a command in the windows SDK Debug Shell |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
646 def _runInDebugShell(cmd, workingDir, logFile=None, findInOutput=None, respondTo=None): |
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
647 if respondTo is None: |
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
648 respondTo = {} |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
649 newLine = os.linesep |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
650 startToken = 'RUNINDEBUGSHELL_STARTSEQUENCE' |
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
651 endToken = 'RUNINDEBUGSHELL_ENDSEQUENCE' |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
652 |
4252
67e88b7624d5
Removed need for GRAAL environment variable on Windows.
Doug Simon <doug.simon@oracle.com>
parents:
4247
diff
changeset
|
653 winSDK = mx.get_env('WIN_SDK', 'C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\') |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
654 |
17262
b641450c19ce
mx: rename helper functions for cygwin support and update comments
Bernhard Urban <bernhard.urban@jku.at>
parents:
17233
diff
changeset
|
655 if not exists(mx._cygpathW2U(winSDK)): |
6306
2a819543cc45
Warnings for windows build if there is no SDK
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6294
diff
changeset
|
656 mx.abort("Could not find Windows SDK : '" + winSDK + "' does not exist") |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
657 |
17262
b641450c19ce
mx: rename helper functions for cygwin support and update comments
Bernhard Urban <bernhard.urban@jku.at>
parents:
17233
diff
changeset
|
658 winSDKSetEnv = mx._cygpathW2U(join(winSDK, 'Bin', 'SetEnv.cmd')) |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
659 if not exists(winSDKSetEnv): |
6306
2a819543cc45
Warnings for windows build if there is no SDK
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6294
diff
changeset
|
660 mx.abort("Invalid Windows SDK path (" + winSDK + ") : could not find Bin/SetEnv.cmd (you can use the WIN_SDK environment variable to specify an other path)") |
4252
67e88b7624d5
Removed need for GRAAL environment variable on Windows.
Doug Simon <doug.simon@oracle.com>
parents:
4247
diff
changeset
|
661 |
17262
b641450c19ce
mx: rename helper functions for cygwin support and update comments
Bernhard Urban <bernhard.urban@jku.at>
parents:
17233
diff
changeset
|
662 wincmd = 'cmd.exe /E:ON /V:ON /K "' + mx._cygpathU2W(winSDKSetEnv) + '"' |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
663 p = subprocess.Popen(wincmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) |
4269
ffd5ce8fc736
Moved IDE project configuration into mx.py.
Doug Simon <doug.simon@oracle.com>
parents:
4257
diff
changeset
|
664 stdout = p.stdout |
ffd5ce8fc736
Moved IDE project configuration into mx.py.
Doug Simon <doug.simon@oracle.com>
parents:
4257
diff
changeset
|
665 stdin = p.stdin |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
666 if logFile: |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
667 log = open(logFile, 'w') |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
668 ret = False |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
669 |
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
670 def _writeProcess(s): |
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
671 stdin.write(s + newLine) |
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
672 |
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
673 _writeProcess("echo " + startToken) |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
674 while True: |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
7290
diff
changeset
|
675 # encoding may be None on windows plattforms |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
7290
diff
changeset
|
676 if sys.stdout.encoding is None: |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
7290
diff
changeset
|
677 encoding = 'utf-8' |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
7290
diff
changeset
|
678 else: |
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
7290
diff
changeset
|
679 encoding = sys.stdout.encoding |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
680 |
7291
a748e4d44694
Truffle API to specify type-specalized Node classes; annotation processor for automatic code generation of the type-specialized Node classes during the build process
Christian Humer <christian.humer@gmail.com>
parents:
7290
diff
changeset
|
681 line = stdout.readline().decode(encoding) |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
682 if logFile: |
5680
87fc13b59258
Split _vmLibDirInJdk into _vmLibDirInJdk and _vmCfgInJdk to account for Windows jdk layout
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5649
diff
changeset
|
683 log.write(line.encode('utf-8')) |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
684 line = line.strip() |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
685 mx.log(line) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
686 if line == startToken: |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
687 _writeProcess('cd /D ' + workingDir + ' & ' + cmd + ' & echo ' + endToken) |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
688 for regex in respondTo.keys(): |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
689 match = regex.search(line) |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
690 if match: |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
691 _writeProcess(respondTo[regex]) |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
692 if findInOutput: |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
693 match = findInOutput.search(line) |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
694 if match: |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
695 ret = True |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
696 if line == endToken: |
5680
87fc13b59258
Split _vmLibDirInJdk into _vmLibDirInJdk and _vmCfgInJdk to account for Windows jdk layout
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5649
diff
changeset
|
697 if not findInOutput: |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
698 _writeProcess('echo ERRXXX%errorlevel%') |
5680
87fc13b59258
Split _vmLibDirInJdk into _vmLibDirInJdk and _vmCfgInJdk to account for Windows jdk layout
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5649
diff
changeset
|
699 else: |
87fc13b59258
Split _vmLibDirInJdk into _vmLibDirInJdk and _vmCfgInJdk to account for Windows jdk layout
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5649
diff
changeset
|
700 break |
5868
a10e72af4dc5
Make windows build work even if Visual Studio is not installed (only the Windows SDK is required)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5782
diff
changeset
|
701 if line.startswith('ERRXXX'): |
a10e72af4dc5
Make windows build work even if Visual Studio is not installed (only the Windows SDK is required)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5782
diff
changeset
|
702 if line == 'ERRXXX0': |
5680
87fc13b59258
Split _vmLibDirInJdk into _vmLibDirInJdk and _vmCfgInJdk to account for Windows jdk layout
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5649
diff
changeset
|
703 ret = True |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
704 break |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
705 _writeProcess("exit") |
4177
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
706 if logFile: |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
707 log.close() |
c843578c269d
Make building work on Windows.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4163
diff
changeset
|
708 return ret |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
709 |
11605
3676540f71cf
Allow mxtool suites to be in separate repositories (CR-1367)
Mick Jordan <mick.jordan@oracle.com>
parents:
11534
diff
changeset
|
710 def jdkhome(vm=None): |
3676540f71cf
Allow mxtool suites to be in separate repositories (CR-1367)
Mick Jordan <mick.jordan@oracle.com>
parents:
11534
diff
changeset
|
711 """return the JDK directory selected for the 'vm' command""" |
22277
a48774f9b97a
renamed mx_jvmci.get_jdk() to mx_jvmci.get_jvmci_jdk()
Doug Simon <doug.simon@oracle.com>
parents:
22274
diff
changeset
|
712 return get_jvmci_jdk(installJars=False) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
713 |
11605
3676540f71cf
Allow mxtool suites to be in separate repositories (CR-1367)
Mick Jordan <mick.jordan@oracle.com>
parents:
11534
diff
changeset
|
714 def print_jdkhome(args, vm=None): |
3676540f71cf
Allow mxtool suites to be in separate repositories (CR-1367)
Mick Jordan <mick.jordan@oracle.com>
parents:
11534
diff
changeset
|
715 """print the JDK directory selected for the 'vm' command""" |
3676540f71cf
Allow mxtool suites to be in separate repositories (CR-1367)
Mick Jordan <mick.jordan@oracle.com>
parents:
11534
diff
changeset
|
716 print jdkhome(vm) |
5103
276e14614531
Added jdkhome command to mx.
Doug Simon <doug.simon@oracle.com>
parents:
5094
diff
changeset
|
717 |
9116
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
718 def buildvars(args): |
11377
0fbc1e418c88
fixed capitalization and tense in documentation of some mx commands
Doug Simon <doug.simon@oracle.com>
parents:
11373
diff
changeset
|
719 """describe the variables that can be set by the -D option to the 'mx build' commmand""" |
9116
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
720 |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
721 buildVars = { |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
722 'ALT_BOOTDIR' : 'The location of the bootstrap JDK installation (default: ' + mx.java().jdk + ')', |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
723 'ALT_OUTPUTDIR' : 'Build directory', |
18876
c446d00f2cdf
mx: added support for Jython 2.7b3 and made ordering in generated files more deterministic\nContributed-by: Igor Ignatyev <igor.ignatyev@oracle.com>
Doug Simon <doug.simon@oracle.com>
parents:
18869
diff
changeset
|
724 'HOTSPOT_BUILD_JOBS' : 'Number of CPUs used by make (default: ' + str(mx.cpu_count()) + ')', |
9116
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
725 'INSTALL' : 'Install the built VM into the JDK? (default: y)', |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
726 'ZIP_DEBUGINFO_FILES' : 'Install zipped debug symbols file? (default: 0)', |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
727 } |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
728 |
9116
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
729 mx.log('HotSpot build variables that can be set by the -D option to "mx build":') |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
730 mx.log('') |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
731 for n in sorted(buildVars.iterkeys()): |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
732 mx.log(n) |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
733 mx.log(textwrap.fill(buildVars[n], initial_indent=' ', subsequent_indent=' ', width=200)) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
734 |
9120
9f361c0f912b
added note about mx/env to the output of 'mx buildvars'
Doug Simon <doug.simon@oracle.com>
parents:
9119
diff
changeset
|
735 mx.log('') |
22018
11ed27b2abe8
remove hard-coded use of 'mx' to refer to the mxDir for the graal suite
Doug Simon <doug.simon@oracle.com>
parents:
22017
diff
changeset
|
736 mx.log('Note that these variables can be given persistent values in the file ' + join(_suite.mxDir, 'env') + ' (see \'mx about\').') |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
737 |
16622
faaea970b951
Add an mx install command to install the Truffle jars to the local Maven repository.
Chris Seaton <chris.seaton@oracle.com>
parents:
16621
diff
changeset
|
738 cached_graal_version = None |
faaea970b951
Add an mx install command to install the Truffle jars to the local Maven repository.
Chris Seaton <chris.seaton@oracle.com>
parents:
16621
diff
changeset
|
739 |
4577
bc8b58c11768
Added debug build of HotSpot Client to the gate.
Doug Simon <doug.simon@oracle.com>
parents:
4575
diff
changeset
|
740 def build(args, vm=None): |
4575
ccb5369481a2
Clarified mx help text on how to build/run [Graal|Client|Server].
Doug Simon <doug.simon@oracle.com>
parents:
4572
diff
changeset
|
741 """build the VM binary |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
742 |
11392
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
743 The global '--vm' and '--vmbuild' options select which VM type and build target to build.""" |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
744 |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
745 # Override to fail quickly if extra arguments are given |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
746 # at the end of the command line. This allows for a more |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
747 # helpful error message. |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
748 class AP(ArgumentParser): |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
749 def __init__(self): |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
750 ArgumentParser.__init__(self, prog='mx build') |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
751 def parse_args(self, args): |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
752 result = ArgumentParser.parse_args(self, args) |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
753 if len(result.remainder) != 0: |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
754 firstBuildTarget = result.remainder[0] |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
755 mx.abort('To specify the ' + firstBuildTarget + ' VM build target, you need to use the global "--vmbuild" option. For example:\n' + |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
756 ' mx --vmbuild ' + firstBuildTarget + ' build') |
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
757 return result |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
758 |
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
759 # Call mx.build to compile the Java sources |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
760 parser = AP() |
9116
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
761 parser.add_argument('-D', action='append', help='set a HotSpot build variable (run \'mx buildvars\' to list variables)', metavar='name=value') |
21791
cd36556e1b78
Remove conditional makefile-based compilation of jvmci from mx_graal.py
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21790
diff
changeset
|
762 |
9116
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
763 opts2 = mx.build(['--source', '1.7'] + args, parser=parser) |
11392
66251d9f62ab
fail faster with better error message if deprecated and unsupported mx build command line is given
Doug Simon <doug.simon@oracle.com>
parents:
11377
diff
changeset
|
764 assert len(opts2.remainder) == 0 |
4145
9aee7df31417
Removed 'tests' command.
Doug Simon <doug.simon@oracle.com>
parents:
4144
diff
changeset
|
765 |
22019
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
766 if not opts2.native: |
4156
843c8d6720da
Added 'export' command for creating a GraalVM zip file distribution without the Mercurial data or VM sources.
Doug Simon <doug.simon@oracle.com>
parents:
4155
diff
changeset
|
767 return |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
768 |
22171 | 769 if opts2.java and not opts2.dependencies and not opts2.only: |
22143
616739e61fb6
changed JDKDeployedDist.postJdkInstall to be an overridable method
Doug Simon <doug.simon@oracle.com>
parents:
22142
diff
changeset
|
770 # Only check deployed JVMCI files on a full build |
22140
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
771 _check_for_obsolete_jvmci_files() |
60d9e50d5481
only perform check for obsolete JVMCI files during full build
Doug Simon <doug.simon@oracle.com>
parents:
22139
diff
changeset
|
772 |
11371
74414b248381
mx: added --vmbuild global option, removed --product, --fastdebug, --debug options as well as suffix of build command
Doug Simon <doug.simon@oracle.com>
parents:
11368
diff
changeset
|
773 builds = [_vmbuild] |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
774 |
18414
df8d52aba789
fixed support for IDE_BUILD_TARGET
Doug Simon <doug.simon@oracle.com>
parents:
18351
diff
changeset
|
775 if os.environ.get('BUILDING_FROM_IDE', None) == 'true': |
df8d52aba789
fixed support for IDE_BUILD_TARGET
Doug Simon <doug.simon@oracle.com>
parents:
18351
diff
changeset
|
776 build = os.environ.get('IDE_BUILD_TARGET', None) |
df8d52aba789
fixed support for IDE_BUILD_TARGET
Doug Simon <doug.simon@oracle.com>
parents:
18351
diff
changeset
|
777 if build is None or len(build) == 0: |
df8d52aba789
fixed support for IDE_BUILD_TARGET
Doug Simon <doug.simon@oracle.com>
parents:
18351
diff
changeset
|
778 return |
df8d52aba789
fixed support for IDE_BUILD_TARGET
Doug Simon <doug.simon@oracle.com>
parents:
18351
diff
changeset
|
779 if build not in _vmbuildChoices: |
df8d52aba789
fixed support for IDE_BUILD_TARGET
Doug Simon <doug.simon@oracle.com>
parents:
18351
diff
changeset
|
780 mx.abort('VM build "' + build + '" specified by IDE_BUILD_TARGET environment variable is unknown (must be one of ' + |
df8d52aba789
fixed support for IDE_BUILD_TARGET
Doug Simon <doug.simon@oracle.com>
parents:
18351
diff
changeset
|
781 str(_vmbuildChoices) + ')') |
df8d52aba789
fixed support for IDE_BUILD_TARGET
Doug Simon <doug.simon@oracle.com>
parents:
18351
diff
changeset
|
782 builds = [build] |
df8d52aba789
fixed support for IDE_BUILD_TARGET
Doug Simon <doug.simon@oracle.com>
parents:
18351
diff
changeset
|
783 |
4577
bc8b58c11768
Added debug build of HotSpot Client to the gate.
Doug Simon <doug.simon@oracle.com>
parents:
4575
diff
changeset
|
784 if vm is None: |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
785 vm = get_vm() |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
786 |
9117
cbfcb1054619
renamed 'boot' VM to 'original' VM
Doug Simon <doug.simon@oracle.com>
parents:
9116
diff
changeset
|
787 if vm == 'original': |
cbfcb1054619
renamed 'boot' VM to 'original' VM
Doug Simon <doug.simon@oracle.com>
parents:
9116
diff
changeset
|
788 pass |
cbfcb1054619
renamed 'boot' VM to 'original' VM
Doug Simon <doug.simon@oracle.com>
parents:
9116
diff
changeset
|
789 elif vm.startswith('server'): |
4417
648a7873cea2
Made it possible to build and run the client and server VM with a new '--vm' option to 'mx build' and a global option of the same name.
Doug Simon <doug.simon@oracle.com>
parents:
4407
diff
changeset
|
790 buildSuffix = '' |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
791 elif vm.startswith('client'): |
4417
648a7873cea2
Made it possible to build and run the client and server VM with a new '--vm' option to 'mx build' and a global option of the same name.
Doug Simon <doug.simon@oracle.com>
parents:
4407
diff
changeset
|
792 buildSuffix = '1' |
648a7873cea2
Made it possible to build and run the client and server VM with a new '--vm' option to 'mx build' and a global option of the same name.
Doug Simon <doug.simon@oracle.com>
parents:
4407
diff
changeset
|
793 else: |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
794 assert vm == 'jvmci', vm |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
795 buildSuffix = 'jvmci' |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
796 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
797 if _installed_jdks and _installed_jdks != _suite.dir: |
11530
be9e54fbb699
Use a better warning message for building with --installed-jdks set
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11526
diff
changeset
|
798 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'): |
11512
38acec26d535
If _installed_jdk is set, ask confirmation before building
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11511
diff
changeset
|
799 mx.abort(1) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
800 |
17318
c75bb9cd1994
mx: force installation of distrubtion on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
17317
diff
changeset
|
801 isWindows = platform.system() == 'Windows' or "CYGWIN" in platform.system() |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
802 for build in builds: |
17318
c75bb9cd1994
mx: force installation of distrubtion on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
17317
diff
changeset
|
803 installJars = vm != 'original' and (isWindows or not opts2.java) |
22277
a48774f9b97a
renamed mx_jvmci.get_jdk() to mx_jvmci.get_jvmci_jdk()
Doug Simon <doug.simon@oracle.com>
parents:
22274
diff
changeset
|
804 jdk = get_jvmci_jdk(build, create=True, installJars=installJars) |
8647
5f8299106dd9
A server0 "build" needs to create a jdk copy if it does not exist yet
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8646
diff
changeset
|
805 |
9117
cbfcb1054619
renamed 'boot' VM to 'original' VM
Doug Simon <doug.simon@oracle.com>
parents:
9116
diff
changeset
|
806 if vm == 'original': |
9098
d766fd8eede0
VM copy made during initial copy of the JDK is now named 'boot' instead of 'server0' to better reflect that it is the default VM (which may not be 'server') from the boot JDK
Doug Simon <doug.simon@oracle.com>
parents:
9097
diff
changeset
|
807 if build != 'product': |
9117
cbfcb1054619
renamed 'boot' VM to 'original' VM
Doug Simon <doug.simon@oracle.com>
parents:
9116
diff
changeset
|
808 mx.log('only product build of original VM exists') |
9098
d766fd8eede0
VM copy made during initial copy of the JDK is now named 'boot' instead of 'server0' to better reflect that it is the default VM (which may not be 'server') from the boot JDK
Doug Simon <doug.simon@oracle.com>
parents:
9097
diff
changeset
|
809 continue |
14605 | 810 |
14602
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
811 if not isVMSupported(vm): |
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
812 mx.log('The ' + vm + ' VM is not supported on this platform - skipping') |
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
813 continue |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
814 |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
815 vmDir = join(vmLibDirInJdk(jdk), vm) |
4417
648a7873cea2
Made it possible to build and run the client and server VM with a new '--vm' option to 'mx build' and a global option of the same name.
Doug Simon <doug.simon@oracle.com>
parents:
4407
diff
changeset
|
816 if not exists(vmDir): |
17233
a02c295218aa
mx: add support for cygwin
Bernhard Urban <bernhard.urban@jku.at>
parents:
17055
diff
changeset
|
817 chmodRecursive(jdk, JDK_UNIX_PERMISSIONS_DIR) |
14780
aaecb0ca0c7d
fixed hard coded reference to JDK7
Doug Simon <doug.simon@oracle.com>
parents:
14777
diff
changeset
|
818 mx.log('Creating VM directory in JDK: ' + vmDir) |
4417
648a7873cea2
Made it possible to build and run the client and server VM with a new '--vm' option to 'mx build' and a global option of the same name.
Doug Simon <doug.simon@oracle.com>
parents:
4407
diff
changeset
|
819 os.makedirs(vmDir) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
820 |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
821 def filterXusage(line): |
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
822 if not 'Xusage.txt' in line: |
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
823 sys.stderr.write(line + os.linesep) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
824 |
5239
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
825 # Check if a build really needs to be done |
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
826 timestampFile = join(vmDir, '.build-timestamp') |
9098
d766fd8eede0
VM copy made during initial copy of the JDK is now named 'boot' instead of 'server0' to better reflect that it is the default VM (which may not be 'server') from the boot JDK
Doug Simon <doug.simon@oracle.com>
parents:
9097
diff
changeset
|
827 if opts2.force or not exists(timestampFile): |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
828 mustBuild = True |
5239
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
829 else: |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
830 mustBuild = False |
5239
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
831 timestamp = os.path.getmtime(timestampFile) |
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
832 sources = [] |
22054 | 833 for d in ['src', 'make', join('jvmci', 'jdk.internal.jvmci.hotspot', 'src_gen', 'hotspot')]: |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
834 for root, dirnames, files in os.walk(join(_suite.dir, d)): |
5239
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
835 # ignore <graal>/src/share/tools |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
836 if root == join(_suite.dir, 'src', 'share'): |
5244
55ff4ba8d7b1
ignore src/share/tools directory in native build out-of-date check
Doug Simon <doug.simon@oracle.com>
parents:
5239
diff
changeset
|
837 dirnames.remove('tools') |
55ff4ba8d7b1
ignore src/share/tools directory in native build out-of-date check
Doug Simon <doug.simon@oracle.com>
parents:
5239
diff
changeset
|
838 sources += [join(root, name) for name in files] |
5239
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
839 for f in sources: |
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
840 if len(f) != 0 and os.path.getmtime(f) > timestamp: |
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
841 mustBuild = True |
5244
55ff4ba8d7b1
ignore src/share/tools directory in native build out-of-date check
Doug Simon <doug.simon@oracle.com>
parents:
5239
diff
changeset
|
842 break |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
843 |
5239
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
844 if not mustBuild: |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
845 mx.logv('[all files in src and make directories are older than ' + timestampFile[len(_suite.dir) + 1:] + ' - skipping native build]') |
5239
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
846 continue |
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
847 |
17318
c75bb9cd1994
mx: force installation of distrubtion on windows
Bernhard Urban <bernhard.urban@jku.at>
parents:
17317
diff
changeset
|
848 if isWindows: |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
849 t_compilelogfile = mx._cygpathU2W(os.path.join(_suite.dir, "graalCompile.log")) |
4252
67e88b7624d5
Removed need for GRAAL environment variable on Windows.
Doug Simon <doug.simon@oracle.com>
parents:
4247
diff
changeset
|
850 mksHome = mx.get_env('MKS_HOME', 'C:\\cygwin\\bin') |
67e88b7624d5
Removed need for GRAAL environment variable on Windows.
Doug Simon <doug.simon@oracle.com>
parents:
4247
diff
changeset
|
851 |
4572
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4559
diff
changeset
|
852 variant = {'client': 'compiler1', 'server': 'compiler2'}.get(vm, vm) |
76841bdd5f3e
(Windows) Add Graal build configurations (with GRAAL defined) and fix build command.
Andreas Woess <andreas.woess@jku.at>
parents:
4559
diff
changeset
|
853 project_config = variant + '_' + build |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
854 jvmciHome = mx._cygpathU2W(_suite.dir) |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
855 _runInDebugShell('msbuild ' + jvmciHome + r'\build\vs-amd64\jvm.vcproj /p:Configuration=' + project_config + ' /target:clean', jvmciHome) |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
856 winCompileCmd = r'set HotSpotMksHome=' + mksHome + r'& set OUT_DIR=' + mx._cygpathU2W(jdk) + r'& set JAVA_HOME=' + mx._cygpathU2W(jdk) + r'& set path=%JAVA_HOME%\bin;%path%;%HotSpotMksHome%& cd /D "' + jvmciHome + r'\make\windows"& call create.bat ' + jvmciHome |
13967
4cd7c6629841
mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents:
13952
diff
changeset
|
857 print winCompileCmd |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
858 winCompileSuccess = re.compile(r"^Writing \.vcxproj file:") |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
859 if not _runInDebugShell(winCompileCmd, jvmciHome, t_compilelogfile, winCompileSuccess): |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
860 mx.log('Error executing create command') |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
861 return |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
862 winBuildCmd = 'msbuild ' + jvmciHome + r'\build\vs-amd64\jvm.vcxproj /p:Configuration=' + project_config + ' /p:Platform=x64' |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
863 if not _runInDebugShell(winBuildCmd, jvmciHome, t_compilelogfile): |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
864 mx.log('Error building project') |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
865 return |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
866 else: |
18876
c446d00f2cdf
mx: added support for Jython 2.7b3 and made ordering in generated files more deterministic\nContributed-by: Igor Ignatyev <igor.ignatyev@oracle.com>
Doug Simon <doug.simon@oracle.com>
parents:
18869
diff
changeset
|
867 cpus = mx.cpu_count() |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
868 makeDir = join(_suite.dir, 'make') |
16022
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
869 runCmd = [mx.gmake_cmd(), '-C', makeDir] |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
870 |
8884
51a8368d0231
Adapt to changes in hotspot makefiles : pass our JAVA_HOME as ALT_BOOTDIR (so that things are built with a 'safe' jdk) and our jdk copy as JAVA_HOME (so that the jvm gets installed there)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8647
diff
changeset
|
871 env = os.environ.copy() |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
872 |
16022
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
873 # These must be passed as environment variables |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
874 env.setdefault('LANG', 'C') |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
875 env['JAVA_HOME'] = jdk |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
876 |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
877 def setMakeVar(name, default, env=None): |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
878 """Sets a make variable on the command line to the value |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
879 of the variable in 'env' with the same name if defined |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
880 and 'env' is not None otherwise to 'default' |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
881 """ |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
882 runCmd.append(name + '=' + (env.get(name, default) if env else default)) |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
883 |
9116
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
884 if opts2.D: |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
885 for nv in opts2.D: |
e2dae636732a
added 'mx buildvars' command to list (some of) the variables that can be passed to 'mx build' with the -D option
Doug Simon <doug.simon@oracle.com>
parents:
9098
diff
changeset
|
886 name, value = nv.split('=', 1) |
16022
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
887 setMakeVar(name.strip(), value) |
13846
1e72cd05b77e
hs build: add graal tag to hotspot build version
Bernhard Urban <bernhard.urban@jku.at>
parents:
13761
diff
changeset
|
888 |
16022
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
889 setMakeVar('ARCH_DATA_MODEL', '64', env=env) |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
890 setMakeVar('HOTSPOT_BUILD_JOBS', str(cpus), env=env) |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
891 setMakeVar('ALT_BOOTDIR', mx.java().jdk, env=env) |
21740
6c3c21d9b5ef
Add -m switch to mx build, which builds/exports JVMCI with the make/jvmci.make file
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21720
diff
changeset
|
892 setMakeVar("EXPORT_PATH", jdk) |
16022
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
893 |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
894 setMakeVar('MAKE_VERBOSE', 'y' if mx._opts.verbose else '') |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
895 if vm.endswith('nojvmci'): |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
896 setMakeVar('INCLUDE_JVMCI', 'false') |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
897 setMakeVar('ALT_OUTPUTDIR', join(_suite.dir, 'build-nojvmci', mx.get_os()), env=env) |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
898 else: |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
899 version = _suite.release_version() |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
900 setMakeVar('USER_RELEASE_SUFFIX', 'jvmci-' + version) |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
901 setMakeVar('INCLUDE_JVMCI', 'true') |
16022
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
902 setMakeVar('INSTALL', 'y', env=env) |
17307
f0364a8ec40e
force USE_CLANG when building on MacOS
Doug Simon <doug.simon@oracle.com>
parents:
17262
diff
changeset
|
903 if mx.get_os() == 'darwin' and platform.mac_ver()[0] != '': |
f0364a8ec40e
force USE_CLANG when building on MacOS
Doug Simon <doug.simon@oracle.com>
parents:
17262
diff
changeset
|
904 # Force use of clang on MacOS |
f0364a8ec40e
force USE_CLANG when building on MacOS
Doug Simon <doug.simon@oracle.com>
parents:
17262
diff
changeset
|
905 setMakeVar('USE_CLANG', 'true') |
13967
4cd7c6629841
mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents:
13952
diff
changeset
|
906 if mx.get_os() == 'solaris': |
6702
602ee4d1db61
added setup of ENFORCE_COMPILER_REV and ENFORCE_CC_COMPILER_REV when using sunstudio compilers on Solaris to avoid build complaint from HotSpot makefiles.
Laurent Daynes <Laurent.Daynes@oracle.com>
parents:
6701
diff
changeset
|
907 # If using sparcWorks, setup flags to avoid make complaining about CC version |
602ee4d1db61
added setup of ENFORCE_COMPILER_REV and ENFORCE_CC_COMPILER_REV when using sunstudio compilers on Solaris to avoid build complaint from HotSpot makefiles.
Laurent Daynes <Laurent.Daynes@oracle.com>
parents:
6701
diff
changeset
|
908 cCompilerVersion = subprocess.Popen('CC -V', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).stderr.readlines()[0] |
13967
4cd7c6629841
mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents:
13952
diff
changeset
|
909 if cCompilerVersion.startswith('CC: Sun C++'): |
6702
602ee4d1db61
added setup of ENFORCE_COMPILER_REV and ENFORCE_CC_COMPILER_REV when using sunstudio compilers on Solaris to avoid build complaint from HotSpot makefiles.
Laurent Daynes <Laurent.Daynes@oracle.com>
parents:
6701
diff
changeset
|
910 compilerRev = cCompilerVersion.split(' ')[3] |
16022
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
911 setMakeVar('ENFORCE_COMPILER_REV', compilerRev, env=env) |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
912 setMakeVar('ENFORCE_CC_COMPILER_REV', compilerRev, env=env) |
6718
cce59a7ee92c
Avoids stripping libjvm.so when building debug on Solaris (.debuginfo files don't work well with Oracle Solaris Studio 12.3's solaris).
Laurent Daynes <Laurent.Daynes@oracle.com>
parents:
6705
diff
changeset
|
913 if build == 'jvmg': |
16022
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
914 # We want ALL the symbols when debugging on Solaris |
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
915 setMakeVar('STRIP_POLICY', 'no_strip') |
6276
03c4c25ae726
disabled zipping of lib*.debuginfo files to simplify debugging with gdb
Doug Simon <doug.simon@oracle.com>
parents:
5881
diff
changeset
|
916 # This removes the need to unzip the *.diz files before debugging in gdb |
16022
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
917 setMakeVar('ZIP_DEBUGINFO_FILES', '0', env=env) |
21791
cd36556e1b78
Remove conditional makefile-based compilation of jvmci from mx_graal.py
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21790
diff
changeset
|
918 |
cd36556e1b78
Remove conditional makefile-based compilation of jvmci from mx_graal.py
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21790
diff
changeset
|
919 if buildSuffix == "1": |
21910
cf7b06489764
mx: Define BUILD_CLIENT_ONLY instead of setting JVM_VARIANTS when building client compiler
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21892
diff
changeset
|
920 setMakeVar("BUILD_CLIENT_ONLY", "true") |
21791
cd36556e1b78
Remove conditional makefile-based compilation of jvmci from mx_graal.py
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21790
diff
changeset
|
921 |
19733
3f7cd3c36734
mx_graal: do not clear LD_LIBRARY_PATH before invoking make
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19691
diff
changeset
|
922 # Clear this variable as having it set can cause very confusing build problems |
4582
b24386206122
Made all vm builds go into subdirectories, even product builds to simplify building the various types of VMs (server, client and graal).
Doug Simon <doug.simon@oracle.com>
parents:
4577
diff
changeset
|
923 env.pop('CLASSPATH', None) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
924 |
16031
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
925 # Issue an env prefix that can be used to run the make on the command line |
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
926 if not mx._opts.verbose: |
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
927 mx.log('--------------- make command line ----------------------') |
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
928 |
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
929 envPrefix = ' '.join([key + '=' + env[key] for key in env.iterkeys() if not os.environ.has_key(key) or env[key] != os.environ[key]]) |
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
930 if len(envPrefix): |
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
931 mx.log('env ' + envPrefix + ' \\') |
21791
cd36556e1b78
Remove conditional makefile-based compilation of jvmci from mx_graal.py
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21790
diff
changeset
|
932 |
cd36556e1b78
Remove conditional makefile-based compilation of jvmci from mx_graal.py
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21790
diff
changeset
|
933 runCmd.append(build + buildSuffix) |
cd36556e1b78
Remove conditional makefile-based compilation of jvmci from mx_graal.py
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21790
diff
changeset
|
934 runCmd.append("docs") |
cd36556e1b78
Remove conditional makefile-based compilation of jvmci from mx_graal.py
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21790
diff
changeset
|
935 runCmd.append("export_" + build) |
16031
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
936 |
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
937 if not mx._opts.verbose: |
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
938 mx.log(' '.join(runCmd)) |
cd2209d3af46
mx: show the environment variables defined and make command line issued when doing a HotSpot build
Doug Simon <doug.simon@oracle.com>
parents:
16022
diff
changeset
|
939 mx.log('--------------------------------------------------------') |
16022
3f350b0d93c9
pass make variables on the command line instead of in environment variables to simplify running the make on the command line without mx
Doug Simon <doug.simon@oracle.com>
parents:
16002
diff
changeset
|
940 mx.run(runCmd, err=filterXusage, env=env) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
941 |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
942 jvmCfg = getVmCfgInJdk(jdk) |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4540
diff
changeset
|
943 if not exists(jvmCfg): |
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4540
diff
changeset
|
944 mx.abort(jvmCfg + ' does not exist') |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
945 |
8901
8ddaac81cb21
Be more careful while updating jvm.cfg (fixes a bug where the -server configuration would overwrite the -server0 one)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8900
diff
changeset
|
946 prefix = '-' + vm + ' ' |
8ddaac81cb21
Be more careful while updating jvm.cfg (fixes a bug where the -server configuration would overwrite the -server0 one)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8900
diff
changeset
|
947 vmKnown = prefix + 'KNOWN\n' |
8889
c669e8e621a1
Update the -client line in jvm.cfg when it already exists (ie IGNORE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8887
diff
changeset
|
948 lines = [] |
c669e8e621a1
Update the -client line in jvm.cfg when it already exists (ie IGNORE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8887
diff
changeset
|
949 found = False |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4540
diff
changeset
|
950 with open(jvmCfg) as f: |
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4540
diff
changeset
|
951 for line in f: |
8889
c669e8e621a1
Update the -client line in jvm.cfg when it already exists (ie IGNORE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8887
diff
changeset
|
952 if line.strip() == vmKnown.strip(): |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4540
diff
changeset
|
953 found = True |
8889
c669e8e621a1
Update the -client line in jvm.cfg when it already exists (ie IGNORE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8887
diff
changeset
|
954 lines.append(line) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
955 |
4559
723df37192d6
Make it possible again to build a real client libjvm, drop the UseGraal flag.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4540
diff
changeset
|
956 if not found: |
21990
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
957 mx.log('Prepending "' + prefix + 'KNOWN" to ' + jvmCfg) |
6688
806821a1c0a8
Make sure files in copy of JDK has write-protection unset before modifying it.
Laurent Daynes <Laurent.Daynes@oracle.com>
parents:
6687
diff
changeset
|
958 if mx.get_os() != 'windows': |
16627
68deb37eed70
mx: fix permissions of copied bootstrap JDK files (don't make everything executable)
Bernhard Urban <bernhard.urban@jku.at>
parents:
16623
diff
changeset
|
959 os.chmod(jvmCfg, JDK_UNIX_PERMISSIONS_FILE) |
8889
c669e8e621a1
Update the -client line in jvm.cfg when it already exists (ie IGNORE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8887
diff
changeset
|
960 with open(jvmCfg, 'w') as f: |
21990
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
961 written = False |
8889
c669e8e621a1
Update the -client line in jvm.cfg when it already exists (ie IGNORE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8887
diff
changeset
|
962 for line in lines: |
21990
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
963 if line.startswith('#'): |
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
964 f.write(line) |
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
965 continue |
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
966 if not written: |
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
967 f.write(vmKnown) |
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
968 if vm == 'jvmci': |
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
969 # Legacy support |
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
970 f.write('-graal ALIASED_TO -jvmci\n') |
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
971 written = True |
8889
c669e8e621a1
Update the -client line in jvm.cfg when it already exists (ie IGNORE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8887
diff
changeset
|
972 if line.startswith(prefix): |
c669e8e621a1
Update the -client line in jvm.cfg when it already exists (ie IGNORE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8887
diff
changeset
|
973 line = vmKnown |
21990
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
974 if written: |
2a98e51646c2
Graal VM should be the default one after building basic-graal. Prepending rather than appending selected DEFAULT_VM to jvm.cfg file.
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
21976
diff
changeset
|
975 continue |
8889
c669e8e621a1
Update the -client line in jvm.cfg when it already exists (ie IGNORE)
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8887
diff
changeset
|
976 f.write(line) |
5194
a6eceb5efb0e
added --ecl option to mx for saving VM execution(s) as Eclipse launch configurations
Doug Simon <doug.simon@oracle.com>
parents:
5189
diff
changeset
|
977 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
978 for jdkDist in jdkDeployedDists: # Install non HotSpot distribution |
21741
b6ee5d3f3255
Exclude distributions from exporting which are delivered with HotSpot (JBS:GRAAL-52)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21740
diff
changeset
|
979 if not jdkDist.partOfHotSpot: |
b6ee5d3f3255
Exclude distributions from exporting which are delivered with HotSpot (JBS:GRAAL-52)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21740
diff
changeset
|
980 _installDistInJdks(jdkDist) |
5239
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
981 if exists(timestampFile): |
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
982 os.utime(timestampFile, None) |
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
983 else: |
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
984 file(timestampFile, 'a') |
b9db4fee6eb2
skip a native build if all files in src and make are older than the timestamp of the previous build
Doug Simon <doug.simon@oracle.com>
parents:
5234
diff
changeset
|
985 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
986 """ |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
987 The base list of JaCoCo includes. |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
988 """ |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
989 jacocoIncludes = ['@Test'] |
5257
a549662f6c6f
added 'vmg' and 'vmfg' commands to mx as convenient aliases for running the debug and fastdebug builds of the selected VM
Doug Simon <doug.simon@oracle.com>
parents:
5245
diff
changeset
|
990 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
991 """ |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
992 The list of annotations which if present denote a class that should |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
993 be excluded from JaCoCo analysis. |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
994 """ |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
995 jacocoExcludedAnnotations = ['@Test'] |
5257
a549662f6c6f
added 'vmg' and 'vmfg' commands to mx as convenient aliases for running the debug and fastdebug builds of the selected VM
Doug Simon <doug.simon@oracle.com>
parents:
5245
diff
changeset
|
996 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
997 def parseVmArgs(args, vm=None, cwd=None, vmbuild=None): |
4575
ccb5369481a2
Clarified mx help text on how to build/run [Graal|Client|Server].
Doug Simon <doug.simon@oracle.com>
parents:
4572
diff
changeset
|
998 """run the VM selected by the '--vm' option""" |
4219
47f7d91d34cf
Fix javac build issues with classpath
Gilles Duboscq <gilles.m.duboscq@gmail.com>
parents:
4216
diff
changeset
|
999 |
4417
648a7873cea2
Made it possible to build and run the client and server VM with a new '--vm' option to 'mx build' and a global option of the same name.
Doug Simon <doug.simon@oracle.com>
parents:
4407
diff
changeset
|
1000 if vm is None: |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1001 vm = get_vm() |
14162 | 1002 |
14602
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
1003 if not isVMSupported(vm): |
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
1004 mx.abort('The ' + vm + ' is not supported on this platform') |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1005 |
10454
590b0c26877f
mx: add --workdir argument
Bernhard Urban <bernhard.urban@jku.at>
parents:
10417
diff
changeset
|
1006 if cwd is None: |
11401
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
1007 cwd = _vm_cwd |
11424
ece40b452e65
mx: Fix commands.vm when an explicit cwd is passed and no --vmcwd is given
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11415
diff
changeset
|
1008 elif _vm_cwd is not None and _vm_cwd != cwd: |
11401
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
1009 mx.abort("conflicting working directories: do not set --vmcwd for this command") |
10454
590b0c26877f
mx: add --workdir argument
Bernhard Urban <bernhard.urban@jku.at>
parents:
10417
diff
changeset
|
1010 |
22019
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
1011 build = vmbuild if vmbuild else _vmbuild |
22277
a48774f9b97a
renamed mx_jvmci.get_jdk() to mx_jvmci.get_jvmci_jdk()
Doug Simon <doug.simon@oracle.com>
parents:
22274
diff
changeset
|
1012 jdk = get_jvmci_jdk(build, vmToCheck=vm, installJars=False) |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1013 _updateInstalledJVMCIOptionsFile(jdk) |
5189
6fbf12b8e572
automated download of hsdis lib if PrintAssembly option is used; added support for hsdis on the Mac
Doug Simon <doug.simon@oracle.com>
parents:
5153
diff
changeset
|
1014 mx.expand_project_in_args(args) |
5194
a6eceb5efb0e
added --ecl option to mx for saving VM execution(s) as Eclipse launch configurations
Doug Simon <doug.simon@oracle.com>
parents:
5189
diff
changeset
|
1015 if _make_eclipse_launch: |
22171 | 1016 mx.make_eclipse_launch(_suite, args, _suite.name + '-' + build, name=None, deps=mx.dependencies()) |
5024
7ccdae96e98a
Allow JaCoCon to append to the execution file
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5016
diff
changeset
|
1017 if _jacoco == 'on' or _jacoco == 'append': |
4684
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1018 jacocoagent = mx.library("JACOCOAGENT", True) |
5366
67e63e8dcbd2
build JaCoCo exclude list by scanning for snippets
Doug Simon <doug.simon@oracle.com>
parents:
5295
diff
changeset
|
1019 # Exclude all compiler tests and snippets |
17363
4f9633b83a24
mx: reduce size of exculde command line argument and fold it into package-star expressions
Bernhard Urban <bernhard.urban@jku.at>
parents:
17356
diff
changeset
|
1020 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1021 includes = list(jacocoIncludes) |
18894
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1022 baseExcludes = [] |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1023 for p in mx.projects(): |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1024 projsetting = getattr(p, 'jacoco', '') |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1025 if projsetting == 'exclude': |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1026 baseExcludes.append(p.name) |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1027 if projsetting == 'include': |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1028 includes.append(p.name + '.*') |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1029 |
17363
4f9633b83a24
mx: reduce size of exculde command line argument and fold it into package-star expressions
Bernhard Urban <bernhard.urban@jku.at>
parents:
17356
diff
changeset
|
1030 def _filter(l): |
4f9633b83a24
mx: reduce size of exculde command line argument and fold it into package-star expressions
Bernhard Urban <bernhard.urban@jku.at>
parents:
17356
diff
changeset
|
1031 # filter out specific classes which are already covered by a baseExclude package |
4f9633b83a24
mx: reduce size of exculde command line argument and fold it into package-star expressions
Bernhard Urban <bernhard.urban@jku.at>
parents:
17356
diff
changeset
|
1032 return [clazz for clazz in l if not any([clazz.startswith(package) for package in baseExcludes])] |
4f9633b83a24
mx: reduce size of exculde command line argument and fold it into package-star expressions
Bernhard Urban <bernhard.urban@jku.at>
parents:
17356
diff
changeset
|
1033 excludes = [] |
5366
67e63e8dcbd2
build JaCoCo exclude list by scanning for snippets
Doug Simon <doug.simon@oracle.com>
parents:
5295
diff
changeset
|
1034 for p in mx.projects(): |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1035 excludes += _filter(p.find_classes_with_annotations(None, jacocoExcludedAnnotations, includeInnerClasses=True).keys()) |
17363
4f9633b83a24
mx: reduce size of exculde command line argument and fold it into package-star expressions
Bernhard Urban <bernhard.urban@jku.at>
parents:
17356
diff
changeset
|
1036 excludes += _filter(p.find_classes_with_matching_source_line(None, lambda line: 'JaCoCo Exclude' in line, includeInnerClasses=True).keys()) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1037 |
17363
4f9633b83a24
mx: reduce size of exculde command line argument and fold it into package-star expressions
Bernhard Urban <bernhard.urban@jku.at>
parents:
17356
diff
changeset
|
1038 excludes += [package + '.*' for package in baseExcludes] |
4684
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1039 agentOptions = { |
5024
7ccdae96e98a
Allow JaCoCon to append to the execution file
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5016
diff
changeset
|
1040 'append' : 'true' if _jacoco == 'append' else 'false', |
4684
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1041 'bootclasspath' : 'true', |
5881
472a648769e4
better JaCoCo : only include com.oracle.graal.* and com.oracle.max.*, exclude com.oracle.graal.jtt.*
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5878
diff
changeset
|
1042 'includes' : ':'.join(includes), |
5878
191e08da4de4
Apply jacoco coverage to all gate tests
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5877
diff
changeset
|
1043 'excludes' : ':'.join(excludes), |
191e08da4de4
Apply jacoco coverage to all gate tests
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5877
diff
changeset
|
1044 'destfile' : 'jacoco.exec' |
4684
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1045 } |
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1046 args = ['-javaagent:' + jacocoagent.get_path(True) + '=' + ','.join([k + '=' + v for k, v in agentOptions.items()])] + args |
5596
e4b1bc5e29e0
hsdis library is downloaded into newly created Graal JDK
Doug Simon <doug.simon@oracle.com>
parents:
5517
diff
changeset
|
1047 exe = join(jdk, 'bin', mx.exe_suffix('java')) |
11401
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
1048 pfx = _vm_prefix.split() if _vm_prefix is not None else [] |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1049 |
9667
1ef7b26e9177
mx/commands.py: warn about arguments after '-version' when launching the vm
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9639
diff
changeset
|
1050 if '-version' in args: |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1051 ignoredArgs = args[args.index('-version') + 1:] |
9667
1ef7b26e9177
mx/commands.py: warn about arguments after '-version' when launching the vm
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9639
diff
changeset
|
1052 if len(ignoredArgs) > 0: |
1ef7b26e9177
mx/commands.py: warn about arguments after '-version' when launching the vm
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9639
diff
changeset
|
1053 mx.log("Warning: The following options will be ignored by the vm because they come after the '-version' argument: " + ' '.join(ignoredArgs)) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1054 |
13952
b076b5c13c3f
mx: factor out JavaConfig.processArgs and use it in mx vm. remove default -J arguments.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13951
diff
changeset
|
1055 args = mx.java().processArgs(args) |
13951
392b6ac8da36
Allow using run_java without the arguments from -J -Ja -Jp. Factor out the argument processing of mx_graal.vm and use it to pass tested-vm args down through the jmh harness
Bernhard Urban <bernhard.urban@jku.at>
parents:
13949
diff
changeset
|
1056 return (pfx, exe, vm, args, cwd) |
392b6ac8da36
Allow using run_java without the arguments from -J -Ja -Jp. Factor out the argument processing of mx_graal.vm and use it to pass tested-vm args down through the jmh harness
Bernhard Urban <bernhard.urban@jku.at>
parents:
13949
diff
changeset
|
1057 |
392b6ac8da36
Allow using run_java without the arguments from -J -Ja -Jp. Factor out the argument processing of mx_graal.vm and use it to pass tested-vm args down through the jmh harness
Bernhard Urban <bernhard.urban@jku.at>
parents:
13949
diff
changeset
|
1058 def vm(args, vm=None, nonZeroIsFatal=True, out=None, err=None, cwd=None, timeout=None, vmbuild=None): |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1059 (pfx_, exe_, vm_, args_, cwd) = parseVmArgs(args, vm, cwd, vmbuild) |
13951
392b6ac8da36
Allow using run_java without the arguments from -J -Ja -Jp. Factor out the argument processing of mx_graal.vm and use it to pass tested-vm args down through the jmh harness
Bernhard Urban <bernhard.urban@jku.at>
parents:
13949
diff
changeset
|
1060 return mx.run(pfx_ + [exe_, '-' + vm_] + args_, nonZeroIsFatal=nonZeroIsFatal, out=out, err=err, cwd=cwd, timeout=timeout) |
3718 | 1061 |
22182
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1062 def _unittest_config_participant(config): |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1063 vmArgs, mainClass, mainClassArgs = config |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1064 if isJVMCIEnabled(get_vm()): |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1065 # Remove entries from class path that are in JVMCI loaded jars |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1066 cpIndex, cp = mx.find_classpath_arg(vmArgs) |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1067 if cp: |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1068 excluded = set() |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1069 for jdkDist in jdkDeployedDists: |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1070 dist = mx.distribution(jdkDist.name) |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1071 excluded.update([d.output_dir() for d in dist.archived_deps() if d.isJavaProject()]) |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1072 cp = os.pathsep.join([e for e in cp.split(os.pathsep) if e not in excluded]) |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1073 vmArgs[cpIndex] = cp |
18351 | 1074 |
22182
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1075 # Run the VM in a mode where application/test classes can |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1076 # access JVMCI loaded classes. |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1077 vmArgs = ['-XX:-UseJVMCIClassLoader'] + vmArgs |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1078 return (vmArgs, mainClass, mainClassArgs) |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1079 return config |
16395
ad431bf0de07
added support to load classes from graal.jar with a separate class loader
Doug Simon <doug.simon@oracle.com>
parents:
16394
diff
changeset
|
1080 |
22182
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1081 def _unittest_vm_launcher(vmArgs, mainClass, mainClassArgs): |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1082 vm(vmArgs + [mainClass] + mainClassArgs) |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1083 |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1084 mx_unittest.add_config_participant(_unittest_config_participant) |
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1085 mx_unittest.set_vm_launcher('JVMCI VM launcher', _unittest_vm_launcher) |
8340
d9d883aeb96f
unittest: seperate target `longunittest' and `shortunittest'
Bernhard Urban <bernhard.urban@jku.at>
parents:
8317
diff
changeset
|
1086 |
d9d883aeb96f
unittest: seperate target `longunittest' and `shortunittest'
Bernhard Urban <bernhard.urban@jku.at>
parents:
8317
diff
changeset
|
1087 def shortunittest(args): |
22020
36a7ec14279d
moved unit test support from mx_graal.py to mx.py
Doug Simon <doug.simon@oracle.com>
parents:
22019
diff
changeset
|
1088 """alias for 'unittest --whitelist test/whitelist_shortunittest.txt'""" |
8340
d9d883aeb96f
unittest: seperate target `longunittest' and `shortunittest'
Bernhard Urban <bernhard.urban@jku.at>
parents:
8317
diff
changeset
|
1089 |
15324
5b5f47104c0d
mx: add whitelist for shortunittest
Bernhard Urban <bernhard.urban@jku.at>
parents:
15323
diff
changeset
|
1090 args = ['--whitelist', 'test/whitelist_shortunittest.txt'] + args |
22182
9bbd878b17af
use unittest extensibility
Doug Simon <doug.simon@oracle.com>
parents:
22181
diff
changeset
|
1091 mx_unittest.unittest(args) |
8340
d9d883aeb96f
unittest: seperate target `longunittest' and `shortunittest'
Bernhard Urban <bernhard.urban@jku.at>
parents:
8317
diff
changeset
|
1092 |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1093 def buildvms(args): |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1094 """build one or more VMs in various configurations""" |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1095 |
11296
4e943a311d9c
mx presents a command line dialogue to select the default VM if it is not configured (GRAAL-416)
Doug Simon <doug.simon@oracle.com>
parents:
11287
diff
changeset
|
1096 vmsDefault = ','.join(_vmChoices.keys()) |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
1097 vmbuildsDefault = ','.join(_vmbuildChoices) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1098 |
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1099 parser = ArgumentParser(prog='mx buildvms') |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
1100 parser.add_argument('--vms', help='a comma separated list of VMs to build (default: ' + vmsDefault + ')', metavar='<args>', default=vmsDefault) |
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
1101 parser.add_argument('--builds', help='a comma separated list of build types (default: ' + vmbuildsDefault + ')', metavar='<args>', default=vmbuildsDefault) |
21043
5ea65fe64368
Check distributions overlap in gate
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21040
diff
changeset
|
1102 parser.add_argument('--check-distributions', action='store_true', dest='check_distributions', help='check built distributions for overlap') |
9096
d4b868ed9cfb
buildvms command now runs "java -version" for each VM built unless -n option is specified
Doug Simon <doug.simon@oracle.com>
parents:
9095
diff
changeset
|
1103 parser.add_argument('-n', '--no-check', action='store_true', help='omit running "java -version" after each build') |
9097
a0ab945fb95f
build output during buildvms command is sent to console (instead of log files) if -c option is given
Doug Simon <doug.simon@oracle.com>
parents:
9096
diff
changeset
|
1104 parser.add_argument('-c', '--console', action='store_true', help='send build output to console instead of log file') |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1105 |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1106 args = parser.parse_args(args) |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1107 vms = args.vms.split(',') |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1108 builds = args.builds.split(',') |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1109 |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1110 allStart = time.time() |
21043
5ea65fe64368
Check distributions overlap in gate
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21040
diff
changeset
|
1111 check_dists_args = ['--check-distributions'] if args.check_distributions else [] |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1112 for v in vms: |
14602
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
1113 if not isVMSupported(v): |
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
1114 mx.log('The ' + v + ' VM is not supported on this platform - skipping') |
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
1115 continue |
591f4a575ebf
issue warning/error where ever relevant if a non-supported VM (e.g., client VM on Mac) is used in mx
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
1116 |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1117 for vmbuild in builds: |
9117
cbfcb1054619
renamed 'boot' VM to 'original' VM
Doug Simon <doug.simon@oracle.com>
parents:
9116
diff
changeset
|
1118 if v == 'original' and vmbuild != 'product': |
9095
d538dce8f403
support for non-GRAAL VMs co-existing with GRAAL VMs
Doug Simon <doug.simon@oracle.com>
parents:
9010
diff
changeset
|
1119 continue |
9097
a0ab945fb95f
build output during buildvms command is sent to console (instead of log files) if -c option is given
Doug Simon <doug.simon@oracle.com>
parents:
9096
diff
changeset
|
1120 if not args.console: |
a0ab945fb95f
build output during buildvms command is sent to console (instead of log files) if -c option is given
Doug Simon <doug.simon@oracle.com>
parents:
9096
diff
changeset
|
1121 logFile = join(v + '-' + vmbuild + '.log') |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1122 log = open(join(_suite.dir, logFile), 'wb') |
9097
a0ab945fb95f
build output during buildvms command is sent to console (instead of log files) if -c option is given
Doug Simon <doug.simon@oracle.com>
parents:
9096
diff
changeset
|
1123 start = time.time() |
a0ab945fb95f
build output during buildvms command is sent to console (instead of log files) if -c option is given
Doug Simon <doug.simon@oracle.com>
parents:
9096
diff
changeset
|
1124 mx.log('BEGIN: ' + v + '-' + vmbuild + '\t(see: ' + logFile + ')') |
17317
f434913f9cba
mx: buildvms should inherit verbosity
Bernhard Urban <bernhard.urban@jku.at>
parents:
17307
diff
changeset
|
1125 verbose = ['-v'] if mx._opts.verbose else [] |
9097
a0ab945fb95f
build output during buildvms command is sent to console (instead of log files) if -c option is given
Doug Simon <doug.simon@oracle.com>
parents:
9096
diff
changeset
|
1126 # Run as subprocess so that output can be directed to a file |
22180
04ecedece09a
use the correct my.py when launching an mx subprocess
Doug Simon <doug.simon@oracle.com>
parents:
22179
diff
changeset
|
1127 cmd = [sys.executable, '-u', mx.__file__] + verbose + ['--vm', v, '--vmbuild', vmbuild, 'build'] + check_dists_args |
17317
f434913f9cba
mx: buildvms should inherit verbosity
Bernhard Urban <bernhard.urban@jku.at>
parents:
17307
diff
changeset
|
1128 mx.logv("executing command: " + str(cmd)) |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1129 subprocess.check_call(cmd, cwd=_suite.dir, stdout=log, stderr=subprocess.STDOUT) |
9097
a0ab945fb95f
build output during buildvms command is sent to console (instead of log files) if -c option is given
Doug Simon <doug.simon@oracle.com>
parents:
9096
diff
changeset
|
1130 duration = datetime.timedelta(seconds=time.time() - start) |
a0ab945fb95f
build output during buildvms command is sent to console (instead of log files) if -c option is given
Doug Simon <doug.simon@oracle.com>
parents:
9096
diff
changeset
|
1131 mx.log('END: ' + v + '-' + vmbuild + '\t[' + str(duration) + ']') |
a0ab945fb95f
build output during buildvms command is sent to console (instead of log files) if -c option is given
Doug Simon <doug.simon@oracle.com>
parents:
9096
diff
changeset
|
1132 else: |
11371
74414b248381
mx: added --vmbuild global option, removed --product, --fastdebug, --debug options as well as suffix of build command
Doug Simon <doug.simon@oracle.com>
parents:
11368
diff
changeset
|
1133 with VM(v, vmbuild): |
21043
5ea65fe64368
Check distributions overlap in gate
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21040
diff
changeset
|
1134 build(check_dists_args) |
9096
d4b868ed9cfb
buildvms command now runs "java -version" for each VM built unless -n option is specified
Doug Simon <doug.simon@oracle.com>
parents:
9095
diff
changeset
|
1135 if not args.no_check: |
d4b868ed9cfb
buildvms command now runs "java -version" for each VM built unless -n option is specified
Doug Simon <doug.simon@oracle.com>
parents:
9095
diff
changeset
|
1136 vmargs = ['-version'] |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1137 if v == 'jvmci': |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1138 vmargs.insert(0, '-XX:-BootstrapJVMCI') |
9096
d4b868ed9cfb
buildvms command now runs "java -version" for each VM built unless -n option is specified
Doug Simon <doug.simon@oracle.com>
parents:
9095
diff
changeset
|
1139 vm(vmargs, vm=v, vmbuild=vmbuild) |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1140 allDuration = datetime.timedelta(seconds=time.time() - allStart) |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1141 mx.log('TOTAL TIME: ' + '[' + str(allDuration) + ']') |
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1142 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1143 |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1144 """ |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1145 Context manager for a single gate task that can prevent the |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1146 task from executing or time and log its execution. |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1147 """ |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1148 class Task: |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1149 # None or a list of strings. If not None, only tasks whose title |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1150 # matches at least one of the substrings in this list will return |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1151 # a non-None value from __enter__. The body of a 'with Task(...) as t' |
20002 | 1152 # statement should check 't' and exit immediately if it is None. |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1153 filters = None |
22179
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1154 startAtFilter = None |
21639
e65bf81961be
added -x option to gate command that makes --task-filter an exclusion filter
Doug Simon <doug.simon@oracle.com>
parents:
21635
diff
changeset
|
1155 filtersExclude = False |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1156 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1157 def __init__(self, title, tasks=None, disableJacoco=False): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1158 self.tasks = tasks |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1159 self.title = title |
22179
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1160 self.skipped = False |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1161 if tasks is not None: |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1162 if Task.startAtFilter: |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1163 assert not Task.filters |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1164 if Task.startAtFilter in title: |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1165 self.skipped = False |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1166 Task.startAtFilter = None |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1167 else: |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1168 self.skipped = True |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1169 elif Task.filters: |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1170 if Task.filtersExclude: |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1171 self.skipped = any([f in title for f in Task.filters]) |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1172 else: |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1173 self.skipped = not any([f in title for f in Task.filters]) |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1174 if not self.skipped: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1175 self.start = time.time() |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1176 self.end = None |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1177 self.duration = None |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1178 self.disableJacoco = disableJacoco |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1179 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: BEGIN: ') + title) |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1180 def __enter__(self): |
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1181 assert self.tasks is not None, "using Task with 'with' statement requires to pass the tasks list in the constructor" |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1182 if self.skipped: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1183 return None |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1184 if self.disableJacoco: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1185 self.jacacoSave = _jacoco |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1186 return self |
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1187 def __exit__(self, exc_type, exc_value, traceback): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1188 if not self.skipped: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1189 self.tasks.append(self.stop()) |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1190 if self.disableJacoco: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1191 global _jacoco |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1192 _jacoco = self.jacacoSave |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1193 |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1194 def stop(self): |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1195 self.end = time.time() |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1196 self.duration = datetime.timedelta(seconds=self.end - self.start) |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1197 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: END: ') + self.title + ' [' + str(self.duration) + ']') |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1198 return self |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1199 def abort(self, codeOrMessage): |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1200 self.end = time.time() |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1201 self.duration = datetime.timedelta(seconds=self.end - self.start) |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1202 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: ABORT: ') + self.title + ' [' + str(self.duration) + ']') |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1203 mx.abort(codeOrMessage) |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1204 return self |
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1205 |
17052
35fda668ed6e
mx: added ctw command to simplify executing CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
17015
diff
changeset
|
1206 def ctw(args): |
35fda668ed6e
mx: added ctw command to simplify executing CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
17015
diff
changeset
|
1207 """run CompileTheWorld""" |
17372
d42e11af980d
mx: simplified ctw command
Doug Simon <doug.simon@oracle.com>
parents:
17363
diff
changeset
|
1208 |
18106
7a771b48e392
mx: improved ctw command usage message and made the default value for --ctwopts be "-Inline"
Doug Simon <doug.simon@oracle.com>
parents:
17438
diff
changeset
|
1209 defaultCtwopts = '-Inline' |
7a771b48e392
mx: improved ctw command usage message and made the default value for --ctwopts be "-Inline"
Doug Simon <doug.simon@oracle.com>
parents:
17438
diff
changeset
|
1210 |
17372
d42e11af980d
mx: simplified ctw command
Doug Simon <doug.simon@oracle.com>
parents:
17363
diff
changeset
|
1211 parser = ArgumentParser(prog='mx ctw') |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1212 parser.add_argument('--ctwopts', action='store', help='space separated JVMCI options used for CTW compilations (default: --ctwopts="' + defaultCtwopts + '")', default=defaultCtwopts, metavar='<options>') |
18106
7a771b48e392
mx: improved ctw command usage message and made the default value for --ctwopts be "-Inline"
Doug Simon <doug.simon@oracle.com>
parents:
17438
diff
changeset
|
1213 parser.add_argument('--jar', action='store', help='jar of classes to compiled instead of rt.jar', metavar='<path>') |
17372
d42e11af980d
mx: simplified ctw command
Doug Simon <doug.simon@oracle.com>
parents:
17363
diff
changeset
|
1214 |
d42e11af980d
mx: simplified ctw command
Doug Simon <doug.simon@oracle.com>
parents:
17363
diff
changeset
|
1215 args, vmargs = parser.parse_known_args(args) |
17052
35fda668ed6e
mx: added ctw command to simplify executing CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
17015
diff
changeset
|
1216 |
17372
d42e11af980d
mx: simplified ctw command
Doug Simon <doug.simon@oracle.com>
parents:
17363
diff
changeset
|
1217 if args.ctwopts: |
d42e11af980d
mx: simplified ctw command
Doug Simon <doug.simon@oracle.com>
parents:
17363
diff
changeset
|
1218 vmargs.append('-G:CompileTheWorldConfig=' + args.ctwopts) |
17052
35fda668ed6e
mx: added ctw command to simplify executing CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
17015
diff
changeset
|
1219 |
17372
d42e11af980d
mx: simplified ctw command
Doug Simon <doug.simon@oracle.com>
parents:
17363
diff
changeset
|
1220 if args.jar: |
17392
9c241dc74cfc
mx: specify jar of classes differently depending on whether Graal is hosted or not
Doug Simon <doug.simon@oracle.com>
parents:
17388
diff
changeset
|
1221 jar = os.path.abspath(args.jar) |
17372
d42e11af980d
mx: simplified ctw command
Doug Simon <doug.simon@oracle.com>
parents:
17363
diff
changeset
|
1222 else: |
22277
a48774f9b97a
renamed mx_jvmci.get_jdk() to mx_jvmci.get_jvmci_jdk()
Doug Simon <doug.simon@oracle.com>
parents:
22274
diff
changeset
|
1223 jar = join(get_jvmci_jdk(installJars=False), 'jre', 'lib', 'rt.jar') |
20967
f61ff7f01bc2
Add CompileTheWorldExcludeMethodFilter to CTW and remove sun.awt.X11 classes from default ctw mx target.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
20922
diff
changeset
|
1224 vmargs.append('-G:CompileTheWorldExcludeMethodFilter=sun.awt.X11.*.*') |
17372
d42e11af980d
mx: simplified ctw command
Doug Simon <doug.simon@oracle.com>
parents:
17363
diff
changeset
|
1225 |
17392
9c241dc74cfc
mx: specify jar of classes differently depending on whether Graal is hosted or not
Doug Simon <doug.simon@oracle.com>
parents:
17388
diff
changeset
|
1226 vmargs += ['-XX:+CompileTheWorld'] |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1227 vm_ = get_vm() |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1228 if isJVMCIEnabled(vm_): |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1229 if vm_ == 'jvmci': |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1230 vmargs += ['-XX:+BootstrapJVMCI'] |
17411
6d82c240d83e
use -G:CompileTheWorldClasspath instead of -Xbootclasspath/p when doing Graal CTW on a Graal enabled VM
Doug Simon <doug.simon@oracle.com>
parents:
17392
diff
changeset
|
1231 vmargs += ['-G:CompileTheWorldClasspath=' + jar] |
17392
9c241dc74cfc
mx: specify jar of classes differently depending on whether Graal is hosted or not
Doug Simon <doug.simon@oracle.com>
parents:
17388
diff
changeset
|
1232 else: |
9c241dc74cfc
mx: specify jar of classes differently depending on whether Graal is hosted or not
Doug Simon <doug.simon@oracle.com>
parents:
17388
diff
changeset
|
1233 vmargs += ['-Xbootclasspath/p:' + jar] |
20020
af1e4c16b00f
suppress menubar and dock when running ctw on Mac
Doug Simon <doug.simon@oracle.com>
parents:
20012
diff
changeset
|
1234 |
20967
f61ff7f01bc2
Add CompileTheWorldExcludeMethodFilter to CTW and remove sun.awt.X11 classes from default ctw mx target.
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
20922
diff
changeset
|
1235 # suppress menubar and dock when running on Mac; exclude x11 classes as they may cause vm crashes (on Solaris) |
20020
af1e4c16b00f
suppress menubar and dock when running ctw on Mac
Doug Simon <doug.simon@oracle.com>
parents:
20012
diff
changeset
|
1236 vmargs = ['-Djava.awt.headless=true'] + vmargs |
af1e4c16b00f
suppress menubar and dock when running ctw on Mac
Doug Simon <doug.simon@oracle.com>
parents:
20012
diff
changeset
|
1237 |
17372
d42e11af980d
mx: simplified ctw command
Doug Simon <doug.simon@oracle.com>
parents:
17363
diff
changeset
|
1238 vm(vmargs) |
17052
35fda668ed6e
mx: added ctw command to simplify executing CompileTheWorld
Doug Simon <doug.simon@oracle.com>
parents:
17015
diff
changeset
|
1239 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1240 def _jvmci_gate_runner(args, tasks): |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1241 # Build server-hosted-jvmci now so we can run the unit tests |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1242 with Task('BuildHotSpotJVMCIHosted: product', tasks) as t: |
21043
5ea65fe64368
Check distributions overlap in gate
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21040
diff
changeset
|
1243 if t: buildvms(['--vms', 'server', '--builds', 'product', '--check-distributions']) |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1244 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1245 # Run unit tests on server-hosted-jvmci |
19162
32c7a5a88523
Run unit tests even earlier during gate
Doug Simon <doug.simon@oracle.com>
parents:
19160
diff
changeset
|
1246 with VM('server', 'product'): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1247 with Task('UnitTests:hosted-product', tasks) as t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1248 if t: unittest(['--enable-timing', '--verbose', '--fail-fast']) |
19160
d4f80cf249d0
Run unittest earlier during gate
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
19044
diff
changeset
|
1249 |
22148
102c41a0516c
mx: run NonSSA unittests and bootstrap in the gate.
Josef Eisl <josef.eisl@jku.at>
parents:
22147
diff
changeset
|
1250 # Run unit tests on server-hosted-jvmci with -G:-SSA_LIR |
21965
647459c6013a
mx gate: add UnitTestsSSA task.
Josef Eisl <josef.eisl@jku.at>
parents:
21960
diff
changeset
|
1251 with VM('server', 'product'): |
22148
102c41a0516c
mx: run NonSSA unittests and bootstrap in the gate.
Josef Eisl <josef.eisl@jku.at>
parents:
22147
diff
changeset
|
1252 with Task('UnitTestsNonSSA:hosted-product', tasks) as t: |
102c41a0516c
mx: run NonSSA unittests and bootstrap in the gate.
Josef Eisl <josef.eisl@jku.at>
parents:
22147
diff
changeset
|
1253 if t: unittest(['--enable-timing', '--verbose', '--fail-fast', '-G:-SSA_LIR']) |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1254 # Run ctw against rt.jar on server-hosted-jvmci |
20032
4d119424b4ce
Add CTW of rt.jar to gate
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20020
diff
changeset
|
1255 with VM('server', 'product'): |
4d119424b4ce
Add CTW of rt.jar to gate
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20020
diff
changeset
|
1256 with Task('CTW:hosted-product', tasks) as t: |
22095
1ccd66f5890c
Disable inline during parsing in CTW gate.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
22041
diff
changeset
|
1257 if t: ctw(['--ctwopts', '-Inline +ExitVMOnException', '-esa', '-G:+CompileTheWorldMultiThreaded', '-G:-InlineDuringParsing', '-G:-CompileTheWorldVerbose']) |
20032
4d119424b4ce
Add CTW of rt.jar to gate
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
20020
diff
changeset
|
1258 |
19162
32c7a5a88523
Run unit tests even earlier during gate
Doug Simon <doug.simon@oracle.com>
parents:
19160
diff
changeset
|
1259 # Build the other VM flavors |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1260 with Task('BuildHotSpotGraalOthers: fastdebug,product', tasks) as t: |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1261 if t: buildvms(['--vms', 'jvmci,server', '--builds', 'fastdebug,product', '--check-distributions']) |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1262 |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1263 with VM('jvmci', 'fastdebug'): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1264 with Task('BootstrapWithSystemAssertions:fastdebug', tasks) as t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1265 if t: vm(['-esa', '-XX:-TieredCompilation', '-version']) |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1266 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1267 with VM('jvmci', 'fastdebug'): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1268 with Task('BootstrapEconomyWithSystemAssertions:fastdebug', tasks) as t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1269 if t: vm(['-esa', '-XX:-TieredCompilation', '-G:CompilerConfiguration=economy', '-version']) |
19776
287f7c223d58
Add compiler configuration "economy".
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
19733
diff
changeset
|
1270 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1271 with VM('jvmci', 'fastdebug'): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1272 with Task('BootstrapWithSystemAssertionsNoCoop:fastdebug', tasks) as t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1273 if t: vm(['-esa', '-XX:-TieredCompilation', '-XX:-UseCompressedOops', '-version']) |
14123
dc41eab09fe8
gate: add non-tiered bootstrap
Bernhard Urban <bernhard.urban@jku.at>
parents:
14116
diff
changeset
|
1274 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1275 with VM('jvmci', 'fastdebug'): |
21059
59632bb8e4ad
Add bootstrap with invoke exception edges to gate.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
21043
diff
changeset
|
1276 with Task('BootstrapWithExceptionEdges:fastdebug', tasks) as t: |
59632bb8e4ad
Add bootstrap with invoke exception edges to gate.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
21043
diff
changeset
|
1277 if t: vm(['-esa', '-XX:-TieredCompilation', '-G:+StressInvokeWithExceptionNode', '-version']) |
59632bb8e4ad
Add bootstrap with invoke exception edges to gate.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
21043
diff
changeset
|
1278 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1279 with VM('jvmci', 'product'): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1280 with Task('BootstrapWithGCVerification:product', tasks) as t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1281 if t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1282 out = mx.DuplicateSuppressingStream(['VerifyAfterGC:', 'VerifyBeforeGC:']).write |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1283 vm(['-XX:-TieredCompilation', '-XX:+UnlockDiagnosticVMOptions', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'], out=out) |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1284 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1285 with VM('jvmci', 'product'): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1286 with Task('BootstrapWithG1GCVerification:product', tasks) as t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1287 if t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1288 out = mx.DuplicateSuppressingStream(['VerifyAfterGC:', 'VerifyBeforeGC:']).write |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1289 vm(['-XX:-TieredCompilation', '-XX:+UnlockDiagnosticVMOptions', '-XX:-UseSerialGC', '-XX:+UseG1GC', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'], out=out) |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1290 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1291 with VM('jvmci', 'product'): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1292 with Task('BootstrapWithRegisterPressure:product', tasks) as t: |
20994 | 1293 if t: |
20992
0a4bbeae6e31
[SPARC] Configure registers right for register pressure in gate run
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
20967
diff
changeset
|
1294 registers = 'o0,o1,o2,o3,f8,f9,d32,d34' if platform.processor() == 'sparc' else 'rbx,r11,r10,r14,xmm3,xmm11,xmm14' |
0a4bbeae6e31
[SPARC] Configure registers right for register pressure in gate run
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
20967
diff
changeset
|
1295 vm(['-XX:-TieredCompilation', '-G:RegisterPressure=' + registers, '-esa', '-version']) |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1296 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1297 with VM('jvmci', 'product'): |
22148
102c41a0516c
mx: run NonSSA unittests and bootstrap in the gate.
Josef Eisl <josef.eisl@jku.at>
parents:
22147
diff
changeset
|
1298 with Task('BootstrapNonSSAWithRegisterPressure:product', tasks) as t: |
21447
f172a195a8a9
mx gate: bootstrap with -G:+SSA_LIR.
Josef Eisl <josef.eisl@jku.at>
parents:
21281
diff
changeset
|
1299 if t: |
f172a195a8a9
mx gate: bootstrap with -G:+SSA_LIR.
Josef Eisl <josef.eisl@jku.at>
parents:
21281
diff
changeset
|
1300 registers = 'o0,o1,o2,o3,f8,f9,d32,d34' if platform.processor() == 'sparc' else 'rbx,r11,r10,r14,xmm3,xmm11,xmm14' |
22148
102c41a0516c
mx: run NonSSA unittests and bootstrap in the gate.
Josef Eisl <josef.eisl@jku.at>
parents:
22147
diff
changeset
|
1301 vm(['-XX:-TieredCompilation', '-G:-SSA_LIR', '-G:RegisterPressure=' + registers, '-esa', '-version']) |
21447
f172a195a8a9
mx gate: bootstrap with -G:+SSA_LIR.
Josef Eisl <josef.eisl@jku.at>
parents:
21281
diff
changeset
|
1302 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1303 with VM('jvmci', 'product'): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1304 with Task('BootstrapWithImmutableCode:product', tasks) as t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1305 if t: vm(['-XX:-TieredCompilation', '-G:+ImmutableCode', '-G:+VerifyPhases', '-esa', '-version']) |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1306 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1307 with Task('CleanAndBuildIdealGraphVisualizer', tasks, disableJacoco=True) as t: |
20996
5e78d067ebbe
Do not build IGV in gate when running on SPARC
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
20994
diff
changeset
|
1308 if t and platform.processor() != 'sparc': |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1309 buildxml = mx._cygpathU2W(join(_suite.dir, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml')) |
21165
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1310 mx.run(['ant', '-f', buildxml, '-q', 'clean', 'build'], env=_igvBuildEnv()) |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1311 |
21566 | 1312 # Prevent JVMCI modifications from breaking the standard builds |
1313 if args.buildNonJVMCI: | |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1314 with Task('BuildHotSpotVarieties', tasks, disableJacoco=True) as t: |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1315 if t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1316 buildvms(['--vms', 'client,server', '--builds', 'fastdebug,product']) |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1317 if mx.get_os() not in ['windows', 'cygwin']: |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1318 buildvms(['--vms', 'server-nojvmci', '--builds', 'product,optimized']) |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1319 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1320 """ |
22141
f85b80b29176
removed '_' prefix from exported methods and fields and provided accessors
Doug Simon <doug.simon@oracle.com>
parents:
22140
diff
changeset
|
1321 List of functions called by the gate once common gate tasks have been executed. |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1322 Each function is called with these arguments: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1323 args: the argparse.Namespace object containing result of parsing gate command line |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1324 tasks: list of Task to which extra Tasks should be added |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1325 """ |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1326 gateRunners = [_jvmci_gate_runner] |
11756
78e6109ee411
mx refactoring for split-repo suites; should have no effect on existing repos
Mick Jordan <mick.jordan@oracle.com>
parents:
11605
diff
changeset
|
1327 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1328 def gate(args): |
4159
e253ca26b2d5
Added 'unittest' command to run the Graal unit tests.
Doug Simon <doug.simon@oracle.com>
parents:
4157
diff
changeset
|
1329 """run the tests used to validate a push |
e253ca26b2d5
Added 'unittest' command to run the Graal unit tests.
Doug Simon <doug.simon@oracle.com>
parents:
4157
diff
changeset
|
1330 |
4438
0312460af9fc
Made gate do a full clean and added timing report for all gate tasks to end of gate log.
Doug Simon <doug.simon@oracle.com>
parents:
4417
diff
changeset
|
1331 If this command exits with a 0 exit code, then the source code is in |
4159
e253ca26b2d5
Added 'unittest' command to run the Graal unit tests.
Doug Simon <doug.simon@oracle.com>
parents:
4157
diff
changeset
|
1332 a state that would be accepted for integration into the main repository.""" |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1333 |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1334 parser = ArgumentParser(prog='mx gate') |
5232
c005ca943790
added -j option to gate command to disable cleaning of Java class files
Doug Simon <doug.simon@oracle.com>
parents:
5197
diff
changeset
|
1335 parser.add_argument('-j', '--omit-java-clean', action='store_false', dest='cleanJava', help='omit cleaning Java native code') |
5750
30876d0bb92d
In gate command, allways build natives, use '-n' to avoid cleaning them only
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5729
diff
changeset
|
1336 parser.add_argument('-n', '--omit-native-clean', action='store_false', dest='cleanNative', help='omit cleaning and building native code') |
21482
2fe8729dd813
mx gate: add option to skip ideclean
Roland Schatz <roland.schatz@oracle.com>
parents:
21447
diff
changeset
|
1337 parser.add_argument('-i', '--omit-ide-clean', action='store_false', dest='cleanIde', help='omit cleaning the ide project files') |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1338 parser.add_argument('-g', '--only-build-jvmci', action='store_false', dest='buildNonJVMCI', help='only build the JVMCI VM') |
21639
e65bf81961be
added -x option to gate command that makes --task-filter an exclusion filter
Doug Simon <doug.simon@oracle.com>
parents:
21635
diff
changeset
|
1339 parser.add_argument('-x', action='store_true', help='makes --task-filter an exclusion instead of inclusion filter') |
5033
d7ecce178ad2
Add jacoco report and a -XX:+DeoptimizeALot -XX:+VerifyOops bootstrap run to the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5032
diff
changeset
|
1340 parser.add_argument('--jacocout', help='specify the output directory for jacoco report') |
22179
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1341 filtering = parser.add_mutually_exclusive_group() |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1342 filtering.add_argument('-t', '--task-filter', help='comma separated list of substrings to select subset of tasks to be run') |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1343 filtering.add_argument('-s', '--start-at', help='substring to select starting task') |
4601
ade18666f2be
Added --omit-native-build to gate command so that native cleaning and building can be omitted for changesets that made no changes to the C/C++ code.
Doug Simon <doug.simon@oracle.com>
parents:
4584
diff
changeset
|
1344 |
ade18666f2be
Added --omit-native-build to gate command so that native cleaning and building can be omitted for changesets that made no changes to the C/C++ code.
Doug Simon <doug.simon@oracle.com>
parents:
4584
diff
changeset
|
1345 args = parser.parse_args(args) |
ade18666f2be
Added --omit-native-build to gate command so that native cleaning and building can be omitted for changesets that made no changes to the C/C++ code.
Doug Simon <doug.simon@oracle.com>
parents:
4584
diff
changeset
|
1346 |
5431
0bd1ba69db2a
removed double declaration of _vmbuild global variable in gate command
Doug Simon <doug.simon@oracle.com>
parents:
5430
diff
changeset
|
1347 global _jacoco |
22179
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1348 if args.start_at: |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1349 Task.startAtFilter = args.start_at |
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1350 elif args.task_filter: |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1351 Task.filters = args.task_filter.split(',') |
21639
e65bf81961be
added -x option to gate command that makes --task-filter an exclusion filter
Doug Simon <doug.simon@oracle.com>
parents:
21635
diff
changeset
|
1352 Task.filtersExclude = args.x |
e65bf81961be
added -x option to gate command that makes --task-filter an exclusion filter
Doug Simon <doug.simon@oracle.com>
parents:
21635
diff
changeset
|
1353 elif args.x: |
e65bf81961be
added -x option to gate command that makes --task-filter an exclusion filter
Doug Simon <doug.simon@oracle.com>
parents:
21635
diff
changeset
|
1354 mx.abort('-x option cannot be used without --task-filter option') |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1355 |
21165
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1356 # Force |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1357 if not mx._opts.strict_compliance: |
21514
b426469fadb7
mx: better description for strict-compliance and fix typo
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21169
diff
changeset
|
1358 mx.log("[gate] forcing strict compliance") |
21165
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1359 mx._opts.strict_compliance = True |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1360 |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1361 tasks = [] |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
1362 total = Task('Gate') |
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
1363 try: |
21960
f15b1d92e34b
re-enabled checking that jvmci.make is in sync with suite*.py
Doug Simon <doug.simon@oracle.com>
parents:
21958
diff
changeset
|
1364 with Task('Check jvmci.make in sync with suite.py', tasks) as t: |
f15b1d92e34b
re-enabled checking that jvmci.make is in sync with suite*.py
Doug Simon <doug.simon@oracle.com>
parents:
21958
diff
changeset
|
1365 if t: |
22169
f9ddf6b6dd6b
minor fixes related to mx2 transition
Doug Simon <doug.simon@oracle.com>
parents:
22167
diff
changeset
|
1366 jvmciMake = join(_suite.dir, 'make', 'jvmci.make') |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1367 if mx_jvmci_makefile.build_makefile(['-o', jvmciMake]) != 0: |
21960
f15b1d92e34b
re-enabled checking that jvmci.make is in sync with suite*.py
Doug Simon <doug.simon@oracle.com>
parents:
21958
diff
changeset
|
1368 t.abort('Rerun "mx makefile -o ' + jvmciMake + ' and check-in the modified ' + jvmciMake) |
f15b1d92e34b
re-enabled checking that jvmci.make is in sync with suite*.py
Doug Simon <doug.simon@oracle.com>
parents:
21958
diff
changeset
|
1369 |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1370 with Task('Pylint', tasks) as t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1371 if t: mx.pylint([]) |
11526 | 1372 |
13928
c4e5a685c6a1
gate: compile java with ECJ if available
Bernhard Urban <bernhard.urban@jku.at>
parents:
13919
diff
changeset
|
1373 def _clean(name='Clean'): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1374 with Task(name, tasks) as t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1375 if t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1376 cleanArgs = [] |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1377 if not args.cleanNative: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1378 cleanArgs.append('--no-native') |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1379 if not args.cleanJava: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1380 cleanArgs.append('--no-java') |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1381 clean(cleanArgs) |
13928
c4e5a685c6a1
gate: compile java with ECJ if available
Bernhard Urban <bernhard.urban@jku.at>
parents:
13919
diff
changeset
|
1382 _clean() |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1383 |
21482
2fe8729dd813
mx gate: add option to skip ideclean
Roland Schatz <roland.schatz@oracle.com>
parents:
21447
diff
changeset
|
1384 with Task('IDEConfigCheck', tasks) as t: |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1385 if t: |
21482
2fe8729dd813
mx gate: add option to skip ideclean
Roland Schatz <roland.schatz@oracle.com>
parents:
21447
diff
changeset
|
1386 if args.cleanIde: |
2fe8729dd813
mx gate: add option to skip ideclean
Roland Schatz <roland.schatz@oracle.com>
parents:
21447
diff
changeset
|
1387 mx.ideclean([]) |
2fe8729dd813
mx gate: add option to skip ideclean
Roland Schatz <roland.schatz@oracle.com>
parents:
21447
diff
changeset
|
1388 mx.ideinit([]) |
9824
6fa4b4933892
added check to gate that generated IDE configurations don't break the build
Doug Simon <doug.simon@oracle.com>
parents:
9803
diff
changeset
|
1389 |
13928
c4e5a685c6a1
gate: compile java with ECJ if available
Bernhard Urban <bernhard.urban@jku.at>
parents:
13919
diff
changeset
|
1390 eclipse_exe = mx.get_env('ECLIPSE_EXE') |
7533
29b0768b7ba6
added eclipseformat to the gate
Doug Simon <doug.simon@oracle.com>
parents:
7509
diff
changeset
|
1391 if eclipse_exe is not None: |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1392 with Task('CodeFormatCheck', tasks) as t: |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1393 if t and mx.eclipseformat(['-e', eclipse_exe]) != 0: |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1394 t.abort('Formatter modified files - run "mx eclipseformat", check in changes and repush') |
8211
74896b25297a
Test canonicalization and checkstyle early in gate process
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
8183
diff
changeset
|
1395 |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1396 with Task('Canonicalization Check', tasks) as t: |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1397 if t: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1398 mx.log(time.strftime('%d %b %Y %H:%M:%S - Ensuring mx/projects files are canonicalized...')) |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1399 if mx.canonicalizeprojects([]) != 0: |
21936
11f241f26c61
mx: add check to gate the jvmci.make and suite.py are in sync
Doug Simon <doug.simon@oracle.com>
parents:
21910
diff
changeset
|
1400 t.abort('Rerun "mx canonicalizeprojects" and check-in the modified mx/suite*.py files.') |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1401 |
13928
c4e5a685c6a1
gate: compile java with ECJ if available
Bernhard Urban <bernhard.urban@jku.at>
parents:
13919
diff
changeset
|
1402 if mx.get_env('JDT'): |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1403 with Task('BuildJavaWithEcj', tasks): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1404 if t: build(['-p', '--no-native', '--jdt-warning-as-error']) |
13928
c4e5a685c6a1
gate: compile java with ECJ if available
Bernhard Urban <bernhard.urban@jku.at>
parents:
13919
diff
changeset
|
1405 _clean('CleanAfterEcjBuild') |
c4e5a685c6a1
gate: compile java with ECJ if available
Bernhard Urban <bernhard.urban@jku.at>
parents:
13919
diff
changeset
|
1406 |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1407 with Task('BuildJavaWithJavac', tasks): |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1408 if t: build(['-p', '--no-native', '--force-javac']) |
9172
bc5c5336008b
Add gate test to check build-graal.xml is up to date.
Roland Schatz <roland.schatz@oracle.com>
parents:
9169
diff
changeset
|
1409 |
18163
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
18116
diff
changeset
|
1410 with Task('Checkstyle', tasks) as t: |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1411 if t and mx.checkstyle([]) != 0: |
18163
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
18116
diff
changeset
|
1412 t.abort('Checkstyle warnings were found') |
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
18116
diff
changeset
|
1413 |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1414 with Task('Checkheaders', tasks) as t: |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1415 if t and checkheaders([]) != 0: |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1416 t.abort('Checkheaders warnings were found') |
14773
78343531acc7
added checkheaders to the gate
Doug Simon <doug.simon@oracle.com>
parents:
14772
diff
changeset
|
1417 |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1418 with Task('FindBugs', tasks) as t: |
22031
434fbaaf53d7
moved findbugs support from mx_graal.py to mx_findbugs.py
Doug Simon <doug.simon@oracle.com>
parents:
22024
diff
changeset
|
1419 if t and mx_findbugs.findbugs([]) != 0: |
17438
b8d89559915d
mx: implement with support for Task()
Bernhard Urban <bernhard.urban@jku.at>
parents:
17437
diff
changeset
|
1420 t.abort('FindBugs warnings were found') |
14751
015f84f0b375
added findbugs to the gate
Doug Simon <doug.simon@oracle.com>
parents:
14744
diff
changeset
|
1421 |
5878
191e08da4de4
Apply jacoco coverage to all gate tests
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5877
diff
changeset
|
1422 if exists('jacoco.exec'): |
191e08da4de4
Apply jacoco coverage to all gate tests
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5877
diff
changeset
|
1423 os.unlink('jacoco.exec') |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1424 |
5878
191e08da4de4
Apply jacoco coverage to all gate tests
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5877
diff
changeset
|
1425 if args.jacocout is not None: |
191e08da4de4
Apply jacoco coverage to all gate tests
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5877
diff
changeset
|
1426 _jacoco = 'append' |
191e08da4de4
Apply jacoco coverage to all gate tests
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5877
diff
changeset
|
1427 else: |
191e08da4de4
Apply jacoco coverage to all gate tests
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5877
diff
changeset
|
1428 _jacoco = 'off' |
11757 | 1429 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1430 for runner in gateRunners: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1431 runner(args, tasks) |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1432 |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1433 if args.jacocout is not None: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1434 jacocoreport([args.jacocout]) |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1435 _jacoco = 'off' |
7155
c356cab093bc
added execution of the Graal API unittest with non-GraalVM HotSpot builds to the gate
Doug Simon <doug.simon@oracle.com>
parents:
7154
diff
changeset
|
1436 |
4247
3f6c6e61614e
Changed 'mx build' such that all Java sources for a project are compiled together instead of by source directory.
Doug Simon <doug.simon@oracle.com>
parents:
4244
diff
changeset
|
1437 except KeyboardInterrupt: |
3f6c6e61614e
Changed 'mx build' such that all Java sources for a project are compiled together instead of by source directory.
Doug Simon <doug.simon@oracle.com>
parents:
4244
diff
changeset
|
1438 total.abort(1) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1439 |
4584
7e5d8d1c74a1
Modified JDK replication process such that a copy of the default VM is made. This prevents issues with the replicated JDK being used to bootstrap a HotSpot build.
Doug Simon <doug.simon@oracle.com>
parents:
4582
diff
changeset
|
1440 except BaseException as e: |
4247
3f6c6e61614e
Changed 'mx build' such that all Java sources for a project are compiled together instead of by source directory.
Doug Simon <doug.simon@oracle.com>
parents:
4244
diff
changeset
|
1441 import traceback |
3f6c6e61614e
Changed 'mx build' such that all Java sources for a project are compiled together instead of by source directory.
Doug Simon <doug.simon@oracle.com>
parents:
4244
diff
changeset
|
1442 traceback.print_exc() |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
1443 total.abort(str(e)) |
4159
e253ca26b2d5
Added 'unittest' command to run the Graal unit tests.
Doug Simon <doug.simon@oracle.com>
parents:
4157
diff
changeset
|
1444 |
4234
057620486c90
Improved time stamps of gate tasks to show duration of each task explicitly.
Doug Simon <doug.simon@oracle.com>
parents:
4230
diff
changeset
|
1445 total.stop() |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1446 |
4438
0312460af9fc
Made gate do a full clean and added timing report for all gate tasks to end of gate log.
Doug Simon <doug.simon@oracle.com>
parents:
4417
diff
changeset
|
1447 mx.log('Gate task times:') |
0312460af9fc
Made gate do a full clean and added timing report for all gate tasks to end of gate log.
Doug Simon <doug.simon@oracle.com>
parents:
4417
diff
changeset
|
1448 for t in tasks: |
0312460af9fc
Made gate do a full clean and added timing report for all gate tasks to end of gate log.
Doug Simon <doug.simon@oracle.com>
parents:
4417
diff
changeset
|
1449 mx.log(' ' + str(t.duration) + '\t' + t.title) |
0312460af9fc
Made gate do a full clean and added timing report for all gate tasks to end of gate log.
Doug Simon <doug.simon@oracle.com>
parents:
4417
diff
changeset
|
1450 mx.log(' =======') |
0312460af9fc
Made gate do a full clean and added timing report for all gate tasks to end of gate log.
Doug Simon <doug.simon@oracle.com>
parents:
4417
diff
changeset
|
1451 mx.log(' ' + str(total.duration)) |
11757 | 1452 |
20000
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1453 if args.task_filter: |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1454 Task.filters = None |
e8a0a61526b2
added support for refining the tasks run by 'mx gate' (e.g., 'mx gate -t Economy' will only run tasks whose title contains the substring 'Economy')
Doug Simon <doug.simon@oracle.com>
parents:
19796
diff
changeset
|
1455 |
6340
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1456 def deoptalot(args): |
22108
51ceda0cf404
mx: make deoptalot command more flexible in terms of VM management
Doug Simon <doug.simon@oracle.com>
parents:
22099
diff
changeset
|
1457 """bootstrap a VM with DeoptimizeALot and VerifyOops on |
6340
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1458 |
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1459 If the first argument is a number, the process will be repeated |
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1460 this number of times. All other arguments are passed to the VM.""" |
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1461 count = 1 |
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1462 if len(args) > 0 and args[0].isdigit(): |
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1463 count = int(args[0]) |
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1464 del args[0] |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1465 |
7509 | 1466 for _ in range(count): |
22108
51ceda0cf404
mx: make deoptalot command more flexible in terms of VM management
Doug Simon <doug.simon@oracle.com>
parents:
22099
diff
changeset
|
1467 if not vm(['-XX:-TieredCompilation', '-XX:+DeoptimizeALot', '-XX:+VerifyOops'] + args + ['-version']) == 0: |
6340
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1468 mx.abort("Failed") |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1469 |
6340
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1470 def longtests(args): |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1471 |
6340
74560fdffd51
Add a draft longtests command to mc's commands
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
6319
diff
changeset
|
1472 deoptalot(['15', '-Xmx48m']) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1473 |
21165
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1474 def _igvJdk(): |
18893
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.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
18876
diff
changeset
|
1475 v8u20 = mx.VersionSpec("1.8.0_20") |
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.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
18876
diff
changeset
|
1476 v8u40 = mx.VersionSpec("1.8.0_40") |
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.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
18876
diff
changeset
|
1477 v8 = mx.VersionSpec("1.8") |
21165
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1478 def _igvJdkVersionCheck(version): |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1479 return version >= v8 and (version < v8u20 or version >= v8u40) |
21976
36e37644f91e
mx: improve first usage experience:
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21975
diff
changeset
|
1480 return mx.java(_igvJdkVersionCheck, versionDescription='>= 1.8 and < 1.8.0u20 or >= 1.8.0u40', purpose="building & running IGV").jdk |
21165
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1481 |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1482 def _igvBuildEnv(): |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1483 # When the http_proxy environment variable is set, convert it to the proxy settings that ant needs |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1484 env = dict(os.environ) |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1485 proxy = os.environ.get('http_proxy') |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1486 if not (proxy is None) and len(proxy) > 0: |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1487 if '://' in proxy: |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1488 # Remove the http:// prefix (or any other protocol prefix) |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1489 proxy = proxy.split('://', 1)[1] |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1490 # Separate proxy server name and port number |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1491 proxyName, proxyPort = proxy.split(':', 1) |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1492 proxyEnv = '-DproxyHost="' + proxyName + '" -DproxyPort=' + proxyPort |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1493 env['ANT_OPTS'] = proxyEnv |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1494 |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1495 env['JAVA_HOME'] = _igvJdk() |
17388
9e5abd0e7916
mx/igv: fallback mechanism to work around a javac bug in jdk8u20
Bernhard Urban <bernhard.urban@jku.at>
parents:
17372
diff
changeset
|
1496 return env |
9e5abd0e7916
mx/igv: fallback mechanism to work around a javac bug in jdk8u20
Bernhard Urban <bernhard.urban@jku.at>
parents:
17372
diff
changeset
|
1497 |
5089
206e68bb66c6
Made the IdealGraphVisualizer runnable from mx with new 'igv' command.
Doug Simon <doug.simon@oracle.com>
parents:
5064
diff
changeset
|
1498 def igv(args): |
206e68bb66c6
Made the IdealGraphVisualizer runnable from mx with new 'igv' command.
Doug Simon <doug.simon@oracle.com>
parents:
5064
diff
changeset
|
1499 """run the Ideal Graph Visualizer""" |
18893
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.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
18876
diff
changeset
|
1500 logFile = '.ideal_graph_visualizer.log' |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1501 with open(join(_suite.dir, logFile), 'w') as fp: |
10568
070b4a3c56f3
disabled "noisy" log statements unless -v option (i.e. verbose) is specified to mx
Doug Simon <doug.simon@oracle.com>
parents:
10527
diff
changeset
|
1502 mx.logv('[Ideal Graph Visualizer log is in ' + fp.name + ']') |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1503 nbplatform = join(_suite.dir, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'nbplatform') |
13472
72e2ec923b7b
added support to replace NetBeans platform used by IGV if it is out of date (GRAAL-420)
Doug Simon <doug.simon@oracle.com>
parents:
13471
diff
changeset
|
1504 |
72e2ec923b7b
added support to replace NetBeans platform used by IGV if it is out of date (GRAAL-420)
Doug Simon <doug.simon@oracle.com>
parents:
13471
diff
changeset
|
1505 # Remove NetBeans platform if it is earlier than the current supported version |
72e2ec923b7b
added support to replace NetBeans platform used by IGV if it is out of date (GRAAL-420)
Doug Simon <doug.simon@oracle.com>
parents:
13471
diff
changeset
|
1506 if exists(nbplatform): |
19430
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1507 updateTrackingFile = join(nbplatform, 'platform', 'update_tracking', 'org-netbeans-core.xml') |
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1508 if not exists(updateTrackingFile): |
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1509 mx.log('Could not find \'' + updateTrackingFile + '\', removing NetBeans platform') |
13472
72e2ec923b7b
added support to replace NetBeans platform used by IGV if it is out of date (GRAAL-420)
Doug Simon <doug.simon@oracle.com>
parents:
13471
diff
changeset
|
1510 shutil.rmtree(nbplatform) |
19430
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1511 else: |
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1512 dom = xml.dom.minidom.parse(updateTrackingFile) |
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1513 currentVersion = mx.VersionSpec(dom.getElementsByTagName('module_version')[0].getAttribute('specification_version')) |
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1514 supportedVersion = mx.VersionSpec('3.43.1') |
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1515 if currentVersion < supportedVersion: |
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1516 mx.log('Replacing NetBeans platform version ' + str(currentVersion) + ' with version ' + str(supportedVersion)) |
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1517 shutil.rmtree(nbplatform) |
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1518 elif supportedVersion < currentVersion: |
9f037830060a
Make mx igv more robust against bad nbplatform states
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
19335
diff
changeset
|
1519 mx.log('Supported NetBeans version in igv command should be updated to ' + str(currentVersion)) |
13472
72e2ec923b7b
added support to replace NetBeans platform used by IGV if it is out of date (GRAAL-420)
Doug Simon <doug.simon@oracle.com>
parents:
13471
diff
changeset
|
1520 |
72e2ec923b7b
added support to replace NetBeans platform used by IGV if it is out of date (GRAAL-420)
Doug Simon <doug.simon@oracle.com>
parents:
13471
diff
changeset
|
1521 if not exists(nbplatform): |
72e2ec923b7b
added support to replace NetBeans platform used by IGV if it is out of date (GRAAL-420)
Doug Simon <doug.simon@oracle.com>
parents:
13471
diff
changeset
|
1522 mx.logv('[This execution may take a while as the NetBeans platform needs to be downloaded]') |
21165
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1523 |
bdeaa5a7b83c
Look for JDKs on demand, add --strict-compliance flag. Allow more precise search for JDK versions (use it for IGV)
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21122
diff
changeset
|
1524 env = _igvBuildEnv() |
18983
43baadc1913a
Automatically install Batik for SVG export in IGV
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18931
diff
changeset
|
1525 # make the jar for Batik 1.7 available. |
43baadc1913a
Automatically install Batik for SVG export in IGV
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18931
diff
changeset
|
1526 env['IGV_BATIK_JAR'] = mx.library('BATIK').get_path(True) |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1527 if mx.run(['ant', '-f', mx._cygpathU2W(join(_suite.dir, 'src', 'share', 'tools', 'IdealGraphVisualizer', 'build.xml')), '-l', mx._cygpathU2W(fp.name), 'run'], env=env, nonZeroIsFatal=False): |
18893
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.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
18876
diff
changeset
|
1528 mx.abort("IGV ant build & launch failed. Check '" + logFile + "'. You can also try to delete 'src/share/tools/IdealGraphVisualizer/nbplatform'.") |
14116
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1529 |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1530 def c1visualizer(args): |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1531 """run the Cl Compiler Visualizer""" |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1532 libpath = join(_suite.dir, 'lib') |
14116
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1533 if mx.get_os() == 'windows': |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1534 executable = join(libpath, 'c1visualizer', 'bin', 'c1visualizer.exe') |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1535 else: |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1536 executable = join(libpath, 'c1visualizer', 'bin', 'c1visualizer') |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1537 |
16599
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1538 # Check whether the current C1Visualizer installation is the up-to-date |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1539 if exists(executable) and not exists(mx.library('C1VISUALIZER_DIST').get_path(resolve=False)): |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1540 mx.log('Updating C1Visualizer') |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1541 shutil.rmtree(join(libpath, 'c1visualizer')) |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1542 |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1543 archive = mx.library('C1VISUALIZER_DIST').get_path(resolve=True) |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1544 |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1545 if not exists(executable): |
14116
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1546 zf = zipfile.ZipFile(archive, 'r') |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1547 zf.extractall(libpath) |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1548 |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1549 if not exists(executable): |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1550 mx.abort('C1Visualizer binary does not exist: ' + executable) |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1551 |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1552 if mx.get_os() != 'windows': |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1553 # Make sure that execution is allowed. The zip file does not always specfiy that correctly |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1554 os.chmod(executable, 0777) |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1555 |
be7ebdf41bea
mx: new command to start c1visualizer; support for IGV download when using a proxy server
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14048
diff
changeset
|
1556 mx.run([executable]) |
5089
206e68bb66c6
Made the IdealGraphVisualizer runnable from mx with new 'igv' command.
Doug Simon <doug.simon@oracle.com>
parents:
5064
diff
changeset
|
1557 |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1558 def _get_jmh_path(): |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1559 path = mx.get_env('JMH_BENCHMARKS', None) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1560 if not path: |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1561 probe = join(dirname(_suite.dir), 'java-benchmarks') |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1562 if exists(probe): |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1563 path = probe |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1564 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1565 if not path: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1566 mx.abort("Please set the JMH_BENCHMARKS environment variable to point to the java-benchmarks workspace") |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1567 if not exists(path): |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1568 mx.abort("The directory denoted by the JMH_BENCHMARKS environment variable does not exist: " + path) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1569 return path |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1570 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1571 def makejmhdeps(args): |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1572 """creates and installs Maven dependencies required by the JMH benchmarks |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1573 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1574 The dependencies are specified by files named pom.mxdeps in the |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1575 JMH directory tree. Each such file contains a list of dependencies |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1576 defined in JSON format. For example: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1577 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1578 '[{"artifactId" : "compiler.test", "groupId" : "com.oracle.graal", "deps" : ["com.oracle.graal.compiler.test"]}]' |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1579 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1580 will result in a dependency being installed in the local Maven repository |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1581 that can be referenced in a pom.xml file as follows: |
15178
0c53453c4d5e
mx: improved jmh command to (a) look for JMH benchmarks in ../java-benchmarks, (b) omit building benchmarks if they are up to date and (c) offer better message with 'mx help jmh'
Doug Simon <doug.simon@oracle.com>
parents:
15114
diff
changeset
|
1582 |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1583 <dependency> |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1584 <groupId>com.oracle.graal</groupId> |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1585 <artifactId>compiler.test</artifactId> |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1586 <version>1.0-SNAPSHOT</version> |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1587 </dependency>""" |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1588 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1589 parser = ArgumentParser(prog='mx makejmhdeps') |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1590 parser.add_argument('-s', '--settings', help='alternative path for Maven user settings file', metavar='<path>') |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1591 parser.add_argument('-p', '--permissive', action='store_true', help='issue note instead of error if a Maven dependency cannot be built due to missing projects/libraries') |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1592 args = parser.parse_args(args) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1593 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1594 def makejmhdep(artifactId, groupId, deps): |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1595 path = artifactId + '.jar' |
22169
f9ddf6b6dd6b
minor fixes related to mx2 transition
Doug Simon <doug.simon@oracle.com>
parents:
22167
diff
changeset
|
1596 allDeps = [] |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1597 if args.permissive: |
22181
ffdee9fe0ded
fixed uses of dist.sorted_deps()
Doug Simon <doug.simon@oracle.com>
parents:
22180
diff
changeset
|
1598 for name, dep in [(d, mx.dependency(d, fatalIfMissing=False)) for d in deps]: |
ffdee9fe0ded
fixed uses of dist.sorted_deps()
Doug Simon <doug.simon@oracle.com>
parents:
22180
diff
changeset
|
1599 if dep is None: |
ffdee9fe0ded
fixed uses of dist.sorted_deps()
Doug Simon <doug.simon@oracle.com>
parents:
22180
diff
changeset
|
1600 mx.log('Skipping dependency ' + groupId + '.' + artifactId + ' as ' + name + ' cannot be resolved') |
ffdee9fe0ded
fixed uses of dist.sorted_deps()
Doug Simon <doug.simon@oracle.com>
parents:
22180
diff
changeset
|
1601 return |
ffdee9fe0ded
fixed uses of dist.sorted_deps()
Doug Simon <doug.simon@oracle.com>
parents:
22180
diff
changeset
|
1602 if dep.isDistribution(): |
ffdee9fe0ded
fixed uses of dist.sorted_deps()
Doug Simon <doug.simon@oracle.com>
parents:
22180
diff
changeset
|
1603 allDeps = allDeps + [d.name for d in dep.archived_deps() if d.isJavaProject()] |
17356
115de469a26b
support distributions in pom.mxdeps files
Doug Simon <doug.simon@oracle.com>
parents:
17321
diff
changeset
|
1604 else: |
115de469a26b
support distributions in pom.mxdeps files
Doug Simon <doug.simon@oracle.com>
parents:
17321
diff
changeset
|
1605 allDeps.append(name) |
22181
ffdee9fe0ded
fixed uses of dist.sorted_deps()
Doug Simon <doug.simon@oracle.com>
parents:
22180
diff
changeset
|
1606 d = mx.Distribution(_suite, name=artifactId, subDir=_suite.dir, path=path, sourcesPath=path, deps=allDeps, mainClass=None, excludedLibs=[], distDependencies=[], javaCompliance=None) |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1607 d.make_archive() |
22170
480635800a1b
buildjmhdeps should use Graal for JAVA_HOME
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22169
diff
changeset
|
1608 env = os.environ.copy() |
22277
a48774f9b97a
renamed mx_jvmci.get_jdk() to mx_jvmci.get_jvmci_jdk()
Doug Simon <doug.simon@oracle.com>
parents:
22274
diff
changeset
|
1609 env['JAVA_HOME'] = get_jvmci_jdk(vmToCheck='server') |
22170
480635800a1b
buildjmhdeps should use Graal for JAVA_HOME
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22169
diff
changeset
|
1610 env['MAVEN_OPTS'] = '-server -XX:-UseJVMCIClassLoader' |
15253
9ff9f6643986
mx: unconditionally ensure mx injected dependencies are up to date in buildjmh command
Doug Simon <doug.simon@oracle.com>
parents:
15250
diff
changeset
|
1611 cmd = ['mvn', 'install:install-file', '-DgroupId=' + groupId, '-DartifactId=' + artifactId, |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1612 '-Dversion=1.0-SNAPSHOT', '-Dpackaging=jar', '-Dfile=' + d.path] |
15253
9ff9f6643986
mx: unconditionally ensure mx injected dependencies are up to date in buildjmh command
Doug Simon <doug.simon@oracle.com>
parents:
15250
diff
changeset
|
1613 if not mx._opts.verbose: |
9ff9f6643986
mx: unconditionally ensure mx injected dependencies are up to date in buildjmh command
Doug Simon <doug.simon@oracle.com>
parents:
15250
diff
changeset
|
1614 cmd.append('-q') |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1615 if args.settings: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1616 cmd = cmd + ['-s', args.settings] |
22170
480635800a1b
buildjmhdeps should use Graal for JAVA_HOME
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22169
diff
changeset
|
1617 mx.run(cmd, env=env) |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1618 os.unlink(d.path) |
15178
0c53453c4d5e
mx: improved jmh command to (a) look for JMH benchmarks in ../java-benchmarks, (b) omit building benchmarks if they are up to date and (c) offer better message with 'mx help jmh'
Doug Simon <doug.simon@oracle.com>
parents:
15114
diff
changeset
|
1619 |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1620 jmhPath = _get_jmh_path() |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1621 for root, _, filenames in os.walk(jmhPath): |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1622 for f in [join(root, n) for n in filenames if n == 'pom.mxdeps']: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1623 mx.logv('[processing ' + f + ']') |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1624 try: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1625 with open(f) as fp: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1626 for d in json.load(fp): |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1627 artifactId = d['artifactId'] |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1628 groupId = d['groupId'] |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1629 deps = d['deps'] |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1630 makejmhdep(artifactId, groupId, deps) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1631 except ValueError as e: |
18635
a8b46348b79f
mx: converted format strings to be python 2.6 compliant
Doug Simon <doug.simon@oracle.com>
parents:
18613
diff
changeset
|
1632 mx.abort('Error parsing {0}:\n{1}'.format(f, e)) |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1633 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1634 def buildjmh(args): |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1635 """build the JMH benchmarks""" |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1636 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1637 parser = ArgumentParser(prog='mx buildjmh') |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1638 parser.add_argument('-s', '--settings', help='alternative path for Maven user settings file', metavar='<path>') |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1639 parser.add_argument('-c', action='store_true', dest='clean', help='clean before building') |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1640 args = parser.parse_args(args) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1641 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1642 jmhPath = _get_jmh_path() |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1643 mx.log('JMH benchmarks: ' + jmhPath) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1644 |
15253
9ff9f6643986
mx: unconditionally ensure mx injected dependencies are up to date in buildjmh command
Doug Simon <doug.simon@oracle.com>
parents:
15250
diff
changeset
|
1645 # Ensure the mx injected dependencies are up to date |
9ff9f6643986
mx: unconditionally ensure mx injected dependencies are up to date in buildjmh command
Doug Simon <doug.simon@oracle.com>
parents:
15250
diff
changeset
|
1646 makejmhdeps(['-p'] + (['-s', args.settings] if args.settings else [])) |
9ff9f6643986
mx: unconditionally ensure mx injected dependencies are up to date in buildjmh command
Doug Simon <doug.simon@oracle.com>
parents:
15250
diff
changeset
|
1647 |
22018
11ed27b2abe8
remove hard-coded use of 'mx' to refer to the mxDir for the graal suite
Doug Simon <doug.simon@oracle.com>
parents:
22017
diff
changeset
|
1648 timestamp = mx.TimeStampFile(join(_suite.mxDir, 'jmh', jmhPath.replace(os.sep, '_') + '.timestamp')) |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1649 mustBuild = args.clean |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1650 if not mustBuild: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1651 try: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1652 hgfiles = [join(jmhPath, f) for f in subprocess.check_output(['hg', '-R', jmhPath, 'locate']).split('\n')] |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1653 mustBuild = timestamp.isOlderThan(hgfiles) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1654 except: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1655 # not a Mercurial repository or hg commands are not available. |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1656 mustBuild = True |
15178
0c53453c4d5e
mx: improved jmh command to (a) look for JMH benchmarks in ../java-benchmarks, (b) omit building benchmarks if they are up to date and (c) offer better message with 'mx help jmh'
Doug Simon <doug.simon@oracle.com>
parents:
15114
diff
changeset
|
1657 |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1658 if mustBuild: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1659 buildOutput = [] |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1660 def _redirect(x): |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1661 if mx._opts.verbose: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1662 mx.log(x[:-1]) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1663 else: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1664 buildOutput.append(x) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1665 env = os.environ.copy() |
22277
a48774f9b97a
renamed mx_jvmci.get_jdk() to mx_jvmci.get_jvmci_jdk()
Doug Simon <doug.simon@oracle.com>
parents:
22274
diff
changeset
|
1666 env['JAVA_HOME'] = get_jvmci_jdk(vmToCheck='server') |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1667 env['MAVEN_OPTS'] = '-server -XX:-UseJVMCIClassLoader' |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1668 mx.log("Building benchmarks...") |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1669 cmd = ['mvn'] |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1670 if args.settings: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1671 cmd = cmd + ['-s', args.settings] |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1672 if args.clean: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1673 cmd.append('clean') |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1674 cmd.append('package') |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1675 retcode = mx.run(cmd, cwd=jmhPath, out=_redirect, env=env, nonZeroIsFatal=False) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1676 if retcode != 0: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1677 mx.log(''.join(buildOutput)) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1678 mx.abort(retcode) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1679 timestamp.touch() |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1680 else: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1681 mx.logv('[all Mercurial controlled files in ' + jmhPath + ' are older than ' + timestamp.path + ' - skipping build]') |
13935
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1682 |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1683 def jmh(args): |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1684 """run the JMH benchmarks |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1685 |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1686 This command respects the standard --vm and --vmbuild options |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1687 for choosing which VM to run the benchmarks with.""" |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1688 if '-h' in args: |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1689 mx.help_(['jmh']) |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1690 mx.abort(1) |
15021
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1691 |
22020
36a7ec14279d
moved unit test support from mx_graal.py to mx.py
Doug Simon <doug.simon@oracle.com>
parents:
22019
diff
changeset
|
1692 vmArgs, benchmarksAndJsons = mx.extract_VM_args(args) |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1693 if isJVMCIEnabled(get_vm()) and '-XX:-UseJVMCIClassLoader' not in vmArgs: |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1694 vmArgs = ['-XX:-UseJVMCIClassLoader'] + vmArgs |
15021
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1695 |
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1696 benchmarks = [b for b in benchmarksAndJsons if not b.startswith('{')] |
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1697 jmhArgJsons = [b for b in benchmarksAndJsons if b.startswith('{')] |
22018
11ed27b2abe8
remove hard-coded use of 'mx' to refer to the mxDir for the graal suite
Doug Simon <doug.simon@oracle.com>
parents:
22017
diff
changeset
|
1698 jmhOutDir = join(_suite.mxDir, 'jmh') |
15593
e381346a8223
JMH: do not abort on missing jar file. Create necessary output directory if needed
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15580
diff
changeset
|
1699 if not exists(jmhOutDir): |
e381346a8223
JMH: do not abort on missing jar file. Create necessary output directory if needed
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15580
diff
changeset
|
1700 os.makedirs(jmhOutDir) |
e381346a8223
JMH: do not abort on missing jar file. Create necessary output directory if needed
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15580
diff
changeset
|
1701 jmhOut = join(jmhOutDir, 'jmh.out') |
e381346a8223
JMH: do not abort on missing jar file. Create necessary output directory if needed
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15580
diff
changeset
|
1702 jmhArgs = {'-rff' : jmhOut, '-v' : 'EXTRA' if mx._opts.verbose else 'NORMAL'} |
15021
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1703 |
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1704 # e.g. '{"-wi" : 20}' |
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1705 for j in jmhArgJsons: |
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1706 try: |
15051
2df054b37edc
add support for removing default JMH args (e.g., '{"-wi" : null, "-i" : null}')
Doug Simon <doug.simon@oracle.com>
parents:
15048
diff
changeset
|
1707 for n, v in json.loads(j).iteritems(): |
2df054b37edc
add support for removing default JMH args (e.g., '{"-wi" : null, "-i" : null}')
Doug Simon <doug.simon@oracle.com>
parents:
15048
diff
changeset
|
1708 if v is None: |
2df054b37edc
add support for removing default JMH args (e.g., '{"-wi" : null, "-i" : null}')
Doug Simon <doug.simon@oracle.com>
parents:
15048
diff
changeset
|
1709 del jmhArgs[n] |
2df054b37edc
add support for removing default JMH args (e.g., '{"-wi" : null, "-i" : null}')
Doug Simon <doug.simon@oracle.com>
parents:
15048
diff
changeset
|
1710 else: |
2df054b37edc
add support for removing default JMH args (e.g., '{"-wi" : null, "-i" : null}')
Doug Simon <doug.simon@oracle.com>
parents:
15048
diff
changeset
|
1711 jmhArgs[n] = v |
15021
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1712 except ValueError as e: |
18635
a8b46348b79f
mx: converted format strings to be python 2.6 compliant
Doug Simon <doug.simon@oracle.com>
parents:
18613
diff
changeset
|
1713 mx.abort('error parsing JSON input: {0}\n{1}'.format(j, e)) |
14965
c64cd1dd4bd1
moved Maven installation of Graal dependency from build to jmh command
Doug Simon <doug.simon@oracle.com>
parents:
14938
diff
changeset
|
1714 |
15250
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1715 jmhPath = _get_jmh_path() |
4c68a0eb69ca
mx: refactored JMH benchmark building and dependency creation out of 'jmh' into 'buildjmh' and 'makejmhdeps' respectively
Doug Simon <doug.simon@oracle.com>
parents:
15229
diff
changeset
|
1716 mx.log('Using benchmarks in ' + jmhPath) |
13935
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1717 |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1718 matchedSuites = set() |
13949
f694daada5bf
mx jmh: display the number of benchmarks that will run
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13948
diff
changeset
|
1719 numBench = [0] |
13935
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1720 for micros in os.listdir(jmhPath): |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1721 absoluteMicro = os.path.join(jmhPath, micros) |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1722 if not os.path.isdir(absoluteMicro): |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1723 continue |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1724 if not micros.startswith("micros-"): |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1725 mx.logv('JMH: ignored ' + absoluteMicro + " because it doesn't start with 'micros-'") |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1726 continue |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1727 |
13948
69928d77bc0a
mx jmh: avoid mx crash if JMH_BENCHMARKS is not defined at all and skip suites that do not contain the correct jar
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13935
diff
changeset
|
1728 microJar = os.path.join(absoluteMicro, "target", "microbenchmarks.jar") |
69928d77bc0a
mx jmh: avoid mx crash if JMH_BENCHMARKS is not defined at all and skip suites that do not contain the correct jar
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13935
diff
changeset
|
1729 if not exists(microJar): |
15593
e381346a8223
JMH: do not abort on missing jar file. Create necessary output directory if needed
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15580
diff
changeset
|
1730 mx.log('Missing ' + microJar + ' - please run "mx buildjmh"') |
e381346a8223
JMH: do not abort on missing jar file. Create necessary output directory if needed
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15580
diff
changeset
|
1731 continue |
13935
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1732 if benchmarks: |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1733 def _addBenchmark(x): |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1734 if x.startswith("Benchmark:"): |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1735 return |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1736 match = False |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1737 for b in benchmarks: |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1738 match = match or (b in x) |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1739 |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1740 if match: |
13949
f694daada5bf
mx jmh: display the number of benchmarks that will run
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13948
diff
changeset
|
1741 numBench[0] += 1 |
13935
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1742 matchedSuites.add(micros) |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1743 |
13967
4cd7c6629841
mx_graal: fix pylint 1.1.0 warnings
Bernhard Urban <bernhard.urban@jku.at>
parents:
13952
diff
changeset
|
1744 mx.run_java(['-jar', microJar, "-l"], cwd=jmhPath, out=_addBenchmark, addDefaultArgs=False) |
13935
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1745 else: |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1746 matchedSuites.add(micros) |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1747 |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1748 mx.logv("matchedSuites: " + str(matchedSuites)) |
13949
f694daada5bf
mx jmh: display the number of benchmarks that will run
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13948
diff
changeset
|
1749 plural = 's' if not benchmarks or numBench[0] > 1 else '' |
f694daada5bf
mx jmh: display the number of benchmarks that will run
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13948
diff
changeset
|
1750 number = str(numBench[0]) if benchmarks else "all" |
f694daada5bf
mx jmh: display the number of benchmarks that will run
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13948
diff
changeset
|
1751 mx.log("Running " + number + " benchmark" + plural + '...') |
13935
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1752 |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1753 regex = [] |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1754 if benchmarks: |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1755 regex.append(r".*(" + "|".join(benchmarks) + ").*") |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1756 |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1757 for suite in matchedSuites: |
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1758 absoluteMicro = os.path.join(jmhPath, suite) |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1759 (pfx, exe, vm, forkedVmArgs, _) = parseVmArgs(vmArgs) |
13951
392b6ac8da36
Allow using run_java without the arguments from -J -Ja -Jp. Factor out the argument processing of mx_graal.vm and use it to pass tested-vm args down through the jmh harness
Bernhard Urban <bernhard.urban@jku.at>
parents:
13949
diff
changeset
|
1760 if pfx: |
18306 | 1761 mx.log("JMH ignores prefix: \"" + ' '.join(pfx) + "\"") |
15021
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1762 javaArgs = ['-jar', os.path.join(absoluteMicro, "target", "microbenchmarks.jar"), |
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1763 '--jvm', exe, |
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1764 '--jvmArgs', ' '.join(["-" + vm] + forkedVmArgs)] |
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1765 for k, v in jmhArgs.iteritems(): |
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1766 javaArgs.append(k) |
15051
2df054b37edc
add support for removing default JMH args (e.g., '{"-wi" : null, "-i" : null}')
Doug Simon <doug.simon@oracle.com>
parents:
15048
diff
changeset
|
1767 if len(str(v)): |
2df054b37edc
add support for removing default JMH args (e.g., '{"-wi" : null, "-i" : null}')
Doug Simon <doug.simon@oracle.com>
parents:
15048
diff
changeset
|
1768 javaArgs.append(str(v)) |
15021
9dcd5407a603
added support for overriding/complementing JMH arguments in jmh command with a JSON string
Doug Simon <doug.simon@oracle.com>
parents:
15014
diff
changeset
|
1769 mx.run_java(javaArgs + regex, addDefaultArgs=False, cwd=jmhPath) |
13935
ca0e1af320f6
mx: add support for jmh benchmark suites
Bernhard Urban <bernhard.urban@jku.at>
parents:
13928
diff
changeset
|
1770 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1771 def microbench(args): |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1772 """run JMH microbenchmark projects""" |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1773 vmArgs, jmhArgs = mx.extract_VM_args(args, useDoubleDash=True) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1774 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1775 # look for -f in JMH arguments |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1776 containsF = False |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1777 forking = True |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1778 for i in range(len(jmhArgs)): |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1779 arg = jmhArgs[i] |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1780 if arg.startswith('-f'): |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1781 containsF = True |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1782 if arg == '-f' and (i+1) < len(jmhArgs): |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1783 arg += jmhArgs[i+1] |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1784 try: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1785 if int(arg[2:]) == 0: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1786 forking = False |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1787 except ValueError: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1788 pass |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1789 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1790 # default to -f1 if not specified otherwise |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1791 if not containsF: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1792 jmhArgs += ['-f1'] |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1793 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1794 # find all projects with a direct JMH dependency |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1795 jmhProjects = [] |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1796 for p in mx.projects(): |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1797 if 'JMH' in p.deps: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1798 jmhProjects.append(p.name) |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1799 cp = mx.classpath(jmhProjects) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1800 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1801 # execute JMH runner |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1802 args = ['-cp', cp] |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1803 if not forking: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1804 args += vmArgs |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1805 args += ['org.openjdk.jmh.Main'] |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1806 if forking: |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1807 (_, _, jvm, _, _) = parseVmArgs(vmArgs) |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1808 args += ['--jvmArgsPrepend', ' '.join(['-' + jvm] + vmArgs)] |
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1809 vm(args + jmhArgs) |
8506
c3657d00e343
-Merge with tip
Christos Kotselidis <christos.kotselidis@oracle.com>
parents:
8406
diff
changeset
|
1810 |
5596
e4b1bc5e29e0
hsdis library is downloaded into newly created Graal JDK
Doug Simon <doug.simon@oracle.com>
parents:
5517
diff
changeset
|
1811 def hsdis(args, copyToDir=None): |
6291
633136426f26
consolidated jtt command into unittest command and removed need for explicit 'testHarness' property in 'projects' file
Doug Simon <doug.simon@oracle.com>
parents:
6278
diff
changeset
|
1812 """download the hsdis library |
4482
7903b6c28f9c
Add hsdis command to mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4480
diff
changeset
|
1813 |
7903b6c28f9c
Add hsdis command to mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4480
diff
changeset
|
1814 This is needed to support HotSpot's assembly dumping features. |
5596
e4b1bc5e29e0
hsdis library is downloaded into newly created Graal JDK
Doug Simon <doug.simon@oracle.com>
parents:
5517
diff
changeset
|
1815 By default it downloads the Intel syntax version, use the 'att' argument to install AT&T syntax.""" |
4482
7903b6c28f9c
Add hsdis command to mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4480
diff
changeset
|
1816 flavor = 'intel' |
7903b6c28f9c
Add hsdis command to mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4480
diff
changeset
|
1817 if 'att' in args: |
7903b6c28f9c
Add hsdis command to mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4480
diff
changeset
|
1818 flavor = 'att' |
19691
84b85c43633b
[SPARC] Install hsdis-sparcv9.so into the jvm with mx
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19430
diff
changeset
|
1819 if mx.get_arch() == "sparcv9": |
84b85c43633b
[SPARC] Install hsdis-sparcv9.so into the jvm with mx
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19430
diff
changeset
|
1820 flavor = "sparcv9" |
17012
ad10671d1bbd
mx: move get_arch() to mxtool
Bernhard Urban <bernhard.urban@jku.at>
parents:
16983
diff
changeset
|
1821 lib = mx.add_lib_suffix('hsdis-' + mx.get_arch()) |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
1822 path = join(_suite.dir, 'lib', lib) |
16599
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1823 |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1824 sha1s = { |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1825 'att/hsdis-amd64.dll' : 'bcbd535a9568b5075ab41e96205e26a2bac64f72', |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1826 'att/hsdis-amd64.so' : '58919ba085d4ef7a513f25bae75e7e54ee73c049', |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1827 'intel/hsdis-amd64.dll' : '6a388372cdd5fe905c1a26ced614334e405d1f30', |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1828 'intel/hsdis-amd64.so' : '844ed9ffed64fe9599638f29a8450c50140e3192', |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1829 'intel/hsdis-amd64.dylib' : 'fdb13ef0d7d23d93dacaae9c98837bea0d4fc5a2', |
20989
4213d02d95b5
Update hsdis for SPARC to latest binutils version (VIS3 and OSA2011 architecture included)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
20967
diff
changeset
|
1830 'sparcv9/hsdis-sparcv9.so': '970640a9af0bd63641f9063c11275b371a59ee60', |
16599
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1831 } |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1832 |
16976
87fc600ec586
mx: skip downloading hsdis if not available.
Josef Eisl <josef.eisl@jku.at>
parents:
16918
diff
changeset
|
1833 flavoredLib = flavor + "/" + lib |
87fc600ec586
mx: skip downloading hsdis if not available.
Josef Eisl <josef.eisl@jku.at>
parents:
16918
diff
changeset
|
1834 if flavoredLib not in sha1s: |
87fc600ec586
mx: skip downloading hsdis if not available.
Josef Eisl <josef.eisl@jku.at>
parents:
16918
diff
changeset
|
1835 mx.logv("hsdis not supported on this plattform or architecture") |
87fc600ec586
mx: skip downloading hsdis if not available.
Josef Eisl <josef.eisl@jku.at>
parents:
16918
diff
changeset
|
1836 return |
87fc600ec586
mx: skip downloading hsdis if not available.
Josef Eisl <josef.eisl@jku.at>
parents:
16918
diff
changeset
|
1837 |
5189
6fbf12b8e572
automated download of hsdis lib if PrintAssembly option is used; added support for hsdis on the Mac
Doug Simon <doug.simon@oracle.com>
parents:
5153
diff
changeset
|
1838 if not exists(path): |
16599
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1839 sha1 = sha1s[flavoredLib] |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1840 sha1path = path + '.sha1' |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1841 mx.download_file_with_sha1('hsdis', path, ['http://lafo.ssw.uni-linz.ac.at/hsdis/' + flavoredLib], sha1, sha1path, True, True, sources=False) |
5596
e4b1bc5e29e0
hsdis library is downloaded into newly created Graal JDK
Doug Simon <doug.simon@oracle.com>
parents:
5517
diff
changeset
|
1842 if copyToDir is not None and exists(copyToDir): |
e4b1bc5e29e0
hsdis library is downloaded into newly created Graal JDK
Doug Simon <doug.simon@oracle.com>
parents:
5517
diff
changeset
|
1843 shutil.copy(path, copyToDir) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1844 |
5245 | 1845 def hcfdis(args): |
6291
633136426f26
consolidated jtt command into unittest command and removed need for explicit 'testHarness' property in 'projects' file
Doug Simon <doug.simon@oracle.com>
parents:
6278
diff
changeset
|
1846 """disassemble HexCodeFiles embedded in text files |
5245 | 1847 |
1848 Run a tool over the input files to convert all embedded HexCodeFiles | |
1849 to a disassembled format.""" | |
6958
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1850 |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1851 parser = ArgumentParser(prog='mx hcfdis') |
6958
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1852 parser.add_argument('-m', '--map', help='address to symbol map applied to disassembler output') |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1853 parser.add_argument('files', nargs=REMAINDER, metavar='files...') |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1854 |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1855 args = parser.parse_args(args) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1856 |
16599
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1857 path = mx.library('HCFDIS').get_path(resolve=True) |
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1858 mx.run_java(['-cp', path, 'com.oracle.max.hcfdis.HexCodeFileDis'] + args.files) |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1859 |
6958
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1860 if args.map is not None: |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1861 addressRE = re.compile(r'0[xX]([A-Fa-f0-9]+)') |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1862 with open(args.map) as fp: |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1863 lines = fp.read().splitlines() |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1864 symbols = dict() |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1865 for l in lines: |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1866 addressAndSymbol = l.split(' ', 1) |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1867 if len(addressAndSymbol) == 2: |
11514
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1868 address, symbol = addressAndSymbol |
dc3c8df55905
added support for pylint and fixed errors/warnings it found
Doug Simon <doug.simon@oracle.com>
parents:
11512
diff
changeset
|
1869 if address.startswith('0x'): |
6958
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1870 address = long(address, 16) |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1871 symbols[address] = symbol |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1872 for f in args.files: |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1873 with open(f) as fp: |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1874 lines = fp.read().splitlines() |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1875 updated = False |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1876 for i in range(0, len(lines)): |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1877 l = lines[i] |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1878 for m in addressRE.finditer(l): |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1879 sval = m.group(0) |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1880 val = long(sval, 16) |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1881 sym = symbols.get(val) |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1882 if sym: |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1883 l = l.replace(sval, sym) |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1884 updated = True |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1885 lines[i] = l |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1886 if updated: |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1887 mx.log('updating ' + f) |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1888 with open('new_' + f, "w") as fp: |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1889 for l in lines: |
abbe4faaf0c1
added support for dumping an address to symbol map (with -G:+PrintAddressMap) to translate addresses in disassembled output (via new '-m' option to the hcfdis command)
Doug Simon <doug.simon@oracle.com>
parents:
6718
diff
changeset
|
1890 print >> fp, l |
5245 | 1891 |
4684
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1892 def jacocoreport(args): |
6291
633136426f26
consolidated jtt command into unittest command and removed need for explicit 'testHarness' property in 'projects' file
Doug Simon <doug.simon@oracle.com>
parents:
6278
diff
changeset
|
1893 """create a JaCoCo coverage report |
4684
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1894 |
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1895 Creates the report from the 'jacoco.exec' file in the current directory. |
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1896 Default output directory is 'coverage', but an alternative can be provided as an argument.""" |
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1897 jacocoreport = mx.library("JACOCOREPORT", True) |
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1898 out = 'coverage' |
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1899 if len(args) == 1: |
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1900 out = args[0] |
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1901 elif len(args) > 1: |
e136f2d0d002
Activate jtt for the gate
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
4660
diff
changeset
|
1902 mx.abort('jacocoreport takes only one argument : an output directory') |
18894
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1903 |
22054 | 1904 includes = ['com.oracle.graal', 'jdk.internal.jvmci'] |
18894
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1905 for p in mx.projects(): |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1906 projsetting = getattr(p, 'jacoco', '') |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1907 if projsetting == 'include': |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1908 includes.append(p.name) |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1909 |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1910 includedirs = set() |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1911 for p in mx.projects(): |
19796
c70ef0d09be9
use the 'jacoco=exclude' project property when deciding which directories to include in JaCoCo coverage reports
Doug Simon <doug.simon@oracle.com>
parents:
19779
diff
changeset
|
1912 projsetting = getattr(p, 'jacoco', '') |
c70ef0d09be9
use the 'jacoco=exclude' project property when deciding which directories to include in JaCoCo coverage reports
Doug Simon <doug.simon@oracle.com>
parents:
19779
diff
changeset
|
1913 if projsetting == 'exclude': |
c70ef0d09be9
use the 'jacoco=exclude' project property when deciding which directories to include in JaCoCo coverage reports
Doug Simon <doug.simon@oracle.com>
parents:
19779
diff
changeset
|
1914 continue |
18894
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1915 for include in includes: |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1916 if include in p.dir: |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1917 includedirs.add(p.dir) |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1918 |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1919 for i in includedirs: |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1920 bindir = i + '/bin' |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1921 if not os.path.exists(bindir): |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1922 os.makedirs(bindir) |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1923 |
31960077ea9d
Specify jacoco project includes/excludes in suite.py
Paul Woegerer <paul.woegerer@oracle.com>
parents:
18893
diff
changeset
|
1924 mx.run_java(['-jar', jacocoreport.get_path(True), '--in', 'jacoco.exec', '--out', out] + sorted(includedirs)) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1925 |
21559
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1926 def isJVMCIEnabled(vm): |
be896a1983c0
recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21554
diff
changeset
|
1927 return vm != 'original' and not vm.endswith('nojvmci') |
9803
8e33b4ebfef1
add isGraalEnabled(vm) function in commands.py
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9667
diff
changeset
|
1928 |
16167
1f4955abca9b
mx: add jol command for java object layout introspection
Andreas Woess <andreas.woess@jku.at>
parents:
16117
diff
changeset
|
1929 def jol(args): |
1f4955abca9b
mx: add jol command for java object layout introspection
Andreas Woess <andreas.woess@jku.at>
parents:
16117
diff
changeset
|
1930 """Java Object Layout""" |
16599
89be7c4db12c
made sha1 signatures mandatory for libraries; made libraries for all downloading performed by commands in mx_graal
Doug Simon <doug.simon@oracle.com>
parents:
16499
diff
changeset
|
1931 joljar = mx.library('JOL_INTERNALS').get_path(resolve=True) |
16167
1f4955abca9b
mx: add jol command for java object layout introspection
Andreas Woess <andreas.woess@jku.at>
parents:
16117
diff
changeset
|
1932 candidates = mx.findclass(args, logToConsole=False, matcher=lambda s, classname: s == classname or classname.endswith('.' + s) or classname.endswith('$' + s)) |
18218
8588db09f5e9
mx jol: let user select from found classes, skip duplicates
Andreas Woess <andreas.woess@jku.at>
parents:
18163
diff
changeset
|
1933 |
8588db09f5e9
mx jol: let user select from found classes, skip duplicates
Andreas Woess <andreas.woess@jku.at>
parents:
18163
diff
changeset
|
1934 if len(candidates) > 0: |
18601
676f1800077c
mx: removed unused _read_projects_file function
Doug Simon <doug.simon@oracle.com>
parents:
18414
diff
changeset
|
1935 candidates = mx.select_items(sorted(candidates)) |
18218
8588db09f5e9
mx jol: let user select from found classes, skip duplicates
Andreas Woess <andreas.woess@jku.at>
parents:
18163
diff
changeset
|
1936 else: |
8588db09f5e9
mx jol: let user select from found classes, skip duplicates
Andreas Woess <andreas.woess@jku.at>
parents:
18163
diff
changeset
|
1937 # mx.findclass can be mistaken, don't give up yet |
8588db09f5e9
mx jol: let user select from found classes, skip duplicates
Andreas Woess <andreas.woess@jku.at>
parents:
18163
diff
changeset
|
1938 candidates = args |
16167
1f4955abca9b
mx: add jol command for java object layout introspection
Andreas Woess <andreas.woess@jku.at>
parents:
16117
diff
changeset
|
1939 |
1f4955abca9b
mx: add jol command for java object layout introspection
Andreas Woess <andreas.woess@jku.at>
parents:
16117
diff
changeset
|
1940 vm(['-javaagent:' + joljar, '-cp', os.pathsep.join([mx.classpath(), joljar]), "org.openjdk.jol.MainObjectInternals"] + candidates) |
1f4955abca9b
mx: add jol command for java object layout introspection
Andreas Woess <andreas.woess@jku.at>
parents:
16117
diff
changeset
|
1941 |
14772
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1942 def checkheaders(args): |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1943 """check Java source headers against any required pattern""" |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1944 failures = {} |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1945 for p in mx.projects(): |
22179
afc886bb27c7
added -s option to gate command to specify gate task at which to start
Doug Simon <doug.simon@oracle.com>
parents:
22173
diff
changeset
|
1946 if not p.isJavaProject(): |
14772
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1947 continue |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1948 |
18163
c88ab4f1f04a
re-enabled Checkstyle with the release of 6.0 that supports Java 8; fixed existing Checkstyle warnings
Doug Simon <doug.simon@oracle.com>
parents:
18116
diff
changeset
|
1949 csConfig = join(mx.project(p.checkstyleProj).dir, '.checkstyle_checks.xml') |
22020
36a7ec14279d
moved unit test support from mx_graal.py to mx.py
Doug Simon <doug.simon@oracle.com>
parents:
22019
diff
changeset
|
1950 if not exists(csConfig): |
36a7ec14279d
moved unit test support from mx_graal.py to mx.py
Doug Simon <doug.simon@oracle.com>
parents:
22019
diff
changeset
|
1951 mx.log('Cannot check headers for ' + p.name + ' - ' + csConfig + ' does not exist') |
36a7ec14279d
moved unit test support from mx_graal.py to mx.py
Doug Simon <doug.simon@oracle.com>
parents:
22019
diff
changeset
|
1952 continue |
14772
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1953 dom = xml.dom.minidom.parse(csConfig) |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1954 for module in dom.getElementsByTagName('module'): |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1955 if module.getAttribute('name') == 'RegexpHeader': |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1956 for prop in module.getElementsByTagName('property'): |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1957 if prop.getAttribute('name') == 'header': |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1958 value = prop.getAttribute('value') |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1959 matcher = re.compile(value, re.MULTILINE) |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1960 for sourceDir in p.source_dirs(): |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1961 for root, _, files in os.walk(sourceDir): |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1962 for name in files: |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1963 if name.endswith('.java') and name != 'package-info.java': |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1964 f = join(root, name) |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1965 with open(f) as fp: |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1966 content = fp.read() |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1967 if not matcher.match(content): |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1968 failures[f] = csConfig |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1969 for n, v in failures.iteritems(): |
18637
d5d1fbe270e9
mx: fixed format string
Doug Simon <doug.simon@oracle.com>
parents:
18635
diff
changeset
|
1970 mx.log('{0}: header does not match RegexpHeader defined in {1}'.format(n, v)) |
14772
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1971 return len(failures) |
c929a4a3b6c5
added checkheaders command for checking Java source headers without relying on Checkstyle
Doug Simon <doug.simon@oracle.com>
parents:
14769
diff
changeset
|
1972 |
22167
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1973 mx.update_commands(_suite, { |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1974 'build': [build, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1975 'buildjmh': [buildjmh, '[-options]'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1976 'buildvars': [buildvars, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1977 'buildvms': [buildvms, '[-options]'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1978 'c1visualizer' : [c1visualizer, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1979 'checkheaders': [checkheaders, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1980 'clean': [clean, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1981 'ctw': [ctw, '[-vmoptions|noinline|nocomplex|full]'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1982 'export': [export, '[-options] [zipfile]'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1983 'hsdis': [hsdis, '[att]'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1984 'hcfdis': [hcfdis, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1985 'igv' : [igv, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1986 'jdkhome': [print_jdkhome, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1987 'jmh': [jmh, '[VM options] [filters|JMH-args-as-json...]'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1988 'gate' : [gate, '[-options]'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1989 'makejmhdeps' : [makejmhdeps, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1990 'shortunittest' : [shortunittest, '[unittest options] [--] [VM options] [filters...]', mx_unittest.unittestHelpSuffix], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1991 'jacocoreport' : [jacocoreport, '[output directory]'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1992 'vm': [vm, '[-options] class [args...]'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1993 'deoptalot' : [deoptalot, '[n]'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1994 'longtests' : [longtests, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1995 'jol' : [jol, ''], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1996 'makefile' : [mx_jvmci_makefile.build_makefile, 'build makefiles for JDK build'], |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1997 }) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
1998 |
22167
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
1999 mx.add_argument('--jacoco', help='instruments com.oracle.* classes using JaCoCo', default='off', choices=['off', 'on', 'append']) |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2000 mx.add_argument('--vmcwd', dest='vm_cwd', help='current directory will be changed to <path> before the VM is executed', default=None, metavar='<path>') |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2001 mx.add_argument('--installed-jdks', help='the base directory in which the JDKs cloned from $JAVA_HOME exist. ' + |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2002 'The VM selected by --vm and --vmbuild options is under this directory (i.e., ' + |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2003 join('<path>', '<jdk-version>', '<vmbuild>', 'jre', 'lib', '<vm>', mx.add_lib_prefix(mx.add_lib_suffix('jvm'))) + ')', default=None, metavar='<path>') |
4156
843c8d6720da
Added 'export' command for creating a GraalVM zip file distribution without the Mercurial data or VM sources.
Doug Simon <doug.simon@oracle.com>
parents:
4155
diff
changeset
|
2004 |
22167
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2005 mx.add_argument('--vm', action='store', dest='vm', choices=_vmChoices.keys(), help='the VM type to build/run') |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2006 mx.add_argument('--vmbuild', action='store', dest='vmbuild', choices=_vmbuildChoices, help='the VM build to build/run (default: ' + _vmbuildChoices[0] + ')') |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2007 mx.add_argument('--ecl', action='store_true', dest='make_eclipse_launch', help='create launch configuration for running VM execution(s) in Eclipse') |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2008 mx.add_argument('--vmprefix', action='store', dest='vm_prefix', help='prefix for running the VM (e.g. "/usr/bin/gdb --args")', metavar='<prefix>') |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2009 mx.add_argument('--gdb', action='store_const', const='/usr/bin/gdb --args', dest='vm_prefix', help='alias for --vmprefix "/usr/bin/gdb --args"') |
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2010 mx.add_argument('--lldb', action='store_const', const='lldb --', dest='vm_prefix', help='alias for --vmprefix "lldb --"') |
4144
34527a24bcf8
Adopted mxtool changes.
Doug Simon <doug.simon@oracle.com>
parents:
3736
diff
changeset
|
2011 |
22041
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2012 class JVMCIArchiveParticipant: |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2013 def __init__(self, dist): |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2014 self.dist = dist |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2015 self.jvmciServices = {} |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2016 |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2017 def __opened__(self, arc, srcArc, services): |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2018 self.services = services |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2019 self.arc = arc |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2020 self.expectedOptionsProviders = set() |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2021 |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2022 def __add__(self, arcname, contents): |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2023 if arcname.startswith('META-INF/jvmci.services/'): |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2024 service = arcname[len('META-INF/jvmci.services/'):] |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2025 self.jvmciServices.setdefault(service, []).extend([provider for provider in contents.split('\n')]) |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2026 return True |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2027 if arcname.startswith('META-INF/jvmci.providers/'): |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2028 provider = arcname[len('META-INF/jvmci.providers/'):] |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
2029 for service in contents.split(os.linesep): |
22041
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2030 self.jvmciServices.setdefault(service, []).append(provider) |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2031 return True |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2032 elif arcname.startswith('META-INF/jvmci.options/'): |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2033 # Need to create service files for the providers of the |
22054 | 2034 # jdk.internal.jvmci.options.Options service created by |
2035 # jdk.internal.jvmci.options.processor.OptionProcessor. | |
22041
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2036 optionsOwner = arcname[len('META-INF/jvmci.options/'):] |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2037 provider = optionsOwner + '_Options' |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2038 self.expectedOptionsProviders.add(provider.replace('.', '/') + '.class') |
22054 | 2039 self.services.setdefault('jdk.internal.jvmci.options.Options', []).append(provider) |
22041
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2040 return False |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2041 |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2042 def __addsrc__(self, arcname, contents): |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2043 return False |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2044 |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2045 def __closing__(self): |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2046 self.expectedOptionsProviders -= set(self.arc.zf.namelist()) |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2047 assert len(self.expectedOptionsProviders) == 0, 'missing generated Options providers:\n ' + '\n '.join(self.expectedOptionsProviders) |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2048 for service, providers in self.jvmciServices.iteritems(): |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2049 arcname = 'META-INF/jvmci.services/' + service |
22042
db48a62aba36
only (re)make archives from build command if at least one compilation occurred
Doug Simon <doug.simon@oracle.com>
parents:
22041
diff
changeset
|
2050 # Convert providers to a set before printing to remove duplicates |
22142
8704244e4f6a
service provider configuration files must end with a new line
Doug Simon <doug.simon@oracle.com>
parents:
22141
diff
changeset
|
2051 self.arc.zf.writestr(arcname, '\n'.join(frozenset(providers))+ '\n') |
22041
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2052 |
22167
22b37f37be0a
adapted to removal of mx_init() mechanism from mx2
Doug Simon <doug.simon@oracle.com>
parents:
22166
diff
changeset
|
2053 def mx_post_parse_cmd_line(opts): |
7916
9bff64f43299
Better java version numbers support in mx
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
7788
diff
changeset
|
2054 # TODO _minVersion check could probably be part of a Suite in mx? |
21976
36e37644f91e
mx: improve first usage experience:
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21975
diff
changeset
|
2055 def _versionCheck(version): |
36e37644f91e
mx: improve first usage experience:
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21975
diff
changeset
|
2056 return version >= _minVersion and (not _untilVersion or version >= _untilVersion) |
36e37644f91e
mx: improve first usage experience:
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21975
diff
changeset
|
2057 versionDesc = ">=" + str(_minVersion) |
36e37644f91e
mx: improve first usage experience:
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21975
diff
changeset
|
2058 if _untilVersion: |
36e37644f91e
mx: improve first usage experience:
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21975
diff
changeset
|
2059 versionDesc += " and <=" + str(_untilVersion) |
36e37644f91e
mx: improve first usage experience:
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21975
diff
changeset
|
2060 mx.java(_versionCheck, versionDescription=versionDesc, defaultJdk=True) |
5729
dab877fe7c31
prevented error during mx site from corrupting an existing site
Doug Simon <doug.simon@oracle.com>
parents:
5708
diff
changeset
|
2061 |
22019
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
2062 if hasattr(opts, 'vm') and opts.vm is not None: |
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
2063 global _vm |
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
2064 _vm = opts.vm |
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
2065 _vm = _vm.replace('graal', 'jvmci') |
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
2066 if hasattr(opts, 'vmbuild') and opts.vmbuild is not None: |
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
2067 global _vmbuild |
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
2068 _vmbuild = opts.vmbuild |
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
2069 global _make_eclipse_launch |
07cfd3d7072b
removed _vmSourcesAvailable
Doug Simon <doug.simon@oracle.com>
parents:
22018
diff
changeset
|
2070 _make_eclipse_launch = getattr(opts, 'make_eclipse_launch', False) |
5024
7ccdae96e98a
Allow JaCoCon to append to the execution file
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5016
diff
changeset
|
2071 global _jacoco |
7ccdae96e98a
Allow JaCoCon to append to the execution file
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
5016
diff
changeset
|
2072 _jacoco = opts.jacoco |
11401
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
2073 global _vm_cwd |
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
2074 _vm_cwd = opts.vm_cwd |
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
2075 global _installed_jdks |
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
2076 _installed_jdks = opts.installed_jdks |
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
2077 global _vm_prefix |
2d228d304247
minor improvements/cleanups to mx (CR-1313)
Doug Simon <doug.simon@oracle.com>
parents:
11395
diff
changeset
|
2078 _vm_prefix = opts.vm_prefix |
8134
6e3ebc6fd5a4
graal.jar is installed in all JDKs every time it is updated (GRAAL-136)
Doug Simon <doug.simon@oracle.com>
parents:
8132
diff
changeset
|
2079 |
22139
ed35cb998428
Initial split off from monolithic basic-graal repo
Doug Simon <doug.simon@oracle.com>
parents:
22108
diff
changeset
|
2080 for jdkDist in jdkDeployedDists: |
21031
e1c063565b3c
Graal Services: use services files in jre/lib/graal/services
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
20996
diff
changeset
|
2081 def _close(jdkDeployable): |
e1c063565b3c
Graal Services: use services files in jre/lib/graal/services
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
20996
diff
changeset
|
2082 def _install(dist): |
e1c063565b3c
Graal Services: use services files in jre/lib/graal/services
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
20996
diff
changeset
|
2083 assert dist.name == jdkDeployable.name, dist.name + "!=" + jdkDeployable.name |
21741
b6ee5d3f3255
Exclude distributions from exporting which are delivered with HotSpot (JBS:GRAAL-52)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21740
diff
changeset
|
2084 if not jdkDist.partOfHotSpot: |
b6ee5d3f3255
Exclude distributions from exporting which are delivered with HotSpot (JBS:GRAAL-52)
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21740
diff
changeset
|
2085 _installDistInJdks(jdkDeployable) |
21031
e1c063565b3c
Graal Services: use services files in jre/lib/graal/services
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
20996
diff
changeset
|
2086 return _install |
22041
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2087 dist = mx.distribution(jdkDist.name) |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2088 dist.add_update_listener(_close(jdkDist)) |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2089 if jdkDist.usesJVMCIClassLoader: |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2090 dist.set_archiveparticipant(JVMCIArchiveParticipant(dist)) |
56c50504d60d
mx: removed JVMCI code from Distribution.make_archive
Doug Simon <doug.simon@oracle.com>
parents:
22031
diff
changeset
|
2091 |