@@ -57,9 +57,10 @@ def run(args, verbose=False):
57
57
ret = subprocess .Popen (args )
58
58
code = ret .wait ()
59
59
if code != 0 :
60
- if not verbose :
61
- print ("failed to run: " + ' ' .join (args ))
62
- raise RuntimeError ("failed to run command" )
60
+ err = "failed to run: " + ' ' .join (args )
61
+ if verbose :
62
+ raise RuntimeError (err )
63
+ sys .exit (err )
63
64
64
65
class RustBuild :
65
66
def download_rust_nightly (self ):
@@ -210,7 +211,10 @@ def build_triple(self):
210
211
if sys .platform == 'win32' :
211
212
return 'x86_64-pc-windows-msvc'
212
213
else :
213
- raise
214
+ err = "uname not found"
215
+ if self .verbose :
216
+ raise Exception (err )
217
+ sys .exit (err )
214
218
215
219
# Darwin's `uname -s` lies and always returns i386. We have to use
216
220
# sysctl instead.
@@ -253,7 +257,10 @@ def build_triple(self):
253
257
cputype = 'x86_64'
254
258
ostype = 'pc-windows-gnu'
255
259
else :
256
- raise ValueError ("unknown OS type: " + ostype )
260
+ err = "unknown OS type: " + ostype
261
+ if self .verbose :
262
+ raise ValueError (err )
263
+ sys .exit (err )
257
264
258
265
if cputype in {'i386' , 'i486' , 'i686' , 'i786' , 'x86' }:
259
266
cputype = 'i686'
@@ -269,7 +276,10 @@ def build_triple(self):
269
276
elif cputype in {'amd64' , 'x86_64' , 'x86-64' , 'x64' }:
270
277
cputype = 'x86_64'
271
278
else :
272
- raise ValueError ("unknown cpu type: " + cputype )
279
+ err = "unknown cpu type: " + cputype
280
+ if self .verbose :
281
+ raise ValueError (err )
282
+ sys .exit (err )
273
283
274
284
return cputype + '-' + ostype
275
285
0 commit comments