I’m trying to build my page using a rust toolset. According to the documentation Manage build dependencies | Netlify Docs , rust should remember which packages were built under ~/.cargo/registry. However, it seems that this cache is not remembered in between builds, because each time a fully fresh build is triggered, causing the build time to be ~ 20 minutes.
In order to debug further, I tried to add some debugging print statements in my build script to print the folder ~/.cargo/registry, but the folder does not exist, leading me to believe that this is not used at all.
10:49:34 PM: Contents of ~/.cargo/registry 10:49:34 PM: ls: cannot access '/opt/buildhome/.cargo/registry': No such file or directory
Some more information if it helps:
- My project has a Cargo.lock, I even added a rust-toolchain per the documentation
- To build, I use a custom shell script “build.sh”, which basically calls cargo build and then copies some files. The build command in netlify build settings then just points to this build.sh.
As a secondary question (which would be solved if the main question is solved), I guess there’s some built-in mechanism that make builds look like they failed if they are over a certain time limit: even though the build succeeds, I still get the error:
Failed during stage 'building site': Command did not finish within the time limit