aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Workspace] Upgrade rust and use new workspace inheritance features.

Open JoshLind opened this issue 2 years ago • 3 comments

Description

This PR updates our rust version to 1.64.0. As an added benefit, it also makes use of the new workspace inheritance features to: (i) share workspace package properties across all crates (i.e., we avoid repeating all the same fields across all workspace crates); and (ii) pin dependencies across the entire workspace (i.e., we avoid depending on different versions of the same dependency in our crates and make upgrading dependencies super trivial!).

Note: Given this is somewhat of a big change, I've only changed a few dependencies to use this new functionality so the team can provide feedback/concerns. If we all agree, I can update all external dependencies to use this.

Test Plan

Existing test infra.


This change is Reviewable

JoshLind avatar Sep 25 '22 23:09 JoshLind

very interesting... If we are gonna move to Rust 1.64, do we want to wait until after the mainnet cut?

Yeah, I guess the trade-off here is between the risks involved with: (i) updating to a newer version of rust; vs (ii) continuing to allow multiple versions of the same dependencies across our crates (and FWIW, we do this a lot!).

Personally, I'm less worried about the rust upgrade... What I'll do for now is update the PR to migrate a few more deps (so folks can see what it looks like) and we can decide if we want to land it pre vs. post cut. Given the crazy merge-conflicts, I'll move things across using multiple PRs :)

JoshLind avatar Sep 26 '22 08:09 JoshLind

I wonder if this can solve our issues with move-deps. move-deps was created so that we didn't have to add the move dependencies (referred to by git hashes) everywhere, but it created a nasty feature unification issue. I suppose this would allow us to declare the Move deps at workspace level (with the hashes) and use them in individual crates, potentially with different feature flags.

vgao1996 avatar Sep 27 '22 17:09 vgao1996

Please add rust-version to avoid confusion after the upgrade as it will break compile in weird ways for anyone on an older version (learned the hard way trying to compile faucet) https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field

bchocho avatar Sep 30 '22 20:09 bchocho

closing out stale pr, but lots of good stuff here to iterate on...

davidiw avatar Oct 28 '22 16:10 davidiw