@@ -262,14 +262,10 @@ pub fn install(no_prompt: bool, verbose: bool, mut opts: InstallOpts) -> Result<
262262 }
263263
264264 let install_res: Result < ( ) > = ( || {
265- cleanup_legacy ( ) ?;
266265 install_bins ( ) ?;
267266 if !opts. no_modify_path {
268267 do_add_to_path ( & get_add_path_methods ( ) ) ?;
269268 }
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.
273269 utils:: create_rustup_home ( ) ?;
274270 maybe_install_rust ( & opts. default_toolchain , & opts. default_host_triple , verbose) ?;
275271
@@ -340,9 +336,6 @@ fn rustc_or_cargo_exists_in_path() -> Result<()> {
340336 !path
341337 . components ( )
342338 . any ( |c| c == Component :: Normal ( ".cargo" . as_ref ( ) ) )
343- && !path
344- . components ( )
345- . any ( |c| c == Component :: Normal ( ".multirust" . as_ref ( ) ) )
346339 }
347340
348341 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<()> {
381374}
382375
383376fn do_pre_install_sanity_checks ( ) -> Result < ( ) > {
384- let multirust_manifest_path = PathBuf :: from ( "/usr/local/lib/rustlib/manifest-multirust" ) ;
385377 let rustc_manifest_path = PathBuf :: from ( "/usr/local/lib/rustlib/manifest-rustc" ) ;
386378 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" ) ) ;
389379 let rustup_sh_path = utils:: home_dir ( ) . map ( |d| d. join ( ".rustup" ) ) ;
390380 let rustup_sh_version_path = rustup_sh_path. as_ref ( ) . map ( |p| p. join ( "rustup-version" ) ) ;
391381
392- let multirust_exists = multirust_manifest_path. exists ( ) && uninstaller_path. exists ( ) ;
393382 let rustc_exists = rustc_manifest_path. exists ( ) && uninstaller_path. exists ( ) ;
394383 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- }
440384
441385 if rustc_exists {
442386 warn ! ( "it looks like you have an existing installation of Rust" ) ;
@@ -666,36 +610,6 @@ fn customize_install(mut opts: InstallOpts) -> Result<InstallOpts> {
666610 Ok ( opts)
667611}
668612
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-
699613fn install_bins ( ) -> Result < ( ) > {
700614 let ref bin_path = utils:: cargo_home ( ) ?. join ( "bin" ) ;
701615 let ref this_exe_path = utils:: current_exe ( ) ?;
@@ -845,8 +759,6 @@ pub fn uninstall(no_prompt: bool) -> Result<()> {
845759
846760 info ! ( "removing rustup home" ) ;
847761
848- utils:: delete_legacy_multirust_symlink ( ) ?;
849-
850762 // Delete RUSTUP_HOME
851763 let ref rustup_dir = utils:: rustup_home ( ) ?;
852764 if rustup_dir. exists ( ) {
@@ -1631,12 +1543,5 @@ pub fn cleanup_self_updater() -> Result<()> {
16311543 utils:: remove_file ( "setup" , setup) ?;
16321544 }
16331545
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-
16411546 Ok ( ( ) )
16421547}
0 commit comments