Skip to content

Commit

Permalink
Bump Rust toolchain
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed Sep 18, 2024
1 parent e9b2241 commit 7a2bf98
Show file tree
Hide file tree
Showing 24 changed files with 116 additions and 93 deletions.
2 changes: 1 addition & 1 deletion hacking/nix/rust-utils/build-crates-in-layers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ in let
"--manifest-path" "${workspace}/Cargo.toml"
"--target-dir" "$target_dir"
]) (lib.optionals (!test) [
"--out-dir" "$out/bin"
rustEnvironment.artifactDirFlag "$out/bin"
])}
${lib.optionalString test (
Expand Down
19 changes: 17 additions & 2 deletions hacking/nix/rust-utils/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,37 @@ in
if channel != null
then lib.hasPrefix "nightly" channel
else throw "could not determine isNightly automatically"
, backwardsCompatibilityHacks ? {}
, mkCustomTargetPath ? customTargetTripleTripleName: throw "unimplemented"
, chooseLinker ? { targetTriple, platform }: null
, compilerRTSource ? null
, vendoredSuperLockfile ? null
}:
{
let
elaborateBackwardsCompatibilityHacks =
{ outDirInsteadOfArtifactDir ? false
, noLibraryWorkspace ? false
}:
{
inherit
outDirInsteadOfArtifactDir
noLibraryWorkspace
;
};
elaboratedBackwardsCompatibilityHacks = elaborateBackwardsCompatibilityHacks backwardsCompatibilityHacks;
in {
inherit rustToolchain channel isNightly;
inherit compilerRTSource;
inherit chooseLinker;
inherit vendoredSuperLockfile;

artifactDirFlag = if elaboratedBackwardsCompatibilityHacks.outDirInsteadOfArtifactDir then "--out-dir" else "--artifact-dir";

mkTargetPath = targetTriple: if !targetTriple.isBuiltin then mkCustomTargetPath targetTriple.name else emptyDirectory;

vendoredSysrootLockfile = vendorLockfile {
inherit rustToolchain;
lockfile = symlinkToRegularFile "Cargo.lock" "${rustToolchain}/lib/rustlib/src/rust/Cargo.lock";
lockfile = symlinkToRegularFile "Cargo.lock" "${rustToolchain}/lib/rustlib/src/rust/${lib.optionalString (!elaboratedBackwardsCompatibilityHacks.noLibraryWorkspace) "library/"}Cargo.lock";
};
}
);
Expand Down
6 changes: 3 additions & 3 deletions hacking/nix/scope/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ superCallPackage ../rust-utils {} self //

defaultRustToolchain = fenix.fromToolchainFile {
file = topLevelRustToolchainFile;
sha256 = "sha256-6lRcCTSUmWOh0GheLMTZkY7JC273pWLp2s98Bb2REJQ=";
sha256 = "sha256-GJR7CjFPMh450uP/EUzXeng15vusV3ktq7Cioop945U=";
};

defaultRustEnvironment = elaborateRustEnvironment (mkDefaultElaborateRustEnvironmentArgs {
rustToolchain = defaultRustToolchain;
} // {
channel = (builtins.fromTOML (builtins.readFile topLevelRustToolchainFile)).toolchain.channel;
compilerRTSource = mkCompilerRTSource {
version = "18.0-2024-02-13";
hash = "sha256-fbq8H86WT13KsXJECHbcbFkqFseLvV/EC2kihTL2lgI=";
version = "19.1-2024-07-30";
hash = "sha256-fV51iDAbkRmWJj0twTmQKdZdLueMAKSZR6bBtgVPCbk=";
};
mkCustomTargetPath = customTargetTripleTripleName:
let
Expand Down
10 changes: 5 additions & 5 deletions hacking/nix/scope/microkit/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
, sources
, vendorLockfile
, toTOMLFile
, defaultRustToolchain
, rustToolchain ? defaultRustToolchain
, defaultRustEnvironment
, rustEnvironment ? defaultRustEnvironment
}:

{ board, config }:
Expand Down Expand Up @@ -86,7 +86,7 @@ let
tool =
let
vendoredLockfile = vendorLockfile {
inherit rustToolchain;
inherit (rustEnvironment) rustToolchain;
lockfile = microkitSource + "/tool/microkit/Cargo.lock";
};

Expand All @@ -99,7 +99,7 @@ let
src = lib.cleanSource (microkitSource + "/tool/microkit");

nativeBuildInputs = [
rustToolchain
rustEnvironment.rustToolchain
];

depsBuildBuild = [
Expand All @@ -116,7 +116,7 @@ let
'';

buildPhase = ''
cargo build -Z unstable-options --frozen --config ${cargoConfigFile} --out-dir $out/bin
cargo build -Z unstable-options --frozen --config ${cargoConfigFile} ${rustEnvironment.artifactDirFlag} $out/bin
'';
};

Expand Down
6 changes: 5 additions & 1 deletion hacking/nix/scope/verus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ let
inherit rustToolchain;
} // {
inherit (rustToolchainAttrs.toolchain) channel;
backwardsCompatibilityHacks = {
outDirInsteadOfArtifactDir = true;
noLibraryWorkspace = true;
};
mkCustomTargetPath = mkMkCustomTargetPathForEnvironment {
rustEnvironment = self;
};
Expand Down Expand Up @@ -77,7 +81,7 @@ stdenv.mkDerivation {
-p verus-driver -p cargo-verus \
--features=verus-driver/singular \
--release \
--out-dir $out/bin
${rustEnvironment.artifactDirFlag} $out/bin
'';

installPhase = ''
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
#

[toolchain]
channel = "nightly-2024-05-01"
channel = "nightly-2024-09-01"
components = [ "rustfmt", "rust-src", "rustc-dev", "llvm-tools-preview" ]
10 changes: 5 additions & 5 deletions support/targets/aarch64-sel4-microkit-minimal.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"arch": "aarch64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32",
"disable-redzone": true,
"eh-frame-header": false,
"env": "sel4",
Expand All @@ -13,10 +13,10 @@
"llvm-target": "aarch64-unknown-none",
"max-atomic-width": 128,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare ARM64, hardfloat",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"pre-link-args": {
Expand Down
10 changes: 5 additions & 5 deletions support/targets/aarch64-sel4-microkit-resettable-minimal.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"arch": "aarch64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32",
"disable-redzone": true,
"eh-frame-header": false,
"env": "sel4",
Expand All @@ -13,10 +13,10 @@
"llvm-target": "aarch64-unknown-none",
"max-atomic-width": 128,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare ARM64, hardfloat",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"pre-link-args": {
Expand Down
10 changes: 5 additions & 5 deletions support/targets/aarch64-sel4-microkit-resettable.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"arch": "aarch64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32",
"disable-redzone": true,
"env": "sel4",
"exe-suffix": ".elf",
Expand All @@ -13,10 +13,10 @@
"llvm-target": "aarch64-unknown-none",
"max-atomic-width": 128,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare ARM64, hardfloat",
"host_tools": false,
"std": false,
"tier": 2
},
"pre-link-args": {
"gnu-lld": [
Expand Down
10 changes: 5 additions & 5 deletions support/targets/aarch64-sel4-microkit.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"arch": "aarch64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32",
"disable-redzone": true,
"env": "sel4",
"exe-suffix": ".elf",
Expand All @@ -13,10 +13,10 @@
"llvm-target": "aarch64-unknown-none",
"max-atomic-width": 128,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare ARM64, hardfloat",
"host_tools": false,
"std": false,
"tier": 2
},
"pre-link-args": {
"gnu-lld": [
Expand Down
10 changes: 5 additions & 5 deletions support/targets/aarch64-sel4-minimal.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"arch": "aarch64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32",
"disable-redzone": true,
"eh-frame-header": false,
"env": "sel4",
Expand All @@ -12,10 +12,10 @@
"llvm-target": "aarch64-unknown-none",
"max-atomic-width": 128,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare ARM64, hardfloat",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"pre-link-args": {
Expand Down
10 changes: 5 additions & 5 deletions support/targets/aarch64-sel4.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"arch": "aarch64",
"crt-objects-fallback": "false",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128",
"data-layout": "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32",
"disable-redzone": true,
"env": "sel4",
"exe-suffix": ".elf",
Expand All @@ -12,10 +12,10 @@
"llvm-target": "aarch64-unknown-none",
"max-atomic-width": 128,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare ARM64, hardfloat",
"host_tools": false,
"std": false,
"tier": 2
},
"pre-link-args": {
"gnu-lld": [
Expand Down
8 changes: 4 additions & 4 deletions support/targets/armv7a-sel4-minimal.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"llvm-target": "armv7a-none-eabi",
"max-atomic-width": 64,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare Armv7-A",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"relocation-model": "static",
Expand Down
8 changes: 4 additions & 4 deletions support/targets/armv7a-sel4.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"llvm-target": "armv7a-none-eabi",
"max-atomic-width": 64,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare Armv7-A",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"relocation-model": "static",
Expand Down
8 changes: 4 additions & 4 deletions support/targets/riscv32imac-sel4-minimal.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"llvm-target": "riscv32",
"max-atomic-width": 32,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare RISC-V (RV32IMAC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"relocation-model": "static",
Expand Down
8 changes: 4 additions & 4 deletions support/targets/riscv32imac-sel4.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"llvm-target": "riscv32",
"max-atomic-width": 32,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare RISC-V (RV32IMAC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"relocation-model": "static",
"target-pointer-width": "32"
Expand Down
8 changes: 4 additions & 4 deletions support/targets/riscv32imafc-sel4-minimal.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"llvm-target": "riscv32",
"max-atomic-width": 32,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare RISC-V (RV32IMAFC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"relocation-model": "static",
Expand Down
8 changes: 4 additions & 4 deletions support/targets/riscv32imafc-sel4.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"llvm-target": "riscv32",
"max-atomic-width": 32,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare RISC-V (RV32IMAFC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"relocation-model": "static",
"target-pointer-width": "32"
Expand Down
9 changes: 5 additions & 4 deletions support/targets/riscv64gc-sel4-minimal.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
"llvm-target": "riscv64",
"max-atomic-width": 64,
"metadata": {
"description": null,
"host_tools": null,
"std": null,
"tier": null
"description": "Bare RISC-V (RV64IMAFDC ISA)",
"host_tools": false,
"std": false,
"tier": 2
},
"panic-strategy": "abort",
"relocation-model": "static",
"supported-sanitizers": [
"shadow-call-stack",
"kernel-address"
],
"target-pointer-width": "64"
Expand Down
Loading

0 comments on commit 7a2bf98

Please sign in to comment.