Is it possible to override cargoSha256 in buildRustPackage?

It turns out that this is possible, but requires changes to buildRustPackage in order to invoke cargo build with the weaker --offline flag rather than the --frozen flag. Once #187838 is merged that will be possible.

Here’s what an example override looks like.

This was a really motivating use for this ability. The ring crate is basically the Rust standard crypto library, and by now is a dependency of a huge part of the Rust ecosystem, as well as a big chunk of the Python ecosystem as well!

For reasons which remain mysterious, the ring maintainer has been ignoring a pull request from IBM to add the assembler primitives for PowerPC for almost two years now. These primitives are copied from BoringSSL, just like all the other ring primitives. It’s a pretty weird situation. No response of any kind, positive or negative.

In the example above I was able to replace (the non-openssl version of) the tiny IRC client with a version of ring that has IBM’s patches. It built, and I was able to successfully connect to libera.chat using TLS. Note that if you have powerpc64le hardware and want to try the same thing, you will also need #168983 because we’re still waiting for the bootstrap files to be uploaded.