From: Matt Jolly <kan...@gentoo.org> Updating vulnerable or outdated crates in Rust ebuilds is not easy. This patchset aims to reduce the developer effort and knowledge required to substitute crates into a Rust build process.
We do this by: - Enabling `paths = ['/foo/bar/baz']` style global replacements. This useful for ebuilds that vendor their crates but has some substantial limitations. This is required to (e.g.) build an older dev-lang/rust against a modern system with OpenSSL 3. - Providing a helper function that takes advantage of the eclass replacing crates.io with an offline repository to run `cargo update --offline` and update the Lockfile and crate metadata to include provided crate updates. There is some room for additional work to arbitrarily patch dependency crates (including checksum updates) and ensure that they are suitable for dependency resolution, however where a vulnerable (or otherwise broken) crate needs to be replaced with an updated version from crates.io this should prove suitable for most use cases. The following GitHub Pull Request has been opened for review feedback: https://github.com/gentoo/gentoo/pull/39464 Matt Jolly (3): cargo.eclass: add trivial crate overrides dev-lang/rust{,-bin}: Add 1.54.0 app-antivirus/clamav: example of trivial crate replacement app-antivirus/clamav/Manifest | 2 +- ...1.0.7-r1.ebuild => clamav-1.0.7-r2.ebuild} | 8 +- dev-lang/rust-bin/Manifest | 34 ++ dev-lang/rust-bin/rust-bin-1.54.0.ebuild | 188 ++++++ dev-lang/rust/Manifest | 4 + ...nore-broken-and-non-applicable-tests.patch | 75 +++ .../1.49.0-gentoo-musl-target-specs.patch | 164 +++++ .../rust/files/1.53.0-rustversion-1.0.5.patch | 234 ++++++++ .../rust/files/1.54.0-parallel-miri.patch | 43 ++ .../files/llvm/12/cstdint-signals-h.patch | 24 + dev-lang/rust/rust-1.54.0.ebuild | 560 ++++++++++++++++++ eclass/cargo.eclass | 115 +++- eclass/rust.eclass | 2 + 13 files changed, 1445 insertions(+), 8 deletions(-) rename app-antivirus/clamav/{clamav-1.0.7-r1.ebuild => clamav-1.0.7-r2.ebuild} (99%) create mode 100644 dev-lang/rust-bin/rust-bin-1.54.0.ebuild create mode 100644 dev-lang/rust/files/1.47.0-ignore-broken-and-non-applicable-tests.patch create mode 100644 dev-lang/rust/files/1.49.0-gentoo-musl-target-specs.patch create mode 100644 dev-lang/rust/files/1.53.0-rustversion-1.0.5.patch create mode 100644 dev-lang/rust/files/1.54.0-parallel-miri.patch create mode 100644 dev-lang/rust/files/llvm/12/cstdint-signals-h.patch create mode 100644 dev-lang/rust/rust-1.54.0.ebuild -- 2.47.0