comparison mx/commands.py @ 11756:78e6109ee411

mx refactoring for split-repo suites; should have no effect on existing repos
author Mick Jordan <mick.jordan@oracle.com>
date Mon, 23 Sep 2013 21:30:35 -0700
parents 3676540f71cf
children ec058ce90a3d
comparison
equal deleted inserted replaced
11755:bbcb72443066 11756:78e6109ee411
943 vmargs.insert(0, '-XX:-BootstrapGraal') 943 vmargs.insert(0, '-XX:-BootstrapGraal')
944 vm(vmargs, vm=v, vmbuild=vmbuild) 944 vm(vmargs, vm=v, vmbuild=vmbuild)
945 allDuration = datetime.timedelta(seconds=time.time() - allStart) 945 allDuration = datetime.timedelta(seconds=time.time() - allStart)
946 mx.log('TOTAL TIME: ' + '[' + str(allDuration) + ']') 946 mx.log('TOTAL TIME: ' + '[' + str(allDuration) + ']')
947 947
948 def gate(args): 948 class Task:
949 def __init__(self, title):
950 self.start = time.time()
951 self.title = title
952 self.end = None
953 self.duration = None
954 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: BEGIN: ') + title)
955 def stop(self):
956 self.end = time.time()
957 self.duration = datetime.timedelta(seconds=self.end - self.start)
958 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: END: ') + self.title + ' [' + str(self.duration) + ']')
959 return self
960 def abort(self, codeOrMessage):
961 self.end = time.time()
962 self.duration = datetime.timedelta(seconds=self.end - self.start)
963 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: ABORT: ') + self.title + ' [' + str(self.duration) + ']')
964 mx.abort(codeOrMessage)
965 return self
966
967 def _basic_gate_body(args, tasks):
968 t = Task('BuildHotSpotGraal: fastdebug,product')
969 buildvms(['--vms', 'graal,server', '--builds', 'fastdebug,product'])
970 tasks.append(t.stop())
971
972 with VM('graal', 'fastdebug'):
973 t = Task('BootstrapWithSystemAssertions:fastdebug')
974 vm(['-esa', '-version'])
975 tasks.append(t.stop())
976
977 with VM('graal', 'product'):
978 t = Task('BootstrapWithGCVerification:product')
979 vm(['-XX:+UnlockDiagnosticVMOptions', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'])
980 tasks.append(t.stop())
981
982 with VM('graal', 'product'):
983 t = Task('BootstrapWithG1GCVerification:product')
984 vm(['-XX:+UnlockDiagnosticVMOptions', '-XX:-UseSerialGC', '-XX:+UseG1GC', '-XX:+UseNewCode', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'])
985 tasks.append(t.stop())
986
987 with VM('graal', 'product'):
988 t = Task('BootstrapWithRegisterPressure:product')
989 vm(['-G:RegisterPressure=rbx,r11,r10,r14,xmm3,xmm11,xmm14', '-esa', '-version'])
990 tasks.append(t.stop())
991
992 with VM('graal', 'product'):
993 t = Task('BootstrapWithAOTConfiguration:product')
994 vm(['-G:+AOTCompilation', '-G:+VerifyPhases', '-esa', '-version'])
995 tasks.append(t.stop())
996
997 with VM('server', 'product'): # hosted mode
998 t = Task('UnitTests:hosted-product')
999 unittest([])
1000 tasks.append(t.stop())
1001
1002 for vmbuild in ['fastdebug', 'product']:
1003 for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild):
1004 t = Task(str(test) + ':' + vmbuild)
1005 if not test.test('graal'):
1006 t.abort(test.name + ' Failed')
1007 tasks.append(t.stop())
1008
1009 if args.jacocout is not None:
1010 jacocoreport([args.jacocout])
1011
1012 _jacoco = 'off'
1013
1014 t = Task('CleanAndBuildGraalVisualizer')
1015 mx.run(['ant', '-f', join(_graal_home, 'visualizer', 'build.xml'), '-q', 'clean', 'build'])
1016 tasks.append(t.stop())
1017
1018 # Prevent Graal modifications from breaking the standard builds
1019 if args.buildNonGraal:
1020 t = Task('BuildHotSpotVarieties')
1021 buildvms(['--vms', 'client,server', '--builds', 'fastdebug,product'])
1022 buildvms(['--vms', 'server-nograal', '--builds', 'product'])
1023 buildvms(['--vms', 'server-nograal', '--builds', 'optimized'])
1024 tasks.append(t.stop())
1025
1026 for vmbuild in ['product', 'fastdebug']:
1027 for theVm in ['client', 'server']:
1028 with VM(theVm, vmbuild):
1029 t = Task('DaCapo_pmd:' + theVm + ':' + vmbuild)
1030 dacapo(['pmd'])
1031 tasks.append(t.stop())
1032
1033 t = Task('UnitTests:' + theVm + ':' + vmbuild)
1034 unittest(['-XX:CompileCommand=exclude,*::run*', 'graal.api'])
1035 tasks.append(t.stop())
1036
1037
1038 def gate(args, gate_body=_basic_gate_body):
949 """run the tests used to validate a push 1039 """run the tests used to validate a push
950 1040
951 If this command exits with a 0 exit code, then the source code is in 1041 If this command exits with a 0 exit code, then the source code is in
952 a state that would be accepted for integration into the main repository.""" 1042 a state that would be accepted for integration into the main repository."""
953
954 class Task:
955 def __init__(self, title):
956 self.start = time.time()
957 self.title = title
958 self.end = None
959 self.duration = None
960 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: BEGIN: ') + title)
961 def stop(self):
962 self.end = time.time()
963 self.duration = datetime.timedelta(seconds=self.end - self.start)
964 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: END: ') + self.title + ' [' + str(self.duration) + ']')
965 return self
966 def abort(self, codeOrMessage):
967 self.end = time.time()
968 self.duration = datetime.timedelta(seconds=self.end - self.start)
969 mx.log(time.strftime('gate: %d %b %Y %H:%M:%S: ABORT: ') + self.title + ' [' + str(self.duration) + ']')
970 mx.abort(codeOrMessage)
971 return self
972 1043
973 parser = ArgumentParser(prog='mx gate') 1044 parser = ArgumentParser(prog='mx gate')
974 parser.add_argument('-j', '--omit-java-clean', action='store_false', dest='cleanJava', help='omit cleaning Java native code') 1045 parser.add_argument('-j', '--omit-java-clean', action='store_false', dest='cleanJava', help='omit cleaning Java native code')
975 parser.add_argument('-n', '--omit-native-clean', action='store_false', dest='cleanNative', help='omit cleaning and building native code') 1046 parser.add_argument('-n', '--omit-native-clean', action='store_false', dest='cleanNative', help='omit cleaning and building native code')
976 parser.add_argument('-g', '--only-build-graalvm', action='store_false', dest='buildNonGraal', help='only build the Graal VM') 1047 parser.add_argument('-g', '--only-build-graalvm', action='store_false', dest='buildNonGraal', help='only build the Graal VM')
1029 1100
1030 if args.jacocout is not None: 1101 if args.jacocout is not None:
1031 _jacoco = 'append' 1102 _jacoco = 'append'
1032 else: 1103 else:
1033 _jacoco = 'off' 1104 _jacoco = 'off'
1034 1105
1035 t = Task('BuildHotSpotGraal: fastdebug,product') 1106 gate_body(args, tasks)
1036 buildvms(['--vms', 'graal,server', '--builds', 'fastdebug,product'])
1037 tasks.append(t.stop())
1038
1039 with VM('graal', 'fastdebug'):
1040 t = Task('BootstrapWithSystemAssertions:fastdebug')
1041 vm(['-esa', '-version'])
1042 tasks.append(t.stop())
1043
1044 with VM('graal', 'product'):
1045 t = Task('BootstrapWithGCVerification:product')
1046 vm(['-XX:+UnlockDiagnosticVMOptions', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'])
1047 tasks.append(t.stop())
1048
1049 with VM('graal', 'product'):
1050 t = Task('BootstrapWithG1GCVerification:product')
1051 vm(['-XX:+UnlockDiagnosticVMOptions', '-XX:-UseSerialGC', '-XX:+UseG1GC', '-XX:+UseNewCode', '-XX:+VerifyBeforeGC', '-XX:+VerifyAfterGC', '-version'])
1052 tasks.append(t.stop())
1053
1054 with VM('graal', 'product'):
1055 t = Task('BootstrapWithRegisterPressure:product')
1056 vm(['-G:RegisterPressure=rbx,r11,r10,r14,xmm3,xmm11,xmm14', '-esa', '-version'])
1057 tasks.append(t.stop())
1058
1059 with VM('graal', 'product'):
1060 t = Task('BootstrapWithAOTConfiguration:product')
1061 vm(['-G:+AOTCompilation', '-G:+VerifyPhases', '-esa', '-version'])
1062 tasks.append(t.stop())
1063
1064 with VM('server', 'product'): # hosted mode
1065 t = Task('UnitTests:hosted-product')
1066 unittest([])
1067 tasks.append(t.stop())
1068
1069 for vmbuild in ['fastdebug', 'product']:
1070 for test in sanitycheck.getDacapos(level=sanitycheck.SanityCheckLevel.Gate, gateBuildLevel=vmbuild):
1071 t = Task(str(test) + ':' + vmbuild)
1072 if not test.test('graal'):
1073 t.abort(test.name + ' Failed')
1074 tasks.append(t.stop())
1075
1076 if args.jacocout is not None:
1077 jacocoreport([args.jacocout])
1078
1079 _jacoco = 'off'
1080
1081 t = Task('CleanAndBuildGraalVisualizer')
1082 mx.run(['ant', '-f', join(_graal_home, 'visualizer', 'build.xml'), '-q', 'clean', 'build'])
1083 tasks.append(t.stop())
1084
1085 # Prevent Graal modifications from breaking the standard builds
1086 if args.buildNonGraal:
1087 t = Task('BuildHotSpotVarieties')
1088 buildvms(['--vms', 'client,server', '--builds', 'fastdebug,product'])
1089 buildvms(['--vms', 'server-nograal', '--builds', 'product'])
1090 buildvms(['--vms', 'server-nograal', '--builds', 'optimized'])
1091 tasks.append(t.stop())
1092
1093 for vmbuild in ['product', 'fastdebug']:
1094 for theVm in ['client', 'server']:
1095 with VM(theVm, vmbuild):
1096 t = Task('DaCapo_pmd:' + theVm + ':' + vmbuild)
1097 dacapo(['pmd'])
1098 tasks.append(t.stop())
1099
1100 t = Task('UnitTests:' + theVm + ':' + vmbuild)
1101 unittest(['-XX:CompileCommand=exclude,*::run*', 'graal.api'])
1102 tasks.append(t.stop())
1103 1107
1104 except KeyboardInterrupt: 1108 except KeyboardInterrupt:
1105 total.abort(1) 1109 total.abort(1)
1106 1110
1107 except BaseException as e: 1111 except BaseException as e:
1114 mx.log('Gate task times:') 1118 mx.log('Gate task times:')
1115 for t in tasks: 1119 for t in tasks:
1116 mx.log(' ' + str(t.duration) + '\t' + t.title) 1120 mx.log(' ' + str(t.duration) + '\t' + t.title)
1117 mx.log(' =======') 1121 mx.log(' =======')
1118 mx.log(' ' + str(total.duration)) 1122 mx.log(' ' + str(total.duration))
1119 1123
1120 def deoptalot(args): 1124 def deoptalot(args):
1121 """bootstrap a fastdebug Graal VM with DeoptimizeALot and VerifyOops on 1125 """bootstrap a fastdebug Graal VM with DeoptimizeALot and VerifyOops on
1122 1126
1123 If the first argument is a number, the process will be repeated 1127 If the first argument is a number, the process will be repeated
1124 this number of times. All other arguments are passed to the VM.""" 1128 this number of times. All other arguments are passed to the VM."""