@@ -418,6 +418,10 @@ fn configure(opts: options) -> cargo {
418
418
419
419
if c. pgp {
420
420
pgp:: init ( c. root ) ;
421
+ } else {
422
+ warn ( "command \" gpg\" is not found" ) ;
423
+ warn ( "you have to install \" gpg\" from source " +
424
+ " or package manager to get it to work correctly" ) ;
421
425
}
422
426
423
427
c
@@ -436,8 +440,8 @@ fn test_one_crate(_c: cargo, _path: str, cf: str, _p: pkg) {
436
440
let buildpath = fs:: connect ( _path, "/test" ) ;
437
441
need_dir ( buildpath) ;
438
442
#debug ( "Testing: %s -> %s" , cf, buildpath) ;
439
- let p = run:: program_output ( "rustc" , [ "--out-dir" , buildpath , "--test" ,
440
- cf] ) ;
443
+ let p = run:: program_output ( rustc_sysroot ( ) ,
444
+ [ "--out-dir" , buildpath , "--test" , cf] ) ;
441
445
if p. status != 0 {
442
446
error ( #fmt[ "rustc failed: %d\n %s\n %s" , p. status , p. err , p. out ] ) ;
443
447
ret;
@@ -452,7 +456,8 @@ fn install_one_crate(c: cargo, _path: str, cf: str, _p: pkg) {
452
456
let buildpath = fs:: connect ( _path, "/build" ) ;
453
457
need_dir ( buildpath) ;
454
458
#debug ( "Installing: %s -> %s" , cf, buildpath) ;
455
- let p = run:: program_output ( "rustc" , [ "--out-dir" , buildpath, cf] ) ;
459
+ let p = run:: program_output ( rustc_sysroot ( ) ,
460
+ [ "--out-dir" , buildpath, cf] ) ;
456
461
if p. status != 0 {
457
462
error ( #fmt[ "rustc failed: %d\n %s\n %s" , p. status , p. err , p. out ] ) ;
458
463
ret;
@@ -473,6 +478,19 @@ fn install_one_crate(c: cargo, _path: str, cf: str, _p: pkg) {
473
478
}
474
479
}
475
480
481
+ fn rustc_sysroot ( ) -> str {
482
+ alt os:: get_exe_path ( ) {
483
+ some ( _path) {
484
+ let path = [ _path, ".." , "bin" , "rustc" ] ;
485
+ check vec:: is_not_empty ( path) ;
486
+ let rustc = fs:: normalize ( fs:: connect_many ( path) ) ;
487
+ #debug ( " rustc: %s" , rustc) ;
488
+ rustc
489
+ }
490
+ none { "rustc" }
491
+ }
492
+ }
493
+
476
494
fn install_source ( c : cargo , path : str ) {
477
495
#debug ( "source: %s" , path) ;
478
496
fs:: change_dir ( path) ;
0 commit comments