Rust: not recompile the project every time flatpak-builder is ran

Is there some way to tell flatpak-builder to cache the target directory and run cargo build only when there’s no cached target? For big rust apps it may easily take more then 15 minutes to compile in debug mode, that makes everything very annoying to work with.

Try running flatpak-builder with --ccache

I tried that, and it seems like nothing changed. Maybe there’s something a have to configure, so it works with cargo? I didn’t find much about that option. Can you link/give more in-depth explanation of how it works and what to do?

This is for gcc / clang, not for Rust.

flatpak-builder doesn’t cache build artifacts. Only installation artifacts.

For C/C++, ccache works because it’s external and flatpak-builder does it’s thing with. There is no such thing with Rust or other languages.