Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Install without rustup #1399

Closed
Glandos opened this issue Mar 14, 2019 · 9 comments
Closed

Install without rustup #1399

Glandos opened this issue Mar 14, 2019 · 9 comments

Comments

@Glandos
Copy link

Glandos commented Mar 14, 2019

I tried to use Eclipse Corrosion, and it requires RLS to run.

However, RLS requires rustup, but the installation method is somewhat scary. Running curl <random url> | sh is not a good practice. Moreover, my distribution (Debian/testing) already provides a fairly recent rust toolchain (1.32.0).

I tried the manual method but the following error happened:

> ./rustup-init 
error: it looks like you have an existing installation of Rust at:
error: /usr/bin
error: rustup cannot be installed alongside Rust. Please uninstall first
error: if this is what you want, restart the installation with `-y'
error: cannot install while Rust is installed

So what are my remaining option to have RLS running? Compiling it from source?

@lwshang
Copy link

lwshang commented Mar 14, 2019

You can uninstall the rustc that installed from your package manager. Then I believe you can get rid of the error.

@Glandos
Copy link
Author

Glandos commented Mar 15, 2019

My distribution made some choices regarding compilation and packaging that fits nicely with all other packages installed. So if I choose a distribution, I agree with the fact that I want to use their provided package first.

My distribution also provides a rust-src package. I understand that some other dependencies can be involved, but I don't understand why it's not possible to install RLS without rustup if my system provides everything else.

It seems that I have to try this section in rustup README. I will let you know what I achieved with that.

By the way, it's not really a matter of trust in rustup. It's a trust in curl url | sh. I don't have time to review every shell script that told me "it's the only way to install me".

@jens1o
Copy link
Contributor

jens1o commented Mar 15, 2019

I don't know what distro you are using, but I was scared of the exact same thing, which is why I use the rustup package of my distro. With this it works seamlessly.

@lwshang
Copy link

lwshang commented Mar 15, 2019

Arch does a better choice to ship rustup instead of several separate pieces of rust toolchain. From the Debian (original post said he/she using Debian/testing distro) site for packages, I found this page

@johnpmayer
Copy link

I have a similar use case in which I'm using the Nix package manager. I'm going to try to use the distributed rustup derivation rather than the individual pieces of the toolchain and see if that works. Eventually though I'd like to be able to define a nix derivation for RLS, rather than have to install the component each time.

@johnpmayer
Copy link

johnpmayer commented Mar 16, 2019

Scratch that, the NixOS derivation author seems to have sorted this already and are providing a standalone RLS derivation from source.

https://github.com/NixOS/nixpkgs/blob/release-19.03/pkgs/development/tools/rust/rls/default.nix

edit: worth mentioning that the NixOS RLS derivation doesn't seem to work, and it doesn't seem to exercise any tests. not flagging for action, just don't want someone being misled by reading this comment

@Xanewok
Copy link
Member

Xanewok commented Mar 17, 2019

@Glandos currently RLS is shipped using rustup (so is Rustfmt, Clippy and others).

If you don't want to use rustup (btw https://sh.rustup.rs/ is a small 400loc script that is easy to glance over) you could always download and cargo build --release (that's only possible with a nightly compiler, we don't support building with stable/beta due to rustc internals).

You'd need to call the resulting binary directly, however it's worth noting that you need to point at the dylibs used by your rustc installation (export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib does the trick).

@Xanewok
Copy link
Member

Xanewok commented Mar 17, 2019

You could also download it offline, it seems that we also ship prebuilt components outside rustup: https://forge.rust-lang.org/other-installation-methods.html (linked via "Learn More" at https://www.rust-lang.org/tools/install).

@Xanewok Xanewok closed this as completed Mar 17, 2019
@ghost
Copy link

ghost commented Jun 16, 2019

This isn't solved. Rustup and cargo are incorrect ways of building and deploying code. Look at nix/guix/gx for examples of more correct build systems. Of course this is a big (from my pov the biggest) issue with most rust code today, but I was passing by here. If I was a blakhat, the cargo/rustup infra would be in my line of sight as the holy grail hack; hack a bunch of devs who gloat about the safety of the lang they use. Ahahah! IT would be funny.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants