Open kinnison opened 4 years ago
@uberhacker The answer to your second point is simple -- it doesn't download everything twice. You're probably mistaking the installation phase for a download phase. The description "installing component..." rather than "downloading component..." should make this clear, but perhaps there's something we can do to improve matters subsequently.
The first point -- that your binaries are zero-length -- is more worrying. Does this happen every time you try and install Rust on ChromeOS?
@kinnison: Thank you for the quick feedback. Yes, sorry. I didn't notice the installing line to distinguish from downloading. Guess next time I should look more closely. I did try to install multiple times and the issue appears to be repeatable. I tried installing on another x86_64 Chromebook and the binaries in ~/.cargo/bin
were no longer zero sized so this bug appears to be isolated to i686 architecture. However, ChromeOS has a few more challenges to overcome since out-of-the-box, the user directory is mounted without execution permission. To add to the fun, the install script needs a temporary directory with executable permission also. This requires something like export TMPDIR=/usr/local/tmp
to allow the install script to execute. I noticed there was the RUSTUP_HOME
environment variable to reroute the path from ~/.rustup
. Is there a way to install to a directory other than ~/.cargo
?
You can set CARGO_HOME
too, and both RUSTUP_HOME
and CARGO_HOME
should be part of your generalised environment (with $CARGO_HOME/bin
in your PATH
) if you want to control it fully.
Great. Now I have the info I need to package rust for Chromebrew. If it helps any, I did notice there were some non-zero sized binaries in ~/.rustup/toolchains/stable-i686-unknown-linux-gnu/bin
but the rustup executable was missing. See below:
chronos@localhost ~ $ ls -l ~/.rustup/toolchains/stable-i686-unknown-linux-gnu/bin
total 19248
-rwxr-xr-x 1 chronos chronos 13681260 Jul 28 23:09 cargo
-rwxr-xr-x 1 chronos chronos 292532 Jul 28 23:10 rustc
-rwxr-xr-x 1 chronos chronos 5715644 Jul 28 23:10 rustdoc
-rwxr-xr-x 1 chronos chronos 604 Jul 28 22:40 rust-gdb
-rwxr-xr-x 1 chronos chronos 1789 Jul 28 22:40 rust-gdbgui
-rwxr-xr-x 1 chronos chronos 1245 Jul 28 22:40 rust-lldb
Yeah, so those are the real binaries. In ~/.cargo/bin
will be the rustup
binary and hardlinks to it for each of the binaries it proxies into your toolchain (such as cargo
rustc
etc). That those are zero-sized is worrisome since it indicates something very unexpected is happening.
I wonder if it is something to do with the downloaded binary and chrome protections/sandboxing.
I've no idea how chromeos does its sandboxing sadly. It'd be fascinating to see an strace of the rustup-init run if @uberhacker is still interested in trying to bottom this and can still reproduce the issue.
The latest version of rust (1.36.0 as of this comment) is not working. After installation on an i686 ChromeOS system, I get all zero byte binaries in
~/.cargo/bin
. By the way, I fully agree with @josephRice. I see so many projects like this that require the user's path to be modified. I don't understand why this is so popular but it's the WRONG WAY to install an application. See below:Also, why does the script download everything twice? Sorry for the rant.
Originally posted by @uberhacker in https://github.com/rust-lang/rustup.rs/issues/686#issuecomment-515738186