Skip to content

Commit 37c92f7

Browse files
committed
feat(zkvmLib): Attribute for specifying a guest-only Rust toolchain
Allows the host and guest program toolchains to differ.
1 parent dc7c773 commit 37c92f7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

zkvmLib.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ in {
147147
buildGuestPhase = ''
148148
export INPUTS_DIR="$PWD/guests/${guest}"
149149
export ZKVM="${args.pname}" GUEST="${guest}"
150+
OLD_PATH="$PATH"
151+
152+
${if args ? guestToolchain then "export PATH=\"${args.guestToolchain}/bin:$PATH\"" else ""}
150153
151154
pushd zkvms/${args.pname}/guest
152155
runHook preBuildGuest
@@ -157,6 +160,7 @@ in {
157160
158161
${if args ? guestTarget then "ln -s ../../guest/target/${args.guestTarget}/release/guest ../host/src/guest" else ""}
159162
unset RUSTUP_TOOLCHAIN RUSTFLAGS CARGO_ENCODED_RUSTFLAGS
163+
export PATH="$OLD_PATH"
160164
161165
runHook postBuildGuest
162166
popd

0 commit comments

Comments
 (0)