succinctlabs / sp1

The fastest, most feature-complete zkVM for developers.
https://succinctlabs.github.io/sp1
Apache License 2.0
1.01k stars 327 forks source link

fix: gnark-ffi Dockerfile caching #1564

Closed xJonathanLEI closed 1 month ago

xJonathanLEI commented 1 month ago

The current cache mount in Dockerfile.gnark-ffi is broken:

  1. It's mounting a cache dir at /sp1/crates/recursion/gnark-cli/target instead of /sp1/target, which is useless and as a result doesn't really cache anything. Any Docker build context changes would trigger a full rebuild.
  2. It's not caching the Cargo registry. Even after fixing the issue above, any context change would still trigger a full dependency crate download. The correct solution is to also cache /usr/local/cargo/registry, which is the directory the build image uses for Cargo cache.