@@ -262,14 +262,10 @@ pub fn install(no_prompt: bool, verbose: bool, mut opts: InstallOpts) -> Result<
262
262
}
263
263
264
264
let install_res: Result < ( ) > = ( || {
265
- cleanup_legacy ( ) ?;
266
265
install_bins ( ) ?;
267
266
if !opts. no_modify_path {
268
267
do_add_to_path ( & get_add_path_methods ( ) ) ?;
269
268
}
270
- // Create ~/.rustup and a compatibility ~/.multirust symlink.
271
- // FIXME: Someday we can stop setting up the symlink, and when
272
- // we do that we can stop creating ~/.rustup as well.
273
269
utils:: create_rustup_home ( ) ?;
274
270
maybe_install_rust ( & opts. default_toolchain , & opts. default_host_triple , verbose) ?;
275
271
@@ -340,9 +336,6 @@ fn rustc_or_cargo_exists_in_path() -> Result<()> {
340
336
!path
341
337
. components ( )
342
338
. any ( |c| c == Component :: Normal ( ".cargo" . as_ref ( ) ) )
343
- && !path
344
- . components ( )
345
- . any ( |c| c == Component :: Normal ( ".multirust" . as_ref ( ) ) )
346
339
}
347
340
348
341
if let Some ( paths) = env:: var_os ( "PATH" ) {
@@ -381,62 +374,13 @@ fn check_existence_of_rustc_or_cargo_in_path(no_prompt: bool) -> Result<()> {
381
374
}
382
375
383
376
fn do_pre_install_sanity_checks ( ) -> Result < ( ) > {
384
- let multirust_manifest_path = PathBuf :: from ( "/usr/local/lib/rustlib/manifest-multirust" ) ;
385
377
let rustc_manifest_path = PathBuf :: from ( "/usr/local/lib/rustlib/manifest-rustc" ) ;
386
378
let uninstaller_path = PathBuf :: from ( "/usr/local/lib/rustlib/uninstall.sh" ) ;
387
- let multirust_meta_path = utils:: home_dir ( ) . map ( |d| d. join ( ".multirust" ) ) ;
388
- let multirust_version_path = multirust_meta_path. as_ref ( ) . map ( |p| p. join ( "version" ) ) ;
389
379
let rustup_sh_path = utils:: home_dir ( ) . map ( |d| d. join ( ".rustup" ) ) ;
390
380
let rustup_sh_version_path = rustup_sh_path. as_ref ( ) . map ( |p| p. join ( "rustup-version" ) ) ;
391
381
392
- let multirust_exists = multirust_manifest_path. exists ( ) && uninstaller_path. exists ( ) ;
393
382
let rustc_exists = rustc_manifest_path. exists ( ) && uninstaller_path. exists ( ) ;
394
383
let rustup_sh_exists = rustup_sh_version_path. map ( |p| p. exists ( ) ) == Some ( true ) ;
395
- let old_multirust_meta_exists = if let Some ( ref multirust_version_path) = multirust_version_path
396
- {
397
- multirust_version_path. exists ( ) && {
398
- let version = utils:: read_file ( "old-multirust" , multirust_version_path) ;
399
- let version = version. unwrap_or ( String :: new ( ) ) ;
400
- let version = version. parse ( ) . unwrap_or ( 0 ) ;
401
- let cutoff_version = 12 ; // First rustup version
402
-
403
- version < cutoff_version
404
- }
405
- } else {
406
- false
407
- } ;
408
-
409
- match ( multirust_exists, old_multirust_meta_exists) {
410
- ( true , false ) => {
411
- warn ! ( "it looks like you have an existing installation of multirust" ) ;
412
- warn ! ( "rustup cannot be installed alongside multirust" ) ;
413
- warn ! (
414
- "run `{}` as root to uninstall multirust before installing rustup" ,
415
- uninstaller_path. display( )
416
- ) ;
417
- return Err ( "cannot install while multirust is installed" . into ( ) ) ;
418
- }
419
- ( false , true ) => {
420
- warn ! ( "it looks like you have existing multirust metadata" ) ;
421
- warn ! ( "rustup cannot be installed alongside multirust" ) ;
422
- warn ! (
423
- "delete `{}` before installing rustup" ,
424
- multirust_meta_path. expect( "" ) . display( )
425
- ) ;
426
- return Err ( "cannot install while multirust is installed" . into ( ) ) ;
427
- }
428
- ( true , true ) => {
429
- warn ! ( "it looks like you have an existing installation of multirust" ) ;
430
- warn ! ( "rustup cannot be installed alongside multirust" ) ;
431
- warn ! (
432
- "run `{}` as root and delete `{}` before installing rustup" ,
433
- uninstaller_path. display( ) ,
434
- multirust_meta_path. expect( "" ) . display( )
435
- ) ;
436
- return Err ( "cannot install while multirust is installed" . into ( ) ) ;
437
- }
438
- ( false , false ) => ( ) ,
439
- }
440
384
441
385
if rustc_exists {
442
386
warn ! ( "it looks like you have an existing installation of Rust" ) ;
@@ -666,36 +610,6 @@ fn customize_install(mut opts: InstallOpts) -> Result<InstallOpts> {
666
610
Ok ( opts)
667
611
}
668
612
669
- // Before rustup-rs installed bins to $CARGO_HOME/bin it installed
670
- // them to $RUSTUP_HOME/bin. If those bins continue to exist after
671
- // upgrade and are on the $PATH, it would cause major confusion. This
672
- // method silently deletes them.
673
- fn cleanup_legacy ( ) -> Result < ( ) > {
674
- let legacy_bin_dir = legacy_multirust_home_dir ( ) ?. join ( "bin" ) ;
675
-
676
- for tool in TOOLS . iter ( ) . cloned ( ) . chain ( vec ! [ "multirust" , "rustup" ] ) {
677
- let ref file = legacy_bin_dir. join ( & format ! ( "{}{}" , tool, EXE_SUFFIX ) ) ;
678
- if file. exists ( ) {
679
- utils:: remove_file ( "legacy-bin" , file) ?;
680
- }
681
- }
682
-
683
- return Ok ( ( ) ) ;
684
-
685
- #[ cfg( unix) ]
686
- fn legacy_multirust_home_dir ( ) -> Result < PathBuf > {
687
- Ok ( utils:: legacy_multirust_home ( ) ?)
688
- }
689
-
690
- #[ cfg( windows) ]
691
- fn legacy_multirust_home_dir ( ) -> Result < PathBuf > {
692
- use rustup:: utils:: raw:: windows:: { get_special_folder, FOLDERID_LocalAppData } ;
693
-
694
- // FIXME: This looks bogus. Where is the .multirust dir?
695
- Ok ( get_special_folder ( & FOLDERID_LocalAppData ) . unwrap_or ( PathBuf :: from ( "." ) ) )
696
- }
697
- }
698
-
699
613
fn install_bins ( ) -> Result < ( ) > {
700
614
let ref bin_path = utils:: cargo_home ( ) ?. join ( "bin" ) ;
701
615
let ref this_exe_path = utils:: current_exe ( ) ?;
@@ -845,8 +759,6 @@ pub fn uninstall(no_prompt: bool) -> Result<()> {
845
759
846
760
info ! ( "removing rustup home" ) ;
847
761
848
- utils:: delete_legacy_multirust_symlink ( ) ?;
849
-
850
762
// Delete RUSTUP_HOME
851
763
let ref rustup_dir = utils:: rustup_home ( ) ?;
852
764
if rustup_dir. exists ( ) {
@@ -1631,12 +1543,5 @@ pub fn cleanup_self_updater() -> Result<()> {
1631
1543
utils:: remove_file ( "setup" , setup) ?;
1632
1544
}
1633
1545
1634
- // Transitional
1635
- let ref old_setup = cargo_home. join ( & format ! ( "bin/multirust-setup{}" , EXE_SUFFIX ) ) ;
1636
-
1637
- if old_setup. exists ( ) {
1638
- utils:: remove_file ( "setup" , old_setup) ?;
1639
- }
1640
-
1641
1546
Ok ( ( ) )
1642
1547
}
0 commit comments