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
4 changes: 0 additions & 4 deletions .github/workflows/sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ jobs:
path: seL4
- name: Install SDK dependencies
run: |
rustup target add x86_64-unknown-linux-musl
rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
rustup target add aarch64-unknown-linux-musl
rustup component add rust-src --toolchain stable-aarch64-unknown-linux-musl
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
Expand Down
11 changes: 8 additions & 3 deletions build_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -760,12 +760,16 @@ def build_initialiser(
component_build_dir = build_dir / board.name / config.name / component_name
component_build_dir.mkdir(exist_ok=True, parents=True)

toolchain_setup = "cd tool/microkit && rustup toolchain install && cd ../../"

if custom_rust_sel4_dir is None:
capdl_init_elf = component_build_dir / "bin" / "sel4-capdl-initializer.elf"
cmd = f"""
{toolchain_setup} && \
RUSTC_BOOTSTRAP=1 \
RUST_TARGET_PATH={rust_target_path} SEL4_PREFIX={sel4_src_dir.absolute()} \
cargo install {cargo_cross_options} \
RUST_TARGET_PATH={rust_target_path} \
SEL4_PREFIX={sel4_src_dir.absolute()} \
cargo +1.90.0 install {cargo_cross_options} \
--target {cargo_target} \
--locked \
--git https://github.com/au-ts/rust-seL4 --branch capdl_dev sel4-capdl-initializer --rev 118c9cd67d3a7c95431a0aeb08d8ce8692ab9d80 \
Expand All @@ -775,8 +779,9 @@ def build_initialiser(
else:
capdl_init_elf = custom_rust_sel4_dir / "target" / cargo_target / "release" / "sel4-capdl-initializer.elf"
cmd = f"""
{toolchain_setup} && /
cd {custom_rust_sel4_dir} && SEL4_PREFIX={sel4_src_dir.absolute()} \
cargo build {cargo_cross_options} --target {cargo_target} \
cargo +1.90.0 build {cargo_cross_options} --target {cargo_target} \
--release -p sel4-capdl-initializer
"""

Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 1 addition & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,7 @@
ps.setuptools
]);

microkitToolToml = nixpkgs.lib.trivial.importTOML ./tool/microkit/Cargo.toml;
microkitToolVersion = microkitToolToml.package.rust-version;

# Unfortunately Cargo does not support all targets by default so for cross-compiling
# we must explicitly add certain targets.
rustAdditionalTargets = {
aarch64-darwin = [ "x86_64-apple-darwin" ];
x86_64-darwin = [ "aarch64-apple-darwin" ];
x86_64-linux = [];
aarch64-linux = [];
}.${system} or (throw "Unsupported system: ${system}");

rustTool = pkgs.rust-bin.stable.${microkitToolVersion}.default.override {
extensions = [ "rust-src" ];
targets = [ pkgs.pkgsStatic.hostPlatform.rust.rustcTarget ] ++ rustAdditionalTargets;
};
rustTool = pkgs.rust-bin.fromRustupToolchainFile ./tool/microkit/rust-toolchain.toml;
in
{
# for `nix fmt`
Expand Down
10 changes: 10 additions & 0 deletions tool/microkit/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#
# Copyright 2025, UNSW
#
# SPDX-License-Identifier: BSD-2-Clause
#

[toolchain]
channel = "1.90.0"
components = [ "rustfmt", "rust-src", "rustc-dev", "llvm-tools-preview", "clippy" ]
targets = ["x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "aarch64-unknown-linux-musl", "x86_64-apple-darwin", "aarch64-apple-darwin"]
Loading