briansmith / ring

Safe, fast, small crypto using Rust
Other
3.76k stars 708 forks source link

Consider storing pregenerated files in git #2144

Open madsmtm opened 2 months ago

madsmtm commented 2 months ago

The ring package is published on crates.io without git information, because it includes files that are not part of the repository. I would be better if all the files that are on crates.io were also present in the repository - while I recognize that this isn't really the "pure" and "clean" way to use git, on the other hand, it just also makes part of automatic security auditing much easier, see e.g. https://lib.rs/~briansmith/dash#crate-ring.

I encountered this today when trying to use ring from source via. crates-io.patch on Mac Catalyst, and having it fail to pre-generate the files there, so it's also a usability issue.

Tip: You can add pregenerated linguist-generated to .gitattributes to avoid GitHub from counting it, and you should probably also add exclude = ["generated/tmp/*"] to Cargo.toml to avoid the temp files from being uploaded to crates.io too.

briansmith commented 1 month ago

Here is my tentative plan:

This way, people who naively run generic "check that the package contents match what is in Git" tools will automatically get a good result. We can also expand the supply chain integrity verification document to explain how users can run mk/verify-package.sh and/or mk/release.sh themselves as part of a less naive verification process.