asdf-community / asdf-rust

Rust plugin for the asdf version manager
https://github.com/asdf-vm/asdf
Apache License 2.0
97 stars 16 forks source link

feat: Add RUST_WITHOUT #14

Closed jrogov closed 3 years ago

jrogov commented 3 years ago

Description

Currently there's no way to skip installation of the docs (as well as other components). While helpful in general, on systems with a small amount of storage (e.g. 128/256 GB) those megabytes can be a dealbreaker. For the most recent stable version (1.51.0) it takes around 40% out of total space for the installation (418/1145 MB).

Proposal

This PR introduces ASDF_RUST_IGNORE_COMPONENTS which is being passed as a value of option --without to the Rust install script. This option takes comma-separated list of components to skip during installation (e.g. rust-docs,miri-preview to skip installation of docs and MIRI preview)

Results

It greatly helps to save storage space. As a side effect, it drastically decreases installation time: on my machine, doc building takes a handful of time: 20/23 minutes of installation (downloading + actual installation) was spent building docs I won't need.

smorimoto commented 3 years ago

Indeed! I've been using cargo recently, so I didn't notice, but your idea is perfectly reasonable. But to unify the naming conventions with optional environment variables in other asdf plugins, I changed the variable name. I wish you weren't dissatisfied with that.

smorimoto commented 3 years ago

Honestly, I would recommend using cargo to manage Rust components. So something like asdf-cargo would be ideal.

jrogov commented 3 years ago

But to unify the naming conventions with optional environment variables in other asdf plugins, I changed the variable name.

Sure, totally makes sense. Didn't notice conventions before so went for the ASDF_%PLUGIN% prefix.

So something like asdf-cargo would be ideal.

One way to go, that's for sure. The other usecase is just using Rust for building dependencies. E.g., in Erlang/Elixir it's typical to have "native" functions written in something low-level (see Rustler), hence Rust is used simply as a compiler and not a full-blown dev environment.

jrogov commented 3 years ago

While I'm at it, I've updated README with description of this option.

@smorimoto, check if the style is ok :)

smorimoto commented 3 years ago

The other usecase is just using Rust for building dependencies. E.g., in Erlang/Elixir it's typical to have "native" functions written in something low-level (see Rustler), hence Rust is used simply as a compiler and not a full-blown dev environment.

That makes perfect sense! and I'm happy to see an Erlang programmer here! (I used to write Erlang for work.)

While I'm at it, I've updated README with description of this option.

It looks good after just formatting.

jrogov commented 3 years ago

That makes perfect sense! and I'm happy to see an Erlang programmer here! (I used to write Erlang for work.)

The joy is shared :)

It looks good after just formatting.

Yep, totally. Wonder, you use any automatic formatting tool for that?

smorimoto commented 3 years ago

Yes, I format it with a tool called prettier, but honestly, it's a bit overkill to include it in this repository. So I didn't that.

smorimoto commented 3 years ago

Aaaaanyway, Thanks for your contribution @arikai!

jrogov commented 3 years ago

Yes, I format it with a tool called prettier, but honestly, it's a bit overkill to include it in this repository. So I didn't that.

Was asking for myself, thanks for that!

smorimoto commented 3 years ago

Ah got it :)