Build time large: rust: ~/.cargo/registry cache not used?


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 “”, which basically calls cargo build and then copies some files. The build command in netlify build settings then just points to this

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

Hey @martinfiers,
Could you please share your site url? We should save your cache in these cases, but there is currently a bug that could explain the behavior you’re seeing: the build can complete within the time limit but post-build processes do not complete within the time limit… so we deploy your site, but don’t save cache or properly clean up the build container.

Dear @jen ,

Thank you for your reply! As this is still work-in-progress it’s not that interesting to view, nevertheless: I don’t have any post-building processes. For some reason it succeeded once in building and deployed the site a while ago, but now it fails time after time.

Do you have an idea of when this bug could be fixed? Would it help in this case (even though I don’t have any post-building processes)?

Thanks again!

Hey @martinfiers,
I’ve gone ahead and increased your build time limit to 30 minutes to see if we can save your cache in time for the build to finish. But your failures that started May 9 with are different than the others in that they are actually missing dependencies, i.e. this log line:

I would revisit that deploy and see if there’s anything that may have changed about your dependencies in that PR, #17.