1
0
Fork 0

nix/rust-platform: remove rustcSrc which had to be kept in sync

This commit is contained in:
Astro 2021-01-15 00:52:22 +01:00
parent 4c79c797d5
commit b4d91e7904
3 changed files with 7 additions and 11 deletions

View File

@ -15,7 +15,7 @@ let
nativeBuildInputs = [ cargo-xbuild ];
buildPhase = ''
export XARGO_RUST_SRC="${rustPlatform.rust.rustc.src}/library"
export XARGO_RUST_SRC="${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library"
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
pushd ${crate}
cargo xbuild --release --frozen \

View File

@ -1,24 +1,20 @@
{ pkgs }:
let
rustcSrc = pkgs.fetchgit {
url = "https://github.com/rust-lang/rust.git";
# sync with git_commit_hash from pkg.rust in channel-rust-nightly.toml
rev = "8dae8cdcc8fa879cea6a4bbbfa5b32e97be4c306";
sha256 = "1c9wdwqvskchiqkxqnl516z2yajs2nbs31y4j6m2jz945dj8x4xc";
fetchSubmodules = true;
};
rustManifest = ./channel-rust-nightly.toml;
targets = [];
rustChannelOfTargets = _channel: _date: targets:
(pkgs.lib.rustLib.fromManifestFile rustManifest {
inherit (pkgs) stdenv fetchurl patchelf;
}).rust.override { inherit targets; };
}).rust.override {
inherit targets;
extensions = ["rust-src"];
};
rust =
rustChannelOfTargets "nightly" null targets;
in
pkgs.recurseIntoAttrs (pkgs.makeRustPlatform {
rustc = rust // { src = rustcSrc; };
rustc = rust;
cargo = rust;
})

View File

@ -17,7 +17,7 @@ in
(import ./nix/mkbootimage.nix { inherit pkgs; })
];
XARGO_RUST_SRC = "${rustPlatform.rust.rustc.src}/library";
XARGO_RUST_SRC = "${rustPlatform.rust.rustc}/lib/rustlib/src/rust/library";
shellHook = ''
echo "Run 'cargo xbuild --release -p ...' to build."