Page MenuHomeFreeBSD

lang/rust: switch to USES=cargo
AbandonedPublic

Authored by vishwin on Mar 22 2023, 2:11 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 21, 9:43 AM
Unknown Object (File)
Tue, Apr 16, 6:25 PM
Unknown Object (File)
Tue, Apr 16, 8:28 AM
Unknown Object (File)
Mon, Apr 15, 3:54 AM
Unknown Object (File)
Feb 18 2024, 1:39 AM
Unknown Object (File)
Jan 22 2024, 4:24 PM
Unknown Object (File)
Jan 22 2024, 4:23 PM
Unknown Object (File)
Jan 22 2024, 4:23 PM
Subscribers

Details

Reviewers
mikael
Group Reviewers
rust
Summary

vendor/ can include ancient crates that linger for many releases on end, particularly openssl and openssl-sys. Switching to USES=cargo allows us to manage crates and update them as needed, keeping patching to a minimum.

[This paragraph will contain a guide for updating the toolchain when new releases drop]

Test Plan

Only tested build on amd64 so far, need to verify runtime (ie consumer builds and such) still. Some existing patches, especially architecture-specific ones, need minor tweaks to account for the versioned crate directories. Other minor cleanups warranted, but wanted to make this public for those interested in trying this method out.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 50522
Build 47413: arc lint + arc unit

Event Timeline

This port is complex enough, I personally don't want to add so much complexity and deviate from upstream.

We already deviate from upstream.

Upstream shoddily updates their Cargo.lock at best. Apart from exactly one set of crates in 1.68 that when updated caused a compile error (because upstream didn't properly specify that dependency in Cargo.toml), everything actually works as expected.

The bigger complexity than moving to USES=cargo is having to patch against individual crates that are probably prehistoric (not just ancient, prehistoric) at this rate. At least as of 1.68, the openssl crates have had refactorings since the last Cargo.lock refresh, and the patch delta needed to support modern both OpenSSL and LibreSSL is so large (and involving file moves, deletes, etc) that we may as well use the newer crate versions anyway. Patching crates like this and masquerading as older crate versions is just not sustainable.

No longer needed, especially after the openssl crates have finally been updated in Cargo.lock for the past couple releases now. Also the syncing process is rather involved.