Error while running x.py build

Hello there, I am new to Rust, by far I am still trying to install it from the source. unfortunately I've gotten the following error when I tried to compile the source by following the tutorial at GitHub - rust-lang/rust: Empowering everyone to build reliable and efficient software..

my host is Ubuntu 20.4, x86_64. I've tried python 2.7 and python3.8. both showed the same error. Thank you so much for helping me out.

on the 4th step,

$ ./x.py build
Updating only changed submodules
Submodules updated in 0.07 seconds
downloading https://static.rust-lang.org/dist/2021-03-25/rust-std-1.51.0-x86_64-unknown-linux-gnu.tar.xz
############################################################################################################################################################################################################ 100.0%
Traceback (most recent call last):
File "./x.py", line 27, in
bootstrap.main()
File "/home/wei/workspace/rust_/rust/src/bootstrap/bootstrap.py", line 1175, in main
bootstrap(help_triggered)
File "/home/wei/workspace/rust_/rust/src/bootstrap/bootstrap.py", line 1145, in bootstrap
build.download_stage0()
File "/home/wei/workspace/rust_/rust/src/bootstrap/bootstrap.py", line 409, in download_stage0
self.download_component_helper(filename, pattern, tarball_suffix, download_rustc)
File "/home/wei/workspace/rust
/rust/src/bootstrap/bootstrap.py", line 518, in download_component_helper
get("{}/{}".format(url, filename), tarball, verbose=self.verbose, do_verify=do_verify)
File "/home/wei/workspace/rust
/rust/src/bootstrap/bootstrap.py", line 49, in get
if do_verify and not verify(temp_path, sha_path, verbose):
File "/home/wei/workspace/rust_/rust/src/bootstrap/bootstrap.py", line 108, in verify
expected = sha256sum.readline().split()[0]
IndexError: list index out of range

Can you try using https://rustup.rs/ instead ?

could you more specific ? thanks.

Your goal is to install Rust right? https://rustup.rs/ is the simplest way.

that's correct, however I'd prefer to installing it from the source. thank you !

Rust is a bootstrapped compiler, so it requires an existing Rust binary. If you truly want to install from source, you will spend hours (likely days) compiling code, use over a terabyte of disk space, and should get the exact same binary as you will in seconds from rustup.

Hi, Thank you so much for the explanation which makes absolute sense. I was not aware the type of the compiler. I'll definitely give a tryout if the error goes away with rust installed.

Not sure if this is correct. Rust is bootstrapped from the downloaded pre-built beta, not from the system version, AFAIK. And the error is in the build system, anyway.

Yeah, true. I was thinking it installs the beta compiler, but I don't actually think that's the case. Regardless, truly building from source would take quite a while.

it's interesting, I got the below message when I run with/without sudo, "curl https://sh.rustup.rs -sSf | sh"

info: downloading installer
curl: (23) Failure writing output to destination
rustup: command failed: downloader https://static.rust-lang.org/rustup/dist/x86_64-unknown-linux-gnu/rustup-init /tmp/tmp.EkUyXkd2Z7/rustup-init x86_64-unknown-linux-gnu

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.