aboutsummaryrefslogtreecommitdiff
path: root/zkvmLib.nix
diff options
context:
space:
mode:
authorKamen Mladenov <kamen@syndamia.com>2025-02-21 10:35:38 +0200
committerKamen Mladenov <kamen@syndamia.com>2025-02-26 09:26:09 +0200
commit97975bed0221b12a99177c8107c6a59d5f72023b (patch)
treef8099e94212ce0752ce70105cb98496d7522789f /zkvmLib.nix
parenta8264df8b851c60011f89295685d75f66291f28b (diff)
downloadzkVMs-benchmarks-97975bed0221b12a99177c8107c6a59d5f72023b.tar
zkVMs-benchmarks-97975bed0221b12a99177c8107c6a59d5f72023b.tar.gz
zkVMs-benchmarks-97975bed0221b12a99177c8107c6a59d5f72023b.zip
feat(zkvmLib): Ability to add an extra Cargo.lock
Adds the ability to specify an `extraLockfile` attribute in args. Its value should evaluate to a string path. It's included in the beginning, so it overshadows dependencies, which are specified in the other Cargo.lock files. Must be added to commonArgs (i.e. to both `buildDepsOnly` and `buildPackage` args).
Diffstat (limited to 'zkvmLib.nix')
-rw-r--r--zkvmLib.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/zkvmLib.nix b/zkvmLib.nix
index cd92d5a..8c6f262 100644
--- a/zkvmLib.nix
+++ b/zkvmLib.nix
@@ -68,7 +68,13 @@ pkgs: guest: let
mkdir -p "$out"
cd zkvms/${args.pname}
+ '' + (if args ? extraLockfile then ''
+ cat ${args.extraLockfile} > lockfile
+ tail -n +4 ./host/Cargo.lock >> lockfile
+ '' else ''
cat ./host/Cargo.lock > lockfile
+ '') + ''
+
tail -n +4 ./guest/Cargo.lock >> lockfile
tail -n +4 ../../guests/${guest}/Cargo.lock >> lockfile