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

Make structure order part of the contract #465

Merged
merged 1 commit into from
Jun 12, 2020
Merged

Conversation

mtdowling
Copy link
Member

This change updates Smithy to make the order of structure members part
of the contract of structures and unions. We previously sorted these
members automatically. However, languages like C, C++, Rust and others
require the order of structures to be consistent, and new fields added
to the end to maintain ABI compatibility. This change adds that language
to the spec, updates the semantic model to use insertion order, updates
equality checks to ensure that members have the same order, and adds a
diff evaluator to detect a violation.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This change updates Smithy to make the order of structure members part
of the contract of structures and unions. We previously sorted these
members automatically. However, languages like C, C++, Rust and others
require the order of structures to be consistent, and new fields added
to the end to maintain ABI compatibility. This change adds that language
to the spec, updates the semantic model to use insertion order, updates
equality checks to ensure that members have the same order, and adds a
diff evaluator to detect a violation.
@mtdowling mtdowling requested a review from kstich June 12, 2020 20:08
Copy link

@justinboswell justinboswell left a comment

Choose a reason for hiding this comment

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

LGTM, at least textually :)

@mtdowling mtdowling merged commit 1bf0cea into master Jun 12, 2020
@mtdowling mtdowling deleted the struct-member-order branch June 13, 2020 19:38
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