-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
Rustup can't find crate "std" #25863
Comments
I can agree to this problem (using |
Yeah, unfortunately it is still broken. So what I did to run the unmodified toolchain, was to patch rustup to always to pass the executable as first argument to I probably will mark this as broken or remove it again from nixpkgs, so other people will not waste their time and use the other options to install rust. |
What I do in my project. I've added this line to my default.nix shellHook:
I don't really like this hardcoded way, but I at least I can use rustup. |
Also @Mic92 please don't remove it, or at least leave some way of installing it :) For me it is way easier to use rustup for nightly compiler, even with this workaround (my project requires nightly). |
oh, good idea. This would be a less uglier workaround, which could be integrate into rustup. |
For rust and Nixos I would propose to use the rust-overlay https://github.com/mozilla/nixpkgs-mozilla |
it does not address cross-compilers if I remember correctly. |
@Mic92 I wasn't able to get cross compiling working. I've tried to compile musl target. |
I meant |
I have a pull request open for cross compilation support(mozilla/nixpkgs-mozilla#24). |
For anybody who has ended up here while trying to figure out how to get Xargo working; you'll want to have a look at mozilla/nixpkgs-mozilla#51, which includes a workaround. |
Any progress here? I'm currently getting two rustup related issues. The one discussed in this thread and rust-lang/rustup#1062 which seems to be fixed in newer versions of rustup. To note, the latest version of rustup at the time of writing is 1.9.0. Nixpkgs has 1.3.0. |
Did you tried the overlay? I'm using it for cross compilation. |
Overlay works fine but no rustup there. |
Why do you need rustup? Rustup defeats the purpose of Nixpkgs/NixOS(yeah I know, the overlay is also not standard compliant). |
Convinence mostly. Being able to script around rustup and have it work on multiple platforms. |
Yeah, that will be complicated on Nixos. The main problem is, that you would need to run |
Are you talking about stable? Because on unstable rustup works correctly. |
I'm talking about nixos-17.09, if that's what you refer by stable. |
If you could test if cbe326f works correctly on |
@Mic92 a quick test today seemed to work alright using the nixpkgs master branch. Can't tell about cross compiling though. Thanks for the effort |
backported in b1be17c |
@bkchr I'd like to experiment with rust for wasm and raspberry on nixos. What is currently best way of compiling for those targets? |
I think you should use the Mozilla nix overlay.
That should give you a rust with all the things you need :) (I'm unsure if the target name is correct, but it print a list of available targets if something is not correct) |
Rustup also worked for me when I compiled for the musl target. So both the overlay and rustup should be ok. |
I think this issue was solved. |
i know this is resolved, just if someone has a similar error these days for info: i had this problem when copying the |
Issue description
After installing rust via rustup (installed via nix-shell or nix-env), trying to build even a simple hello world rust program results in
error[E0463]: can't find crate for 'std'
I performed these tests on nixpkgs commit 6d599b7, which is the latest commit as I am writing this.
Steps to reproduce
Technical details
The text was updated successfully, but these errors were encountered: