I am using cargo build to build for many platforms.
Given a sha1 hash of one of the binaries I have released, I want to be able to tell exactly what input was used for the compiler (in case I need to reference it in a security audit).
I am using Docker to run cargo build, so I have hashes of each image that will be stored long term. The target dir can be many GB in size, so I do not want to be committing it to a Docker image if it is not needed.
I am not completely sure what data is contained in target.
Should I keep it, or is the Cargo.lock enough to understand what input was given to the compiler?
If a Cargo crate is deleted, is there an immutable reference I can always download (so no need to keep target which would contain the source code)?
Would running cargo build with verbose logs also be useful for a historical reference?