From 245652a455816de963fbb0dc6e74c5c4041155e6 Mon Sep 17 00:00:00 2001 From: Alex Jones Date: Thu, 17 Oct 2024 12:11:05 +0100 Subject: [PATCH 1/2] Replace Nix `env-with-everything` with `build-legacy-software` Removes the `env-with-everything` environment, as there isn't much practical reason to have an environment where you build the simulator and also have the legacy toolchain, exclusive to Linux. Instead, it makes more sense to retain the existing simulator environment, and add a separate environment `build-legacy-software` that can be used to get the legacy toolchain on Linux systems. This means that entering this environment for building legacy software is much quicker, and the same functionality can be retained by overlaying the two environments (entering the sim environment, then the legacy one). --- flake.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 036d939..9fc57cc 100644 --- a/flake.nix +++ b/flake.nix @@ -190,9 +190,9 @@ packages = [sonataSystemPkgs.sonata-simulator] ++ default.nativeBuildInputs; SONATA_SIM_BOOT_STUB = "${sonataSystemPkgs.sonata-sim-boot-stub.out}/share/sim_boot_stub"; }; - env-with-everything = pkgs.mkShell { - name = "sonata-sw-with-everything"; - packages = env-with-sim.nativeBuildInputs ++ [lrPkgs.lowrisc-toolchain-gcc-rv32imcb]; + build-legacy-software = pkgs.mkShell { + name = "sonata-sw-legacy"; + packages = [lrPkgs.lowrisc-toolchain-gcc-rv32imcb]; }; }; packages = { From ab1d0720a0895e66eda66af98cf8fda6b1a8dc51 Mon Sep 17 00:00:00 2001 From: Alex Jones Date: Thu, 17 Oct 2024 12:14:12 +0100 Subject: [PATCH 2/2] Update auto demo docs to mention environment Explicitly state the legacy toolchain environment required to build the automotive demo's legacy component, and add example commands that show entering and exiting that environment to build the component. Also point out that this is only available on Linux systems. --- examples/automotive/README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/automotive/README.md b/examples/automotive/README.md index fdd8c38..fa9ecb6 100644 --- a/examples/automotive/README.md +++ b/examples/automotive/README.md @@ -36,9 +36,16 @@ Ethernet cable. ## Building The cheriot componenents of this demo are built along with the rest of the examples. -However, the legacy component needs to be build seperately. +However, the legacy component needs to be built seperately. The legacy component +requires the legacy RISC-V toolchain that is available on Linux systems in the +`build-legacy-software` Nix environment. So, to build the full demo, you can run: ```sh +# In the normal `nix develop` environment. xmake -P examples +# Enter an environment with the legacy toolchain, and build the legacy component. +nix develop .#build-legacy-software xmake -P examples/automotive/legacy/ +# Exit the overlaid legacy environment +exit ```