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

[move-package] Remove version fields from package and dependency manifest sections #15148

Merged
merged 7 commits into from
Dec 12, 2023

Conversation

kklas
Copy link
Contributor

@kklas kklas commented Dec 1, 2023

Description

This PR removes the version field both from package section and dependency items in manifest (e.g. SomeDep = { local = "../dep", version = "0.0.1" }).

Why is this safe to do?

Well, the version field in the package section isn't used anywhere. It's not read anywhere in the codebase and thus not propagated through the toolchain.

As for the version in dependency item, what it does it makes the dependency graph throw a version conflict when the same package is referenced with two different versions in the dependnecy graph. There are 3 types of dependencies (Local, Git, and Custom) out of which only Local and Git are used on Sui. Since referencing a different version of a dependency is already possible with git and local by specifying a different location, this version field isn't useful.

I've also added version as a custom field in Sui hooks in order to make the unknown field name found warning go away when compiling packages with sui move. This should be removed once all version fields are removed from all manifests in this repo. This will be a breaking change for users running the old version of the toolchain so it's probably best to do that a bit later.

This is part of the work to enable compiling against on-chain dependencies #14178.

cc @amnn @rvantonder

Test Plan

Unit tests.

Some tests (like the diamond_problem_dep_dev_override_with_reg) were using the version field to create a version conflict while using a package in the same location. I've refactored those tests to instead refer to the same package in different location.


If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

Move.toml files no longer require a version field in the [package] section and produces a warning at the presence of a version field in a [dependency] definition. For the full description, see #15148.

Copy link

vercel bot commented Dec 1, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mysten-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 8, 2023 0:03am
sui-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 8, 2023 0:03am
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 8, 2023 0:03am
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Dec 8, 2023 0:03am
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Dec 8, 2023 0:03am
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Dec 8, 2023 0:03am

Copy link
Contributor

@amnn amnn left a comment

Choose a reason for hiding this comment

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

This looks great, it's a nice clean up, thanks @kklas ! I've kicked off the CI run and tweaked the wording in the Release Notes (to make it clear that this change affects Move.toml files).

@rvantonder could you take a final look and eventually land it?

@rvantonder
Copy link
Contributor

Hey @kklas -- haven't forgot about this, it's on my radar! A bit incidentally, I'm working on compiling against prior compiler versions (a draft PR of one approach is here, but note this is before the #15035 merge, so I will rebase at some point).

I'll have a chance to look at pushing through this PR soon, just want to make sure to manage potential conflicts between this on-chain compilation work and the other (at a glance, I don't think this PR poses any). Thanks for your patience 🙏

@kklas
Copy link
Contributor Author

kklas commented Dec 8, 2023

I've rebased to main and removed version field from manifest files in build_with_bytecode tests which landed in the meantime. Now all check should be passing.

@rvantonder
Copy link
Contributor

thanks @kklas!

@kklas kklas deleted the remove-version branch December 12, 2023 14:50
gdanezis pushed a commit that referenced this pull request Dec 15, 2023
…fest sections (#15148)

## Description 

This PR removes the version field both from package section and
dependency items in manifest (e.g. `SomeDep = { local = "../dep",
version = "0.0.1" }`).

Why is this safe to do?

Well, the version field in the package section isn't used anywhere. It's
not read anywhere in the codebase and thus not propagated through the
toolchain.

As for the version in dependency item, what it does it makes the
dependency graph throw a version conflict when the same package is
referenced with two different versions in the dependnecy graph. There
are 3 types of dependencies (`Local`, `Git`, and `Custom`) out of which
only `Local` and `Git` are used on Sui. Since referencing a different
version of a dependency is already possible with git and local by
specifying a different location, this version field isn't useful.

I've also added `version` as a custom field in Sui hooks in order to
make the `unknown field name found` warning go away when compiling
packages with `sui move`. This should be removed once all `version`
fields are removed from all manifests in this repo. This will be a
breaking change for users running the old version of the toolchain so
it's probably best to do that a bit later.

This is part of the work to enable compiling against on-chain
dependencies #14178.

cc @amnn @rvantonder 

## Test Plan 

Unit tests.

Some tests (like the `diamond_problem_dep_dev_override_with_reg`) were
using the `version` field to create a version conflict while using a
package in the same location. I've refactored those tests to instead
refer to the same package in different location.

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [x] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes

`Move.toml` files no longer require a `version` field in the `[package]`
section and will warn at the presence of a `version` field in a
`[dependency]` definition. Full PR description:
#15148.
bmwill pushed a commit to move-language/move-sui that referenced this pull request Apr 18, 2024
…fest sections (#15148)

## Description 

This PR removes the version field both from package section and
dependency items in manifest (e.g. `SomeDep = { local = "../dep",
version = "0.0.1" }`).

Why is this safe to do?

Well, the version field in the package section isn't used anywhere. It's
not read anywhere in the codebase and thus not propagated through the
toolchain.

As for the version in dependency item, what it does it makes the
dependency graph throw a version conflict when the same package is
referenced with two different versions in the dependnecy graph. There
are 3 types of dependencies (`Local`, `Git`, and `Custom`) out of which
only `Local` and `Git` are used on Sui. Since referencing a different
version of a dependency is already possible with git and local by
specifying a different location, this version field isn't useful.

I've also added `version` as a custom field in Sui hooks in order to
make the `unknown field name found` warning go away when compiling
packages with `sui move`. This should be removed once all `version`
fields are removed from all manifests in this repo. This will be a
breaking change for users running the old version of the toolchain so
it's probably best to do that a bit later.

This is part of the work to enable compiling against on-chain
dependencies MystenLabs/sui#14178.

cc @amnn @rvantonder 

## Test Plan 

Unit tests.

Some tests (like the `diamond_problem_dep_dev_override_with_reg`) were
using the `version` field to create a version conflict while using a
package in the same location. I've refactored those tests to instead
refer to the same package in different location.

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [x] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes

`Move.toml` files no longer require a `version` field in the `[package]`
section and will warn at the presence of a `version` field in a
`[dependency]` definition. Full PR description:
MystenLabs/sui#15148.
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.

3 participants