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

Updating the original files in libraries to Dafny 4 (#2) #97

Merged
merged 16 commits into from
Feb 20, 2023

Conversation

davidcok
Copy link
Collaborator

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

Copy link
Member

@robin-aws robin-aws left a comment

Choose a reason for hiding this comment

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

Thanks so much for figuring out how to avoid dropping the testing bar on this one. Just one more tweak to align how Dafny projects should use "nightly-latest"

run: find . -name '*.csv' -print0 | xargs -0 --verbose dafny-reportgenerator summarize-csv-results --max-duration-seconds 10

- uses: actions/upload-artifact@v2 # upload test results
if: success() || failure() # run this step even if previous step failed
if: always() && steps.withlog.conclusion != 'skipped'
Copy link
Member

Choose a reason for hiding this comment

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

What's the point of the extraneous always() &&?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So that the step runs even if the previous steps fail

Copy link
Member

Choose a reason for hiding this comment

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

Then why not JUST always()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Because if we (intentionally) run with an old version of dafny that does not support logging with new CLI (i.e. 3.11.0) then we don't want this step to run (and fail) if we have not produced any log files.

.github/workflows/tests.yml Outdated Show resolved Hide resolved
strategy:
fail-fast: false
matrix:
# nightly-latest to catch anything that breaks these tests in current development
Copy link
Member

Choose a reason for hiding this comment

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

Definitely happy with the solution of also using a specific nightly build to use the logging! But "nightly-latest" should only be used in the scheduled build, since otherwise the mainline CI can break spontaneously.

Here's how I set it up on the reportgenerator, which I intend to be the template for other projects: https://github.com/dafny-lang/dafny-reportgenerator/pull/17/files You should be able to do something similar, the only difference being that you have to make the matrix variable conditional instead, something like:

version: ${{ github.event_name == 'schedule' && ['nightly-latest'] || ['nightly-2023-02-18-ef4f346', '3.11.0'] }}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK. But are you comfortable with that tweaking of the test scheduling after this PR is merged, so the changes to the script can be properly tested on master-branch files?

Copy link
Member

Choose a reason for hiding this comment

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

Sure, it's only going to be a maintenance pain for us if we don't fix it quickly. :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Put in the next PR. I learn new Github action syntax every day.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, this syntax does not work with lists -- tried numerous variations. So for now left out the nightly-latest from the CI build and made a separate nightly build. But this cries out for a reusable workflow that I'll figure out later.

macros `%verify` and `%run` and the like.

The versions of dafny being run are set in the `tests.yml` file. The versions tested
must be recent enough to support the new CLI syntax, so 3.11ff. Also, if
Copy link
Member

Choose a reason for hiding this comment

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

Truncated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Odd. Its OK in the Files view. I'll check the rendering again after pushing these changes.

Comment on lines 5 to 7
The latter is important for those cases (e.g. FileIO) where the implementations
are custom external code for each target programming language.
Runtime tests are also a check that dafny compiled the (verified) dafny code correctly.
Copy link
Member

Choose a reason for hiding this comment

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

(minor) I'd be slightly happier reversing the order of these two motivations, just because all Dafny code needs tests because of the second reason, whereas the first is just emphasizing the code most likely to be among the riskiest inside the trusted computing base.

Copy link
Member

Choose a reason for hiding this comment

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

There's also the reason of making sure we watch out for any code that isn't currently supported for all compilation targets (but we can leave that for now in this PR, since we're not yet claiming anything about this)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Switched the order.

Copy link
Member

@atomb atomb left a comment

Choose a reason for hiding this comment

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

I think making the change to latest-nightly on another PR (soon) is reasonable, but I'd also like to hear whether @robin-aws has any concerns.

@robin-aws robin-aws merged commit 04b3ec5 into master Feb 20, 2023
@davidcok davidcok deleted the cok-oldcodeC branch March 8, 2023 15:15
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