-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: unskip empty_cross and future_util_multi_version
- Loading branch information
Showing
2 changed files
with
17 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,27 @@ | ||
{ pkgs ? import ../../nix/nixpkgs.nix { config = { }; } | ||
{ pkgs ? import ../../nix/nixpkgs.nix { } | ||
, generatedCargoNix ? ./Cargo.nix { } | ||
}: | ||
|
||
let pkgs0 = pkgs; in | ||
|
||
let | ||
pkgs = import pkgs0.path { | ||
config = { }; | ||
crossSystem = { | ||
# Create a new nixpkgs instance with crossSystem configured. | ||
pkgsCross = import pkgs.path { | ||
crossSystem = pkgs.lib.systems.elaborate { | ||
config = "riscv32-unknown-none-elf"; | ||
rustc = { | ||
config = "riscv32i-unknown-none-elf"; | ||
}; | ||
rust.rustcTarget = "riscv32i-unknown-none-elf"; | ||
}; | ||
}; | ||
inherit (pkgs) lib; | ||
|
||
instantiatedBuild = pkgs.callPackage generatedCargoNix { | ||
defaultCrateOverrides = pkgs.defaultCrateOverrides; | ||
buildRustCrateForPkgs = pkgs: | ||
let | ||
isBareMetal = pkgs.stdenv.hostPlatform.parsed.kernel.name == "none"; | ||
# Don't need other tools | ||
stdenvBase = if isBareMetal then pkgs.stdenvNoCC else pkgs.stdenv; | ||
|
||
stdenv = | ||
if stdenvBase.hostPlatform.extensions ? sharedLibrary | ||
then stdenvBase | ||
else | ||
lib.recursiveUpdate stdenvBase { | ||
# This is used in buildRustCrate. Should probably be optional there. | ||
hostPlatform.extensions.sharedLibrary = ""; | ||
}; | ||
instantiatedBuild = pkgsCross.callPackage generatedCargoNix { | ||
buildRustCrateForPkgs = pkgsCross: pkgsCross.buildRustCrate.override { | ||
# Don't need other tools for the crate and target in this test. | ||
stdenv = pkgsCross.stdenvNoCC; | ||
|
||
fun = pkgs.buildRustCrate.override { | ||
inherit stdenv; | ||
|
||
# Don't bother with cross compiler since we don't need stdlib | ||
inherit (pkgs.buildPackages.buildPackages) rust rustc cargo; | ||
}; | ||
in | ||
args: fun (args // lib.optionalAttrs isBareMetal { | ||
RUSTC_BOOTSTRAP = true; | ||
|
||
# Needed for std for build.rs | ||
nativeBuildInputs = args.nativeBuildInputs or [ ] | ||
++ lib.optional pkgs.stdenv.buildPlatform.isDarwin pkgs.buildPackages.libiconv; | ||
}); | ||
# Don't bother with cross compiler since we don't need stdlib, this test only uses core. | ||
inherit (pkgsCross.buildPackages.buildPackages) rustc cargo; | ||
}; | ||
}; | ||
in | ||
instantiatedBuild.rootCrate.build | ||
instantiatedBuild.rootCrate.build.overrideAttrs { | ||
# error[E0554]: `#![feature]` may not be used on the stable release channel | ||
# Only needed for this test. | ||
RUSTC_BOOTSTRAP = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters