Skip to content

Installing from tarball? can't find crate for std [E0463] #33933

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

Closed
DanTup opened this issue May 28, 2016 · 17 comments
Closed

Installing from tarball? can't find crate for std [E0463] #33933

DanTup opened this issue May 28, 2016 · 17 comments

Comments

@DanTup
Copy link

DanTup commented May 28, 2016

I'm trying to use Rust on my Chromebook (I don't know if this will work on ChromeOS, but I want to give it a Go... it worked for Dart). I've never used it before so it's likely I'm doing something silly, but I'm not sure how to diagnose (I can't find any instructions for installing from the tar.gz, and rustup fails ue to no file command on my Chromebook).

  • I downloaded the 64bit Linux 1.9.0 tar.gz
  • I extracted to /home/chronos/user/Downloads/Rust/rust-1.9.0/
  • I added /home/chronos/user/Downloads/Rust/rust-1.9.0/rustc/bin/ and /home/chronos/user/Downloads/Rust/rust-1.9.0/cargo/bin/ to PATH
  • I added /home/chronos/user/Downloads/Rust/rust-1.9.0/rustc/lib/ to LD_LIBRARY_PATH
  • I copied the Hello World code and ran rustc test.rs

Here's some console output:

chronos@localhost ~/Downloads/Rust/HelloWorld $ echo $PATH
/usr/local/bin:/usr/bin:/bin:/opt/bin:/home/chronos/user/Downloads/Rust/rust-1.9.0/rustc/bin/:/home/chronos/user/Downloads/Rust/rust-1.9.0/cargo/bin/

chronos@localhost ~/Downloads/Rust/HelloWorld $ echo $LD_LIBRARY_PATH 
/usr/local/lib:/usr/local/lib64:/home/chronos/user/Downloads/Rust/rust-1.9.0/rustc/lib/

chronos@localhost ~/Downloads/Rust/HelloWorld $ rustc --version
rustc 1.9.0 (e4e8b6668 2016-05-18)

chronos@localhost ~/Downloads/Rust/HelloWorld $ rustc test.rs 
error: can't find crate for `std` [E0463]
error: aborting due to previous error

I'm guessing there's more I need to do (rustup is huge and I only did a few things), but I can't find any details anywhere. Is setting it up manually feasible? I found this issue that is the same error but there was a comment from @didrocks that suggests it was a bug with the Rust release that has since been fixed (though whether he means Rust here or an Ununtu package, I'm not sure).

@DanTup
Copy link
Author

DanTup commented May 28, 2016

I found that I had another folder full of stuff that looks like the standard library in the (strangely long) path ~/Downloads/Rust/rust-1.9.0/rust-std-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/. However I added that to LD_LIBRARY_PATH but it didn't change the error.

@MagaTailor
Copy link

MagaTailor commented May 28, 2016

Yeah, bring back the old, unsplit tarball format for manual downloads! That's still working as expected after a bootstrap + make install and is great for trying out rust in your home directory.

https://users.rust-lang.org/t/does-rust-on-linux-need-to-be-installed-on-the-system-to-be-used/5722/10

@DanTup
Copy link
Author

DanTup commented May 28, 2016

@petevine I tried the instructions there but it didn't seem to help. I even tried copying the files from the std folder into rustc/lib and rustc/lib/rustlib but still no joy.

I presume make install is for compiling from source? If something as simple as file is missing on ChromeOS I don't fancy my chances trying to compile! =)

@MagaTailor
Copy link

MagaTailor commented May 28, 2016

Last time I briefly used x86_64 rust a few weeks ago on a Live Distro, that's exactly what I did to get it work the way I like (by moving the std to rustlib and all binaries to bin). Once you recreate the default directory structure, LD_LIBRARY_PATH is not necessary.

@DanTup
Copy link
Author

DanTup commented May 28, 2016

@petevine Where did you move it to, rustc/lib or rustc/lib/rustlib? Did you have to download an additional archive, or just the std folder that was already inside the original archive (in the strangely-duplicated path)?

