-
Notifications
You must be signed in to change notification settings - Fork 129
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
Xargo does not work with rust-src #51
Comments
I've been using this expression: (rustChannels.nightly.rust.override { extensions = [ "rust-src" ]; }) More broadly, here's the with import <nixos> {};
runCommand "dummy" {
buildInputs = [
(rustChannels.nightly.rust.override { extensions = [ "rust-src" ]; })
gcc-arm-embedded
];
} "" |
@joepie91 Can you confirm if the solution proposed by @jameysharp works for you? |
I've successfully used the above solution for a while. It's worth noting that Xargo is no longer required, so now I use the following (installing let
moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
in
with nixpkgs;
stdenv.mkDerivation {
name = "project";
buildInputs = [
(rustChannels.nightly.rust.override {
targets = [ "thumbv7m-none-eabi" ];
extensions = [ "rust-std" "rustfmt-preview" ];
})
gcc-arm-embedded
];
} This can probably be closed. |
When installing both
rust
andrust-src
from the rust-overlay (specifically, from thenightly
channel), after installing Xargo (cargo install xargo
), it will fail to run:An
strace -f
suggests that Xargo is incorrectly looking for thesrc
in the mainrust
derivation output, not therust-src
output:I don't know if this is strictly speaking a problem with the rust-overlay, but I'd imagine that more tools might be making the same assumption as to where to find the sources.
Workaround
The full process to get it working:
nixpkgs.rustChannels.nightly.rust-src
package (or arust-src
from your channel of choice) from the Mozilla overlay.environment.pathsToLink = [ "/lib/rustlib/src" ];
.bashrc
:export XARGO_RUST_SRC="/run/current-system/sw/lib/rustlib/src/rust/src"
This probably is more impure than it should be, but at least it makes Xargo work. Alternative suggestions are very welcome, a 'proper' fix even moreso :)
The text was updated successfully, but these errors were encountered: