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-compiler] add support for public(package) visibility. #13408

Merged
merged 16 commits into from
Sep 7, 2023

Conversation

cgswords
Copy link
Contributor

@cgswords cgswords commented Aug 15, 2023

Description

This adds support for public(package) visibility, including feature gating it between Move 2024 edition. It also includes tests to ensure visibility and feature gate checking.

Test Plan

Add new tests to the compiler, including expected results.

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

Adds initial public(package) support to Move 2024.alpha. Instead of explicitly listing friend modules, you can now make function definitions public across the entire package. They are publicly available for any modules in that package, but you still cannot call them outside of that package.

@vercel
Copy link

vercel bot commented Aug 15, 2023

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

Name Status Preview Comments Updated (UTC)
explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 11:30pm
multisig-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 11:30pm
mysten-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 11:30pm
sui-kiosk ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 11:30pm
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 11:30pm

Copy link
Contributor

@tnowacki tnowacki left a comment

Choose a reason for hiding this comment

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

Awesome stuff! Thanks for working out the test generation too!

Requesting changes for:

  • The implementation of check_visibility_modifiers and the missing sub/secondary labels
  • Fixing the friend list generation
  • A test that runs the code. This might require some edition support in the transactional test framework. We could maybe make it an argument to init
  • A test that tests named packages, you will need to add move-cli tests for that

This adds support for `public(package)` visibility, including feature gating it
between Move 2024 edition. It also includes tests to ensure visibility and
feature gate checking.

Add new tests to the compiler, including expected results.

[ ]  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
Copy link
Contributor

@tnowacki tnowacki left a comment

Choose a reason for hiding this comment

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

Package tests look great! Thanks!

Though I'm a bit confused by the result of that one public package test :/

Otherwise, mostly just implementation nits :)

Copy link
Contributor

@tnowacki tnowacki left a comment

Choose a reason for hiding this comment

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

I'm fairly certain the collect::<UniqueMap<_,_>> added will crash the compiler, so let's add the test to be sure.
But as a style thing, I'd really rather not add the hidden unwrap, as I think it will just cause issues.

For the transactional test that feels unexpected, this is really more of an issue with how I setup package definitions, and I will fix it in another PR (so don't worry about it)

Copy link
Contributor

@tnowacki tnowacki left a comment

Choose a reason for hiding this comment

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

Sorry for being late getting back to this!

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