-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Support Windows properly (#662)
*Issue #, if available:* Resolves #317 (AFAICT - the logs from the linked run have expired. But the CI now exercises codegen on Windows, which gives me confidence it should work. We can open new issues if we discover new issues) *Description of changes:* Addresses a handful of portability issues, so that Windows is supported: 1. Remove `check_dafny_version.sh` and extract/check the Dafny version in Java code instead (and updated `DafnyVersion` to handle the `+build` part of the semver 2.0). `--dafny-version` is now an optional parameter, provided just in case you want to override it. 2. Avoid the false error about the `project.properties` path containing a `:` (which it usually does on Windows), despite it not being a templated path. Also renamed an overload to the more specific `evalTemplateResource` to make the distinction clearer. 3. Replace `shell pwd` in the makefile with the more portable `$(CURDIR)`. Added building a target on the SimpleString test model on Windows as a sanity check. I attempted building all models on all platforms, but besides this being expensive, my last attempt saw windows jobs hang for some reason. Would like to revisit that but later, as this PR definitely moves us forward. Big thanks to @MikaelMayer for helping to figure out some of these fixes. :)
- Loading branch information
Showing
12 changed files
with
191 additions
and
160 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,15 +21,10 @@ jobs: | |
with: | ||
distribution: "corretto" | ||
java-version: "17" | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: "corretto" | ||
java-version: "17" | ||
- name: Setup Dafny | ||
uses: dafny-lang/[email protected] | ||
with: | ||
# Matching the hard-coded version for the "2023" edition for now | ||
dafny-version: 4.1.0 | ||
dafny-version: 4.8.1 | ||
|
||
- name: Install Smithy-Dafny codegen dependencies | ||
uses: ./.github/actions/install_smithy_dafny_codegen_dependencies | ||
|
@@ -46,6 +41,11 @@ jobs: | |
arguments: :smithy-dafny-codegen:test | ||
build-root-directory: codegen | ||
|
||
- name: Build a test model (just to test multiple OS') | ||
shell: bash | ||
working-directory: TestModels/SimpleTypes/SimpleString | ||
run: make polymorph_dafny | ||
|
||
- name: not-grep | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: mattsb42-meta/[email protected] |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.