rust-lang / rustup

The Rust toolchain installer
https://rust-lang.github.io/rustup/
Apache License 2.0
6.15k stars 884 forks source link

rust won't install on ExFAT filesystem #2680

Open ghost opened 3 years ago

ghost commented 3 years ago

Problem Attempting to install rust via rustup-init on Windows 64bit on a ExFAT filesystem produces the error:

error: could not create link from 'X:\cargo\bin\rustup.exe' to 'X:\cargo\bin\rustfmt.exe'

Steps Where E is formated as ExFAT and rustup-init.exe is running from C: and has a filesystem of NTFS. Attempt to start the installer:

Welcome to Rust!

This will download and install the official compiler for the Rust programming language, and its package manager, Cargo.

Rustup metadata and toolchains will be installed into the Rustup home directory, located at:

E:\rust

This can be modified with the RUSTUP_HOME environment variable.

The Cargo home directory located at:

E:\cargo

This can be modified with the CARGO_HOME environment variable.

The cargo, rustc, rustup and other commands will be added to Cargo's bin directory, located at:

E:\cargo\bin

This path will then be added to your PATH environment variable by modifying the HKEY_CURRENT_USER/Environment/PATH registry key.

You can uninstall at any time with rustup self uninstall and these changes will be reverted.

Current installation options:

default host triple: x86_64-pc-windows-msvc default toolchain: stable (default) profile: default modify PATH variable: yes

1) Proceed with installation (default) 2) Customize installation 3) Cancel installation

1

error: could not create link from 'E:\cargo\bin\rustup.exe' to 'E:\cargo\bin\rustfmt.exe'

Press the Enter key to continue.

Possible Solution(s) Many other programming languages don't have this issue because they don't rely on links(golang, ruby, php, python etc.). Maybe make it so rust works without links.

Notes

Output of rustup --version: n/a Output of rustup show: n/a

kinnison commented 3 years ago

ExFAT does not support filesystem-level links which are required for rustup's proxy functionality as you surmised in your 'possible solutions'. In theory we could do without the links by creating copies of rustup for each proxy but that would be a significantly wasteful use of disk space.

At this time, this is a side-effect of implementation decisions, not a bug, and also not something we see as urgent to ameliorate, though if you have an idea of how to do this efficiently on ExFAT then I'd be interested to hear.

rbtcollins commented 3 years ago

There aren't that many proxies; OTOH we'd have more updates and possible things going wrong, skew etc. I think we could design for this eventually, but given team bandwidth is sharply limited, I completely concur with the help wanted aspect.

ghost commented 3 years ago

ExFAT does not support filesystem-level links which are required for rustup's proxy functionality as you surmised in your 'possible solutions'. In theory we could do without the links by creating copies of rustup for each proxy but that would be a significantly wasteful use of disk space.

At this time, this is a side-effect of implementation decisions, not a bug, and also not something we see as urgent to ameliorate, though if you have an idea of how to do this efficiently on ExFAT then I'd be interested to hear.

So how do other programming languages get over this issue? Am i correct that for example golang makes copies of itself every time? Also what do you mean by proxy functionality?

rbtcollins commented 3 years ago

I think most of your questions about rustup itself are covered in our documentation about how rustup works and what it does.

rust, as opposed to rustup, can be unpacked on exfat, and if you want to manually install for some reason, you can probably do that just fine - I presume thats your use case? Having a portable installation on some slow MMC device you can cart around?

As for other languages, you need to compare with things like pyenv, goenv, rubyenv, not the languages themselves: rustup is not rust, it is one possible installer for rust, just one that the community maintains and supports which meets the majority of use cases.

So: if your goal is to have rust work in your environment, I don't know if anything will prevent that today - rustup won't work, but rustup is not required for rust, it is merely very convenient.

If your goal is to have rustup work, you'll need to work on a patch - sorry - and I suggest the first step would be to install on a regular NTFS volume to get a working dev environment, and use that to start building up the necessary changes to rustup.

But, going back to your presumed use case of a portable install that can be carted around: I doubt that that will work well; rust requires system linkers - the MS visual C build tools - to link executables, and you'll need to solve making their install portable as well; you'll have to make the PATH changes on windows on every machine you port the install to, and finally rust itself is a tiny fraction of the size of most of the build volume of rust projects once the dependency graph from crates.io is considered. Making CARGO_HOME and your source code directories portable is doable, much more easily, and would solve most of the problems I suspect - unless the problems are things like locked down machines without internet access ... in which case Cargos desire for online access is going to make life difficult.

Perhaps I've missed something - in which case, let me know. But as I said to start with, we're open to supporting someone that wants to work on the ExFAT slice of the problem. The larger 'make rustup installs portable' use case is considerably more complicated, and I think will require whoever wants to work on it to spend considerable time thinking up good ways to solve the challenges mentioned above, and perhaps more not considered.

workingjubilee commented 3 years ago

@rustbot label: +O-windows

bytesnail commented 3 years ago

I encountered the same error on the REFS file system of the Windows 10 operating system.

zephms commented 1 year ago

I encountered the same error on the REFS file system of the Windows 10 operating system.

me too

Anivie commented 1 year ago

I encountered the same error on the REFS file system of the Windows 10 operating system.

This problem still exist.

kinnison commented 1 year ago

It will never be "fixed" for exfat - for REFS if you have a fully-up-to-date OS and you reformat then you can get hard-link support.

Version ReFS 3.5 formatted by Windows 10 Enterprise Insider Preview build 19536 and later. Hard links support is added for newly formatted volumes only. Hard links can't be used on volumes that have been upgraded from previous versions