rustup icon indicating copy to clipboard operation
rustup copied to clipboard

Specify disk space required *before* install

Open sbrl opened this issue 7 years ago • 17 comments

If I execute the | sh installer on my machine, it doesn't tell me how big the installation is before it just goes ahead with the install anyway.

As a computer owner, I want to be able to make an informed decision as to whether I install rustup or not based on the amount of disk space it will use.

sbrl avatar Dec 31 '17 19:12 sbrl

There are two issues with that:

  1. What about situations where automated scripts have been placed. Sure piping with the yes command will do the job. But the issue is. it will break existing scripts.

  2. If you want to have finer control over disk space, installation directories etc. A better solution seems like forking the script, placing all the options, maybe turning it into a fully-customized installer and even opening a pull request for that.

amar-laksh avatar Jan 02 '18 05:01 amar-laksh

Ah, I see your points. What I was trying to get at is that where it says this:

Current installation options:

   default host triple: x86_64-unknown-linux-gnu
     default toolchain: stable
  modify PATH variable: yes

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

...perhaps there could be an extra line saying something like disk space required: xyzMiB.

Unfortunately I'm not well-versed enough in the way rustup works to build my own installer :-(

sbrl avatar Jan 02 '18 11:01 sbrl

I'll look into it. A custom installer seems to be a good idea.

amar-laksh avatar Jan 02 '18 13:01 amar-laksh

