@@ -1138,7 +1138,7 @@ def python_build_watch(args):
1138
1138
1139
1139
class GraalpythonCAPIBuildTask (mx .ProjectBuildTask ):
1140
1140
def __init__ (self , args , project ):
1141
- jobs = 1 # no point in using more than 1 job
1141
+ jobs = min ( mx . cpu_count (), 8 )
1142
1142
super (GraalpythonCAPIBuildTask , self ).__init__ (args , jobs , project )
1143
1143
1144
1144
def __str__ (self ):
@@ -1155,17 +1155,20 @@ def build(self):
1155
1155
args .append ("-v" )
1156
1156
elif mx ._opts .quiet :
1157
1157
args .append ("-q" )
1158
- args += ["-S" , os .path .join (self .subject . dir , "setup.py" ), self .subject .get_output_root ()]
1158
+ args += ["-S" , os .path .join (self .src_dir () , "setup.py" ), self .subject .get_output_root ()]
1159
1159
mx .ensure_dir_exists (cwd )
1160
1160
home = os .path .join (SUITE .dir , "graalpython" )
1161
1161
rc = self .run (args , env = env , cwd = cwd )
1162
1162
shutil .rmtree (cwd ) # remove the temporary build files
1163
1163
return min (rc , 1 )
1164
1164
1165
+ def src_dir (self ):
1166
+ return self .subject .dir
1167
+
1165
1168
def needsBuild (self , newestInput ):
1166
1169
tsNewest = 0
1167
1170
newestFile = None
1168
- for root ,dirs ,files in os .walk (self .subject . dir ):
1171
+ for root ,dirs ,files in os .walk (self .src_dir () ):
1169
1172
for f in files :
1170
1173
ts = os .path .getmtime (os .path .join (root , f ))
1171
1174
if tsNewest < ts :
0 commit comments