Eclipse can't find crate for std after rustup update


#1

I saw the latest email about rust updates, so I installed and ran rustup. It said I had to delete my old version, so I did. Next rustup failed for permissions on ~/.cargo/bin, but I fixed that problem with chmod (sudo didn’t work???). Following the successful install, I got

stable installed - rustc 1.16.0 (30cf806ef 2017-03-10)
Rust is installed now. Great!

I then went to my Eclipse project and saw a compile error

can't find crate for `std` [E0463]:

Next, I tried running from the command line, but my path wasn’t set. (What should that be?) I then ran

~/.cargo/bin/cargo run --verbose

from the command line and got

error: couldn't prepare build directories

So now I can’t run my project from either Eclipse or Cargo.


#2

Everything you describe here sounds strange! I don’t recall which situation rustup asks the user to delete rustup before upgrading. I think it probably insists on system installs of rust being uninstalled first, or multirust.sh being uninstalled first though.

Some of this could be fallout from the transition from using the ~/.multirust directory to ~/.rustup - e.g. your eclipse plugin may be aware of the former but not the latter, though rustup is supposed to maintain ~/.multirust as a symlink to ~/.rustup.

~/.cargo/bin being unwritable is indicative of something weird. Maybe an old system/multirust install where cargo install was previously run under sudo.

I don’t know what the “couldn’t prepare build directories” error means, but it sounds suspiciously like a directory with the wrong permissions.

The PATH should include ~/.cargo/bin. rustup should configure this, but is known to be buggy about it.

To get rustup working again, you might delete ~/.multirust, ~/.rustup, and ~/.cargo (the three of which contain all of the rust installation), and do a fresh install. If that doesn’t result in a working rust I would be surprised again.

I don’t know anything about the eclipse plugin but imagine it is either just reflecting the busted rust installation, or needs to be updated for compatibility with current rustup.

Sorry for the hassle.


#3

Yes. My bad. It told me to uninstall rust, not rustup.

Reinstalling got me to the point where I can ‘cargo run’ from a terminal, but only with sudo. Otherwise, I get

failed to remove: /Users/me/Documents/Eclipse/foo/target/debug/libmulticell.rlib

even if I change the owner and permissions on that file. It’s probably something wrong with the setup on my Mac.

However, I’m still getting

can't find crate for `std` [E0463]:

in Eclipse even after updating RustDT.