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

Fix: Support for Corretto tests #3733

Merged
merged 9 commits into from
Mar 16, 2023
Merged

Fix: Support for Corretto tests #3733

merged 9 commits into from
Mar 16, 2023

Conversation

MikaelMayer
Copy link
Member

@MikaelMayer MikaelMayer commented Mar 13, 2023

This PR fixes #3731, which will enable me to reproduce #3724 locally.
I did not add tests for now because this bug appears on Windows + Corretto machines, and I just switched to Corretto. I'm not expecting to change the CI pipeline until we decide so.

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

Comment on lines 3420 to 3421
wr.Write("\"" + Dafny.ErrorReporter.TokenToString(tok).Replace(
@"\", @"\\") + ": \" + ");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
wr.Write("\"" + Dafny.ErrorReporter.TokenToString(tok).Replace(
@"\", @"\\") + ": \" + ");
wr.Write("\"" + TranslateEscapes(Dafny.ErrorReporter.TokenToString(tok)) + ": \" + ");

The root cause is printing out a string without any escaping (nothing to do with Corretto AFAICT).

It looks like all compilers have the same issue in EmitHalt, so worth applying the same fix consistently if possible.

Copy link
Member Author

Choose a reason for hiding this comment

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

I did not use "TranslateEscapes" because it's not an escaping function. It's actually taking the source of a Dafny string and translating escapes to Java Escapes. Here, the only thing in PATHs that could be problematics is the backward slash.

Copy link
Member

Choose a reason for hiding this comment

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

Actually my mistake, you want EmitStringLiteral(..., true, wr)

@MikaelMayer MikaelMayer enabled auto-merge (squash) March 16, 2023 15:31
@MikaelMayer MikaelMayer merged commit b96ad84 into master Mar 16, 2023
@MikaelMayer MikaelMayer deleted the fix-3731-test-on-java branch March 16, 2023 17:20
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.

dafny build/test/run fails on Java + Windows
3 participants