-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Upgrade errors type params, enable upgrade errors #20321
base: main
Are you sure you want to change the base?
Upgrade errors type params, enable upgrade errors #20321
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is shaping up very nicely, thanks @jordanjennings-mysten. Two main groups of comments:
- About formatting/wording -- here @tnowacki / @tzakian / @cgswords will probably have more insights because they are more familiar with how the compiler outputs error messages, but the main thing I wanted to flag is that the last diagnostic (the one that explains how to fix the issue) could really benefit from including a full example of what the compatibility check expected (i.e. not the delta, but here's the thing you should put back into the package). In some cases (like type and function parameters) this is not possible because we don't have parameter names from the bytecode version, but everywhere else, it should be.
- About enabling this forever -- some comments about making that more robust and giving people a way out.
- Testing -- we should add some tests for positional structs and enums, and structs/enums without any fields, because they will end up with generated fields and field names that we want to detect and eliminate from the output where possible.
.../unit_tests/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__all_fail.snap
Outdated
Show resolved
Hide resolved
.../unit_tests/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__all_fail.snap
Outdated
Show resolved
Hide resolved
│ ^^^^^^^^^^^^^^^^^^^^^^^^ Unexpected abilities 'copy' | ||
│ | ||
= Structs are part of a module's public interface and cannot be changed during an upgrade. | ||
= Restore the original struct's abilities for struct 'StructAbilityMismatchAdd'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message would be more useful if it mentioned what the abilities should be (i.e. not as a delta, but the original list of abilities).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
= Restore the original struct's abilities [have original list somehow (move snippet?)] for struct 'StructAbilityMismatchAdd'.
I'll pull this out into a separate PR so we can independently decide on it. I have a bit of |
@@ -15,6 +15,7 @@ pub mod key_identity; | |||
pub mod keytool; | |||
pub mod shell; | |||
pub mod sui_commands; | |||
mod upgrade_compatibility; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO remove before merge
...nit_tests/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__type_param.snap
Outdated
Show resolved
Hide resolved
...nit_tests/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__type_param.snap
Outdated
Show resolved
Hide resolved
...nit_tests/snapshots/sui__upgrade_compatibility__upgrade_compatibility_tests__type_param.snap
Show resolved
Hide resolved
de081ab
to
b46fae6
Compare
b46fae6
to
20e450f
Compare
20e450f
to
848e970
Compare
Description
Test plan
snapshot testing
Release notes
Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.
For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.