BTW till that time could you please close the issue? (it shouldn't be an issue for the upstream to handle.)

amar-laksh avatar Jan 27 '18 06:01 amar-laksh

I don't think a custom installer is required for this? This seems like a good feature to have, although it will have to be a rough approximation.

Diggsey avatar May 30 '18 15:05 Diggsey

Indeed, a rough ballpark figure would be find, @Diggsey. Simply knowing if it's closer to 10MiB or 300MiB would be ok.

BTW till that time could you please close the issue? (it shouldn't be an issue for the upstream to handle.)

Erm is there another issue for me to subscribe to then instead, @amar-laksh? Or have I opened this issue against the wrong repo?

I'm very reluctant to close this issue unless there's another one I can subscribe to.

sbrl avatar May 30 '18 18:05 sbrl

This issue is fine.

Diggsey avatar May 30 '18 19:05 Diggsey

Found this issue attempting to install rustup to run https://github.com/rustwasm/wasm-bindgen/tree/master/examples/webrtc_datachannel locally without success thus far

$ npm run serve

> @ serve /home/ubuntu-studio/Downloads/wasm-bindgen-0.2.68/examples/webrtc_datachannel
> webpack-dev-server

🧐  Checking for wasm-pack...

ℹ️  Installing wasm-pack 

✖ 「wdm」: Error: spawn cargo ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /path/to/wasm-bindgen-0.2.68/examples/webrtc_datachannel
ℹ 「wdm」: wait until bundle finished: /
ℹ 「wdm」: wait until bundle finished: /

localhost does not complete loading

info: profile set to 'minimal'
info: setting default host triple to x86_64-unknown-linux-gnu
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2020-08-27, rust version 1.46.0 (04488afe3 2020-08-24)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: Defaulting to 500.0 MiB unpack ram
info: installing component 'rust-std'
info: rolling back changes
error: failed to extract package (perhaps you ran out of disk space?)
error: caused by: No space left on device (os error 28)

guest271314 avatar Sep 19 '20 20:09 guest271314

The amount of space varies wildly between architectures, and between profiles.

Generally speaking, if one is installing rustup, it is because of a desire to build Rustlang code, which implies a compiler toolchain, crates from crates.io and so forth: doing this on machines with very limited resources is a poor idea and liable to fail for many reasons, of which running out of disk space is only one.

I'm open to the idea that solving this will make life better for people, and that its important to do, and if so we should put some resources into it, but right now it seems to me to be a very niche problem, not an inclusivity problem, and the error that occurs when not enough disk space is present is pretty clear. Assuming that we handle the problem cleanly, I'm inclined to close this wontfix; or at least seek wider community input before we consider whether to put effort into this. What do you think @kinnison

rbtcollins avatar Sep 20 '20 17:09 rbtcollins

The amount of space varies wildly between architectures, and between profiles.

It must be possible to determine the space for each architecture and profile. The equation is finite no matter the machine capabilities.

Generally speaking, if one is installing rustup, it is because of a desire to build Rustlang code, which implies a compiler toolchain, crates from crates.io and so forth: doing this on machines with very limited resources is a poor idea and liable to fail for many reasons, of which running out of disk space is only one

apt, apt-get, aptitude, synaptic are capable of solving that problem.

Running a live system from RAM it would be helpful to know how many installed applications need to be removed in order to make room for Rust. Live systems on RAM are very useful for testing purposes.

Even when uninstalling packages and using autoremove and clean it is still not clear how much disk space is needed to build a minimal Rust installation. At least 300MB? 500MB? Leaving that question unresolved and unknown is a glaring omission for such a lauded programming language.

guest271314 avatar Sep 20 '20 18:09 guest271314

You are welcome to contribute such a feature. At this stage it is unclear how important it is to the broad community and my comments above reflect the process by which we might establish such a priority.

For you, or anyone else that wishes to work on this in future:

  • the channel manifests do not record the unpacked footprint in either bytes or inodes (and both are required to calculate disk utilisation depending on what degree of error tolerance is to be acceptable).
  • other than that it is probably a fairly straight forward matter of using the data (once added), or eliding the output (when the data is missing)
  • but (corner cases) don't forget about the manifests, gpg signatures, config files, components lists and other things rustup creates de novo - they should be accounted for in any up-front estimate.

rbtcollins avatar Sep 20 '20 18:09 rbtcollins

@rbtcollins Have no clue about how Rust is installed. Before last live OS froze, if recollect correctly, just rustup-init (?) is 11.8 MB. Just want to use Rust primarily for WebAssembly experiments (wasm-bindgen). Am actually surprised about this omission as much as Rust is favored by developers. Have still yet to fully install Rust at a live Linux instance even after removing numerous packages. Am willing to help where able.

guest271314 avatar Sep 20 '20 18:09 guest271314

@rbtcollins An experiment: Download and run the latest Ubuntu or Linux Mint distribution as a LiveCD and try to install minimal Rust, observe the result. Place yourself in the case of an individual that has not ever installed Rust previously. Am curious how that project will fare for you.

It would be very helpful if the most minimal requirement were compiled into a single executable. From there users can add crates, etc.

guest271314 avatar Sep 20 '20 19:09 guest271314

@guest271314 @rbtcollins is quite correct. The amount of space required for a Rust toolchain varies by architecture and component set installed. For someone starting out and wanting to experiment, I'd expect a stable toolchain with support for targetting the native system and also wasm (since you mentioned that) with the local documentation and helpers for IDE support etc to be almost a full gigabyte. Simply creating an empty project and adding wasm-bindgen as a dependency to that required another 100M. Doing Rust development is very disk-space hungry and difficult to predict because sizes change with the community developments.

Most developers have plenty of space on their systems and so don't ever worry about knowing ahead of time because they expect experimentation to result in gigabytes and gigabytes of space used in build trees etc.

This discussion is, however, off-topic from the issue at hand. Robert's last comment was clear and even if you yourself are unable to contribute the feature, someone else might be. It is, however, very low on our priority list as we are few and the needs of our users are many.

I will be marking this, and your comments after Robert's, as off-topic so as to not confuse new readers of this issue.

Thank you again for your input.

kinnison avatar Sep 23 '20 07:09 kinnison

Can not find any information how much disk space rust is requiring (at least very approximate info!!). Only found one place stating 10Gb or 8Gb. And building from scratch will require 30Gb. (Leaving this here for others searching this info.)

mnba avatar Jul 13 '22 08:07 mnba