Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions pkgs/build-support/rust/build-rust-package/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@

depsExtraArgs ? { },

# Toggles whether a custom sysroot is created when the target is a .json file.
__internal_dontAddSysroot ? false,

# Needed to `pushd`/`popd` into a subdir of a tarball if this subdir
# contains a Cargo.toml, but isn't part of a workspace (which is e.g. the
# case for `rustfmt`/etc from the `rust-sources).
Expand Down Expand Up @@ -125,36 +122,17 @@ let

target = stdenv.hostPlatform.rust.rustcTargetSpec;
targetIsJSON = lib.hasSuffix ".json" target;
useSysroot = targetIsJSON && !__internal_dontAddSysroot;

sysroot = callPackage ./sysroot { } {
inherit target;
shortTarget = stdenv.hostPlatform.rust.cargoShortTarget;
RUSTFLAGS = args.RUSTFLAGS or "";
originalCargoToml = src + /Cargo.toml; # profile info is later extracted
};

in

# Tests don't currently work for `no_std`, and all custom sysroots are currently built without `std`.
# See https://os.phil-opp.com/testing/ for more information.
assert useSysroot -> !(args.doCheck or true);

stdenv.mkDerivation (
(removeAttrs args [
"depsExtraArgs"
"cargoUpdateHook"
"cargoDeps"
"cargoLock"
])
// lib.optionalAttrs useSysroot {
RUSTFLAGS = "--sysroot ${sysroot} " + (args.RUSTFLAGS or "");
}
// lib.optionalAttrs (stdenv.hostPlatform.isDarwin && buildType == "debug") {
RUSTFLAGS =
"-C split-debuginfo=packed "
+ lib.optionalString useSysroot "--sysroot ${sysroot} "
+ (args.RUSTFLAGS or "");
RUSTFLAGS = "-C split-debuginfo=packed " + (args.RUSTFLAGS or "");
}
// {
cargoDeps = cargoDeps';
Expand Down
52 changes: 0 additions & 52 deletions pkgs/build-support/rust/build-rust-package/sysroot/default.nix

This file was deleted.

44 changes: 0 additions & 44 deletions pkgs/build-support/rust/sysroot/Cargo.lock

This file was deleted.

47 changes: 0 additions & 47 deletions pkgs/build-support/rust/sysroot/cargo.py

This file was deleted.

31 changes: 0 additions & 31 deletions pkgs/build-support/rust/sysroot/src.nix

This file was deleted.

27 changes: 0 additions & 27 deletions pkgs/build-support/rust/sysroot/update-lockfile.sh

This file was deleted.