@MagaTailor
Copy link

MagaTailor commented May 28, 2016

You have to put the target triple from std under lib/rustlib and rustc in bin, like this:
$ exa -T ~/rust/

rust
├── bin
├── lib
│  └── rustlib
│     ├── arm-unknown-linux-gnueabihf
│     │  └── lib

@DanTup
Copy link
Author

DanTup commented May 28, 2016

I discovered there was an install.sh file in there so I gave that a go. It errored at the end:

install: running ldconfig
ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Read-only file system

I figured maybe that wasn't important, so tried compiling again:

chronos@localhost ~/Downloads/Rust/HelloWorld $ rustc test.rs
error: could not exec the linker cc: No such file or directory (os error 2)

I guess Rust requires cc (or similar). Seems like this might be a can of worms and maybe I should just through the towel in and use Ubuntu via Crouton! :(

@MagaTailor
Copy link

MagaTailor commented May 28, 2016

That means the original issue was solved and you got to the linking stage. Just install the missing gcc package and that's it.

@DanTup
Copy link
Author

DanTup commented May 28, 2016

Easier said than done on a Chromebook in dev mode :D But I'll give it a go. Thanks!

@MagaTailor
Copy link

Thanks for reminding everyone unpacking in your home directory doesn't just work the way it used to.

@DanTup
Copy link
Author

DanTup commented May 28, 2016

I downloaded gcc since I thought this was what I needed, then ran ./configure and it said:

configure: error: no acceptable C compiler found in $PATH

I don't think I'm cut out for this Linux crap! :)

@MagaTailor
Copy link

MagaTailor commented May 28, 2016

Did you install gcc or just downloaded its source? Maybe it's not in your path or the usual symlink is missing cc -> gcc? If it turns out other dev dependencies are missing too, this could become really tedious...

@DanTup
Copy link
Author

DanTup commented May 29, 2016

@petevine tbh I don't know what I'm doing.. Rust said it needs a C compiler, so I googled and came to the conclusion that gcc is what I need. I can't find binaries for gcc so I downloaded what I can find and it turns out it needs a C compiler (?!).

Like I said, this is probably a can of worms. ChromeOS is so stripped back it's hard to get anything working in dev mode without installing a "real" Linux distro.

I love my Chromebook but maybe it's time to "upgrade" it to something that can do more without a load of faff =D

@DanTup
Copy link
Author

DanTup commented May 29, 2016

The original issue is resolved and we sorta got off-topic, so gonna close this issue. I don't think installation on a dev-mode Chromebook is likely to be an officially supported scenario!

@DanTup DanTup closed this as completed May 29, 2016
@MagaTailor
Copy link

MagaTailor commented May 29, 2016

You're probably not going to manually extract the required binaries from some distro's packages but it should be possible to integrate their repos.

The best candidate would be slackware, as you wouldn't have to worry about overwriting your own stuff via dependency resolution.

@DanTup
Copy link
Author

DanTup commented May 29, 2016

I spent several hours and have so far failed to get any binary of any C compiler to work on my Chromebook.

Giving up on trying on the Chromebook; will give Rust a go on my desktop sometime instead!

@ghost
Copy link

ghost commented May 14, 2019

I have solved this. Obviously the MSI files here:

https://forge.rust-lang.org/other-installation-methods#standalone-installers

are installers. However the TAR.GZ files are also installers. So to work with
the TAR.GZ, you need to do this:

./install.sh --verbose --prefix=/tmp \
--components=rustc,rust-mingw,rust-std-x86_64-pc-windows-gnu

or alternatively this:

cp -r -s "$PWD"/rust-std-x86_64-pc-windows-gnu/lib rustc
cp -r -s "$PWD"/rust-mingw/lib rustc

I disagree with the decision to make the TAR.GZ archives require installation:
the whole point distributing an archive over an installer is so that users can
extract and go.

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

No branches or pull requests

2 participants