chore: Forwards compatibility with Dafny > 4.2 (including pending 4.5)#195
Merged
Conversation
…iders-library-dafny into robin-aws/fix-nightly-dafny-build # Conflicts: # ComAmazonawsKms/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/kms/internaldafny/Shim.java # SharedMakefileV2.mk # TestVectorsAwsCryptographicMaterialProviders/dafny/KeyVectors/src/Index.dfy # TestVectorsAwsCryptographicMaterialProviders/dafny/TestVectorsAwsCryptographicMaterialProviders/src/TestManifests.dfy
For better documentation and CI efficiency
Contributor
Author
|
After offline conversation, it seems wise to factor out the code generation steps somehow, so that there can be a large comment in one spot explaining why this is necessary when testing on other Dafny versions. This looks doable with a local composite action. Closing this PR temporarily while I get that working though, to avoid rerunning PR CI constantly while I'm pushing to this branch and manually testing manual.yml. |
Contributor
Author
|
Fresh manual run on the refactored workflows against |
seebees
approved these changes
Mar 1, 2024
Contributor
seebees
left a comment
There was a problem hiding this comment.
LGTM,
thanks for the CI consolidation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
Applies several fixes/improvements in order to work with newer Dafny versions.
This PR is currently using an unmerged branch ofsmithy-dafnyto test the fixes - smithy-lang/smithy-dafny#321 needs to be merged before this one.smithy-dafnyas a submodule so that we can lock down the exact commit used to generate code, and use the tool in CI.--library-rootand--patch-files-dir, generate dependencies first)smithy-dafnyto abstract away from the changes in Java TypeDescriptors when constructing datatypes in Dafny 4.3. This includes adding some helper methods to Dafny code for the benefit of Java external code, in the same style as feat: add type descriptors for data constructors in Java, when necessary smithy-lang/smithy-dafny#301 did.__defaultclasses to use the above to avoid constructing Dafny datatypes directly.InternalResult<T, R>to replace some internal-only uses of Dafny's compiledResulttype, to avoid even more Dafny helper methods.smithy-dafny<library-root>/codegen-patches[/<service>]feature to extract out manual patch files.{:vcs_split_on_every_assert}onAwsKmsKeyring.OnDecrypt'that is necessary on Dafny 4.2 but makes things work on Dafny 4.4 (which was not the intention of the patching feature, but also solves this problem much more cheaply than having to refactor the code to work in both versions :)Manually verified the CI passes on the source branch with the latest Dafny nightly prerelease: https://github.com/aws/aws-cryptographic-material-providers-library/actions/runs/8039889665
Note that CI will now reject making further manual edits to generated files without capturing those edits in patch files. The error message will suggest how to update the patch files accordingly. See also https://github.com/smithy-lang/smithy-dafny/tree/main-1.x/TestModels/CodegenPatches
Squash/merge commit message, if applicable:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.