Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 11 commits into from
Nov 8, 2023
Merged

Conversation

mooori
Copy link
Contributor

@mooori mooori commented Nov 2, 2023

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

  • Users of near-plugins should not be affected by this update since it is a dev-dependency only used in tests.
  • The crate was renamed from workspaces to near-workspaces and many lines in the diff are due to this change.

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 mooori changed the title build!: update Rust version and some dependencies build!: update Rust version and near-* dependencies Nov 2, 2023
@mooori mooori marked this pull request as ready for review November 2, 2023 16:30
Copy link
Collaborator

@karim-en karim-en left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please verify that it is still possible to build contracts with plugins using rust 1.69, because currently there is an issue with parsing the contracts by nearblocks if the rust version is 1.70 and higher.
Check this: https://github.com/aurora-is-near/rainbow-token-connector/pull/234/files
and this
near/nearcore#9143 (comment)

@mooori
Copy link
Contributor Author

mooori commented Nov 3, 2023

@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
Copy link
Contributor Author

mooori commented Nov 6, 2023

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.

Copy link

@birchmd birchmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@karim-en
Copy link
Collaborator

karim-en commented Nov 6, 2023

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 mooori mentioned this pull request Nov 6, 2023
4 tasks
@mooori
Copy link
Contributor Author

mooori commented Nov 6, 2023

I've opened #121 for the MSRV upgrade.

@mooori mooori mentioned this pull request Nov 8, 2023
@mooori mooori merged commit 2e601c5 into master Nov 8, 2023
2 checks passed
@mooori mooori deleted the rust-version branch November 8, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants