Hi,
When coding in C++, I have the habit to create static libs to speed up a bit my compilation times and separate concerns better. Coupled with a fast linker, the overall experience is better (speed and efficiency).
Note: I only plan to develop on linux for linux. No other OS is involved in my work. I manage the compiler version.
Now, my next project involves Rust. I would like to be able to create a crate and precompile it.
I would like to avoid having to recompile all the libs, all the time.
Linkage page talks about -crate-type=staticlib, #![crate_type = "staticlib"].
Is it what I should use ? Is there a current/incoming way to achieve what I want?
Thanks
Please note that I only ever wrote 10 lines of Rust up to that day, so I am a real beginner in the Rust ecosystem (but now, it is time to change that).
By the way, there are ways to make Cargo's cache ineffective so that you end up with a lot of redundant rebuilding; most often it is due to alternating between two different sets of compiler flags specified by environment variable (e.g. in an IDE and in a separate terminal).
If you find yourself in this situation, make sure all builds have the same flags, or ask us for help — nobody should have to live with full rebuilds in their workflow.