@@ -181,7 +181,10 @@ pub trait CtxMethods {
181
181
/// second is a list of declared and discovered inputs
182
182
fn install ( & self , src : PkgSrc ) -> ( ~[ Path ] , ~[ ( ~str , ~str ) ] ) ;
183
183
/// Returns a list of installed files
184
- fn install_no_build ( & self , workspace : & Path , id : & PkgId ) -> ~[ Path ] ;
184
+ fn install_no_build ( & self ,
185
+ source_workspace : & Path ,
186
+ target_workspace : & Path ,
187
+ id : & PkgId ) -> ~[ Path ] ;
185
188
fn prefer ( & self , _id : & str , _vers : Option < ~str > ) ;
186
189
fn test ( & self ) ;
187
190
fn uninstall ( & self , _id : & str , _vers : Option < ~str > ) ;
@@ -464,28 +467,40 @@ impl CtxMethods for BuildContext {
464
467
// install to the first workspace in the RUST_PATH if there's
465
468
// a non-default RUST_PATH. This code installs to the same
466
469
// workspace the package was built in.
467
- debug ! ( "install: destination workspace = %s, id = %s" ,
468
- destination_workspace, id_str) ;
469
- let result = subself. install_no_build ( & Path ( destination_workspace) , & sub_id) ;
470
+ let actual_workspace = if path_util:: user_set_rust_path ( ) {
471
+ default_workspace ( )
472
+ }
473
+ else {
474
+ Path ( destination_workspace)
475
+ } ;
476
+ debug ! ( "install: destination workspace = %s, id = %s, installing to %s" ,
477
+ destination_workspace, id_str, actual_workspace. to_str( ) ) ;
478
+ let result = subself. install_no_build ( & Path ( destination_workspace) ,
479
+ & actual_workspace,
480
+ & sub_id) ;
470
481
debug ! ( "install: id = %s, about to call discover_outputs, %?" ,
471
482
id_str, result. to_str( ) ) ;
472
483
473
484
discover_outputs ( exec, result. clone ( ) ) ;
474
485
sub_files. write ( |r| { * r = result. clone ( ) ; } ) ;
475
486
sub_inputs. write ( |r| { * r = * r + exec. lookup_discovered_inputs ( ) } ) ;
487
+ note ( fmt ! ( "Installed package %s to %s" , id_str, actual_workspace. to_str( ) ) ) ;
476
488
}
477
489
} ;
478
490
( installed_files. unwrap ( ) , inputs. unwrap ( ) )
479
491
}
480
492
481
- fn install_no_build ( & self , workspace : & Path , id : & PkgId ) -> ~[ Path ] {
493
+ fn install_no_build ( & self ,
494
+ source_workspace : & Path ,
495
+ target_workspace : & Path ,
496
+ id : & PkgId ) -> ~[ Path ] {
482
497
use conditions:: copy_failed:: cond;
483
498
484
499
// Now copy stuff into the install dirs
485
- let maybe_executable = built_executable_in_workspace ( id, workspace ) ;
486
- let maybe_library = built_library_in_workspace ( id, workspace ) ;
487
- let target_exec = target_executable_in_workspace ( id, workspace ) ;
488
- let target_lib = maybe_library. map ( |_p| target_library_in_workspace ( id, workspace ) ) ;
500
+ let maybe_executable = built_executable_in_workspace ( id, source_workspace ) ;
501
+ let maybe_library = built_library_in_workspace ( id, source_workspace ) ;
502
+ let target_exec = target_executable_in_workspace ( id, target_workspace ) ;
503
+ let target_lib = maybe_library. map ( |_p| target_library_in_workspace ( id, target_workspace ) ) ;
489
504
490
505
debug ! ( "target_exec = %s target_lib = %? \
491
506
maybe_executable = %? maybe_library = %?",
0 commit comments