@@ -1154,6 +1154,15 @@ def python_build_watch(args):
1154
1154
1155
1155
1156
1156
class GraalpythonCAPIBuildTask (mx .ProjectBuildTask ):
1157
+ class PrefixingOutput ():
1158
+ def __init__ (self , prefix , printfunc ):
1159
+ self .prefix = "[" + prefix + "] "
1160
+ self .printfunc = printfunc
1161
+
1162
+ def __call__ (self , line ):
1163
+ # n.b.: mx already sends us the output line-by-line
1164
+ self .printfunc (self .prefix + line .rstrip ())
1165
+
1157
1166
def __init__ (self , args , project ):
1158
1167
jobs = min (mx .cpu_count (), 8 )
1159
1168
super (GraalpythonCAPIBuildTask , self ).__init__ (args , jobs , project )
@@ -1162,7 +1171,7 @@ def __str__(self):
1162
1171
return 'Building C API project {} with setuptools' .format (self .subject .name )
1163
1172
1164
1173
def run (self , args , env = None , cwd = None ):
1165
- return do_run_python (args , env = env , cwd = cwd )
1174
+ return do_run_python (args , env = env , cwd = cwd , out = self . PrefixingOutput ( self . subject . name , mx . log ), err = self . PrefixingOutput ( self . subject . name , mx . log_error ) )
1166
1175
1167
1176
def _dev_headers_dir (self ):
1168
1177
return os .path .join (SUITE .dir , "graalpython" , "include" )
0 commit comments