briansmith / ring

Safe, fast, small crypto using Rust
Other
3.69k stars 697 forks source link

Documentation: alternative build systems #1920

Open briansmith opened 8 months ago

briansmith commented 8 months ago

People who use alternative build systems like Bazel often do not use the build.rs build script. In 0.17.x we've simplified and refactoed build.rs to make it easier to "port" its logic to 3rd-party build systems. We should document a checklist of steps that a ring user who is not using build.rs, when updating to a new version of ring, as they'll often have to adjust their build logic according to nay changes we've made in build.rs.

For example, in the 0.17.0 release, we added a dependency on the CARGO_MANIFEST_LINKS environment variable to build.rs. This broke peoples' Bazel builds because Bazel's rules_rust didn't define CARGO_MANIFEST_LINKS. If we had the appropriate checklist for upgrading to a new version of ring with an alternative build system, users would have discovered this.

Similarly, in the next upcoming release, we're adding a dependency on CARGO_CFG_TARGET_VENDOR and also adding new cfg logic that needs to be replicated in an alternative build system (ring_x25519_neon; see #1919). https://github.com/briansmith/ring/issues/1832 plans to expand this pattern to all targets.

We should note:

briansmith commented 6 months ago

Issue #1977 tracks improving and extending build.rs and mk/package.sh to make it easier to use ring with Bazel and GN.