From 5b1debde54017d6adfa512c6b7caafc3ecdc54b7 Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Sat, 8 Jun 2024 15:58:16 -0700 Subject: [PATCH] Automatically rebuild a rust file when running qemu. --- .gitignore | 2 +- scripts/qemu.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c073262..e8346ca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ __pycache__/ compile_commands.json sysroot/bin -sysroot/usr/bin +sysroot/usr rust/target yunq/venv diff --git a/scripts/qemu.sh b/scripts/qemu.sh index c3c6526..1fc4eb9 100755 --- a/scripts/qemu.sh +++ b/scripts/qemu.sh @@ -12,6 +12,13 @@ pushd $BUILD_DIR ninja ninja install +export CARGO_INSTALL_ROOT="${DIR}/../sysroot/usr/" + +# Need to pushd so rustup gets the toolchain from rust/rust_toolchain.toml +pushd "${DIR}/../rust" +cargo install --force --path "${DIR}/../rust/usr/testbed/" +popd + sudo sh ${DIR}/build_image.sh disk.img QEMU_ARGS=