Skip to content

Rust .msi installer ignores current install #26765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
abonander opened this issue Jul 3, 2015 · 14 comments
Open

Rust .msi installer ignores current install #26765

abonander opened this issue Jul 3, 2015 · 14 comments
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows P-low Low priority T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@abonander
Copy link
Contributor

One of the convenient features of the defunct .exe installer is it would remove old library archives before installing new ones, so that one could update Rust just by running over the current install. The .msi installer does not do this, it just naively installs the new libraries next to the old ones, and Rust can't figure out which to use:

rustbook\src\main.rs:1:1: 1:1 error: multiple matching crates for `std`
rustbook\src\main.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
                       ^
note: candidates:
note: path: \\?\C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\std-d855c359.dll
note: path: \\?\C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libstd-d855c359.rlib
note: crate name: std
note: path: \\?\C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\std-74fa456f.dll
note: path: \\?\C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libstd-74fa456f.rlib
note: crate name: std
rustbook\src\main.rs:1:1: 1:1 error: found staticlib `std` instead of rlib or dylib
rustbook\src\main.rs:1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
                       ^
rustbook\src\main.rs:1:1: 1:1 help: please recompile this crate using --crate-type lib
rustbook\src\main.rs:1:1: 1:1 note: crate `std` path #1: C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libstdc++.a
error: aborting due to 2 previous errors
Could not compile `rustbook`.

To learn more, run the command again with --verbose.

I can't simply update my Rust install anymore. I have to remove the old libraries either manually or by running the Rust uninstaller. This is a major convenience discrepancy compared to using Rust on the Unix-based platforms.

@abonander
Copy link
Contributor Author

Note: this issue is about installing a new version of Rust over an old version in the same folder. It doesn't concern installing separate versions of Rust in separate folders. An "Update" option to the installer that automatically selects the current Rust install path would be great as well, as it currently suggests something rather arbitrary, C:\Program Files\Rust nightly update 1.3 or something like that.

@retep998
Copy link
Member

retep998 commented Jul 4, 2015

I think because the name of the software changes with each version of Rust, the msi installation system ends up thinking that they are two different pieces of software and thus doesn't recognize the old version to ask you what you want to do with it. Ideally the installer would detect if there is an existing installation of Rust in the folder you're installing to and automatically uninstall the old one, but I'm not sure how to do that with msi.

@abonander
Copy link
Contributor Author

It's disappointing because the .exe installer did this. It was my preferred method of updating when it was still available.

@retep998
Copy link
Member

retep998 commented Jul 5, 2015

cc @brson @vadimcn

@vadimcn
Copy link
Contributor

vadimcn commented Jul 5, 2015

The .msi installer only updates versions which have the same (platform,channel,major,minor) tuple. For example it will update nightly 1.3.X -> 1.3.Y in-place. Everything else is treated as different software version - to enable installing them side-by side (which the .exe version did not allow). The detection is based on versions stored in the registry, not on the installation path.
In other words, this is by design. In order to gain something (side-by-side installs) you lose something (ease of upgrade for users who don't care about side-by-side)...

@abonander
Copy link
Contributor Author

That's an issue because I only really bother to update when the minor version gets bumped, as I expect is the same with many people. And, like I said, this is a pretty big discrepancy when you look at how easy it is to install and update Rust on the *nixes, package manager or otherwise.

Why does the Rust installer care about side-by-side installs anyways? Can't multirust be updated to support Windows for this? Is the .exe installer still being built but just doesn't have a link provided for it?

@vadimcn
Copy link
Contributor

vadimcn commented Jul 5, 2015

Why does the Rust installer care about side-by-side installs anyways?

This is based partly on my own preferences and partly because Python also does upgrades this way.

Can't multirust be updated to support Windows for this?

Multirust is a shell script that uses a bunch of unix command line tools, so it won't work on Windows without msys.

@brson
Copy link
Contributor

brson commented Jul 6, 2015

Nominating because this is surprising behavior to a lot of people.

@alexcrichton
Copy link
Member

triage: P-medium

Would love to fix, but doesn't seem super high priority right now.

@rust-highfive rust-highfive added P-medium Medium priority and removed I-nominated labels Jul 20, 2015
@J0s3f
Copy link

J0s3f commented Sep 30, 2015

This is very confusing for new users.
I just installed Rust 1.3 and had a old version of Rust 1.0, but never used it.
The first "Hello World" example gave me this error messages:

D:\code\rusty>rustc main.rs
main.rs:1:1: 1:1 error: multiple matching crates for `std`
main.rs:1 fn main() {
          ^
note: candidates:
note: path: \\?\D:\coding\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\std-4e7c5e5c.dll
note: path: \\?\D:\coding\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libstd-4e7c5e5c.rlib
note: crate name: std
note: path: \\?\D:\coding\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\std-198068b3.dll
note: path: \\?\D:\coding\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libstd-198068b3.rlib
note: crate name: std
main.rs:1:1: 1:1 error: found staticlib `std` instead of rlib or dylib
main.rs:1 fn main() {
          ^
main.rs:1:1: 1:1 help: please recompile this crate using --crate-type lib
main.rs:1:1: 1:1 note: crate `std` path #1: D:\coding\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libstdc++.a
error: aborting due to 2 previous errors

Google brought me here and I understand now that I shouldn't have installed Rust in the old directory, but still very confusing behaviour.

I just wish the updates for Rust in msys2 would come faster.

@Aldlevine
Copy link

To add to this issue, I'm not sure if this is specific to the .msi installer over the .exe installer, but it also appends the new directory to the PATH rather than replacing the current instance. This caused my system to prefer the old version rather than the new version and I had to update my PATH manually.

@brson
Copy link
Contributor

brson commented Aug 22, 2016

cc #35653

@brson brson added the P-low Low priority label Aug 22, 2016
@alexcrichton alexcrichton removed the P-medium Medium priority label Aug 22, 2016
@Mark-Simulacrum Mark-Simulacrum added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 24, 2017
@Mark-Simulacrum Mark-Simulacrum added T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. and removed A-infrastructure labels Jun 25, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@steveklabnik
Copy link
Member

Triage: I'm not totally sure, and frankly don't want to try and reproduce and mess up my local install, heh.

I'm not sure how important this is these days, in the world of rustup.

@Enselic
Copy link
Member

Enselic commented Nov 18, 2023

Triage: .msi is still provided as an official installation method: https://forge.rust-lang.org/infra/other-installation-methods.html. Can someone please check if this is still a problem? Many years has passed since this was last reported to be a problem. Thanks!

@Enselic Enselic added the O-windows Operating system: Windows label Nov 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-windows Operating system: Windows P-low Low priority T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

12 participants