index size on disk


we recently started using rust for software running on SoC-type computers with limited storage space (usually an SD card or onboard flash). I noticed that ~/.cargo/registry/index/ takes up half a gigabyte of space. I assume this directory contains the entire git history of Is it possible to use cargo without keeping all of this around?

I know this could be circumvented by cross-compiling and only pushing binaries to the devices, however we build all of our other software (mostly C++) locally and would prefer not to have to restructure the entire build and deployment process.

Best regards

Edit: The sparse index feature seems to have reached beta as of 2023-01-30

We're in the exact same situation.

There's some work being done in this area (Tracking Issue for serving an index over HTTP · Issue #9069 · rust-lang/cargo · GitHub), but afaik it's all on nightly for now.

Thanks for the pointer!

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.