Near-One / near-plugins

Implementation of common patterns used for NEAR smart contracts.
Creative Commons Zero v1.0 Universal
27 stars 12 forks source link

build!: update Rust version and `near-*` dependencies #118

Closed mooori closed 10 months ago

mooori commented 11 months ago

With the current minimum rust-version of 1.64.0 tests cannot be built anymore, e.g. see this CI failure. Hence this PR increseases rust-version to ~1.70.0~ 1.69.0 and updates near-workspaces. An update of both rust-version and near-workspaces is required to make tests build and pass again, hence this PR combines both.

Why ~1.70.0~ 1.69.0

The latest version of near-workspaces requires at least Rust 1.69.0.

BREAKING CHANGES

The minimum supported Rust version is increased from 1.64.0 to ~1.70.0~ 1.69.0.

near-workspaces

near-sdk

Updating from 4.1.0 to 4.1.1 since Near dependencies are already touched in this PR.

Outlook

Some other dependencies had major versions bumps and we should update them as well. It might require some refactors, so I would suggest to that in separate PR(s). I will open a tracking issue shortly.

mooori commented 10 months ago

@karim-en thank you for bringing this up. As you were running into the same issue, I tried to figure out the underlying problem. See this issue.

To verify near-plugins works with Rust 1.69.0, I will try to use 1.69.0 in the contracts in near-plugins-derive/tests/contracts and run the tests with Rust 1.70.0. (Similar to what you did with rainbow-token-connector).

mooori commented 10 months ago

Turns out that the failure to build near-workspaces with Rust 1.69.0 is a known issue. It is recommended to downgrade packages manually, which is done in scripts/fix-dependencies. It is likely to require some maintenance as new versions of these dependencies are published - please have a look at the comment in the script. Still, it seems to be the only option I can make work in CI since all my other attempts (see the CI failures in #119) have failed.

As a result, the MSRV can be lowered to 1.69.0, which is used to compile test contracts and in CI.

karim-en commented 10 months ago

This explicit downgrading of dependencies is a little awkward so if possible I think it would be nice to get the MSRV up to 1.70 (once this is possible for the bridge). But for now this looks like a good work-around. @birchmd

Actually, the contracts that are built with 1.70 work correctly because the protocol itself has already been upgraded to support those contracts. So to be able to upgrade I think we need to contribute to this repo https://github.com/NEARFoundation/near-contract-parser/tree/main, and then ask https://nearblocks.io/ owners to update this crate.

mooori commented 10 months ago

I've opened #121 for the MSRV upgrade.