The current cache mount in Dockerfile.gnark-ffi is broken:
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.
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.
The current cache mount in
Dockerfile.gnark-ffi
is broken:/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./usr/local/cargo/registry
, which is the directory the build image uses for Cargo cache.