Skip to content
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

Getting Started page fails to mention build-essential package for Linux #1379

Open
AugLuk opened this issue Dec 16, 2020 · 6 comments
Open
Labels
A-Content The written content on the website. C-Bug Something isn't working.

Comments

@AugLuk
Copy link

AugLuk commented Dec 16, 2020

What needs to be fixed?

The Getting Started guide fails to mention needing to install the build-essential package for Linux. Following the guide and then trying to compile a file using "rustc foobar.rs" produces an error if the package is not installed. This would be acceptable if the error message given by rustc was more helpful. The error message looks cryptic to a beginner and doesn't provide any information on what is causing the problem or how to resolve it. See https://www.reddit.com/r/rust/comments/i4jlbi/linking_with_cc_failed_exit_code_1/ for an example. I'm not sure if this issue should be filled under the website or rustc. A similar issue is at #1012 but this is a more general problem and not restricted to WSL.

Page(s) Affected

https://www.rust-lang.org/learn/get-started

@AugLuk AugLuk added A-Content The written content on the website. C-Bug Something isn't working. labels Dec 16, 2020
@Manishearth
Copy link
Member

@kinnison i was under the impression we ship self contained linkers and stuff? Or otherwise don't need build-essential typically.

@kinnison
Copy link
Contributor

AIUI, by default we use system linkers, certainly the llvm-tools component is not part of default, and on Windows we generally rely on the mingw or msvc linkers to be present. I have been considering doing a test compile if you install a toolchain with cargo and rustc as part of toolchain installation, so that rustup can warn you if hello world can't build, but that wouldn't fix the website.

Deciding which packages to recommend is very hard because they vary in name between platforms though.

@Manishearth
Copy link
Member

Sounds good, we might need to make a note of this on the website (maybe on the rustup website?). If someone could investigate the exact details needed on different platforms that would be great.

@kinnison
Copy link
Contributor

Eventually I'd like for the rustup website to go away and merge into the rust-lang main website because it's silly to have a separate page when we have https://www.rust-lang.org/tools/install so I'd suggest we focus on getting that page up-to-scratch and then consider just redirecting https://rustup.rs/ to there

@senekor
Copy link
Contributor

senekor commented Jan 14, 2024

This is still an issue (tested in VM). I believe it is appropriate for the install page to mention this if rustup doesn't handle it automatically. (it currently doesn't)

I suppose build-essential is the package for Debian, Ubuntu and derivatives. I'm on Fedora, installing gcc does the trick for me.

A relatively straight-forward fix could be to test in a couple VMs for popular distros, then just put the list of different install commands on the website. For users who are not sure what distro they are using, we might suggest the Ubuntu install command as a heuristic.

@senekor
Copy link
Contributor

senekor commented May 20, 2024

Maybe this problem will solve itself once the stable toolchain uses rust-lld by default:
https://blog.rust-lang.org/2024/05/17/enabling-rust-lld-on-linux.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Content The written content on the website. C-Bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

5 participants
@kinnison @Manishearth @AugLuk @senekor and others