Closed WeilanTao closed 3 months ago
@WeilanTao Can you describe the purpose of this PR in description section?
Could you add Windows as a target to the azure pipeline and run one of the JUnit tests? We cannot run all tests, b/c they depend on Makefiles, etc. But the simple JUnit tests should work after this change, right? Also, don't do all JDK versions, just whatever the newest LTS JDK is on Windows.
Could you add Windows as a target to the azure pipeline and run one of the JUnit tests? We cannot run all tests, b/c they depend on Makefiles, etc. But the simple JUnit tests should work after this change, right? Also, don't do all JDK versions, just whatever the newest LTS JDK is on Windows.
Can you make the PR that add a Windows target separately? Then we'll see that running on Windows fails for that PR. Then we merge that other PR into this PR and it should pass.
Could you add Windows as a target to the azure pipeline and run one of the JUnit tests? We cannot run all tests, b/c they depend on Makefiles, etc. But the simple JUnit tests should work after this change, right? Also, don't do all JDK versions, just whatever the newest LTS JDK is on Windows.
How can I add Windows as a target to azure?
Could you add Windows as a target to the azure pipeline and run one of the JUnit tests? We cannot run all tests, b/c they depend on Makefiles, etc. But the simple JUnit tests should work after this change, right? Also, don't do all JDK versions, just whatever the newest LTS JDK is on Windows.
How can I add Windows as a target to azure?
For example, we use it here: https://github.com/eisopux/checker-framework-vscode/blob/97d3d0d3fcdc4c749d739d98c8def69ba9beea0c/azure-pipelines.yml#L11
I've started https://github.com/eisop/checker-framework/pull/698 It doesn't look like finding the JUnit tests is the problem.
I've started #698 It doesn't look like finding the JUnit tests is the problem.
It actually is, at least one of the problems: https://dev.azure.com/eisop/checker-framework/_build/results?buildId=4527&view=logs&j=bfccef3f-45d4-504d-9a7f-a8a74922e6bf&t=b7898372-a000-5f18-bb5b-13b9fc43dfa8&l=37
Task 'NullnessTest' not found in root project 'checker-framework' and its subprojects.
Your change here might fix this.
I've started #698 It doesn't look like finding the JUnit tests is the problem.
It actually is, at least one of the problems: https://dev.azure.com/eisop/checker-framework/_build/results?buildId=4527&view=logs&j=bfccef3f-45d4-504d-9a7f-a8a74922e6bf&t=b7898372-a000-5f18-bb5b-13b9fc43dfa8&l=37
Task 'NullnessTest' not found in root project 'checker-framework' and its subprojects.
Your change here might fix this.
Thank you for bringing it up, professor. I am still in the step of creating the Windows-targeted job on azure-pipline.yml. It took me some time to learn it. But now I've seen it on #698. Thank you for that. I will check the regex issue that you mentioned.
I tried in your branch on my windows machine, ./gradlew assembleforjava works but ./gradlew test is still failing.
I tried in your branch on my windows machine, ./gradlew assembleforjava works but ./gradlew test is still failing.
@Ao-senXiong What failures do you get? In #698 just running test
passed.
@WeilanTao Can you pull in the changes from #698 into this branch so we'll see whether things pass now?
One thing to notice: #698 still runs bash, so we don't really test using the gradlew.bat
file.
Can you look whether there is a way to use normal cmd
in Azure Pipeline?
@WeilanTao Can you pull in the changes from #698 into this branch so we'll see whether things pass now?
One thing to notice: #698 still runs bash, so we don't really test using the
gradlew.bat
file. Can you look whether there is a way to use normalcmd
in Azure Pipeline?
I will try to pull it first and see.
@WeilanTao It looks like your path matching fix is working correctly and the RegexTest
target is now executed. Great!
However, we're back to the test mismatch that you had observed before. If you look at the CI output, you'll see:
org.checkerframework.checker.test.junit.RegexTest > run[D:\a\1\s\checker\tests\regex] FAILED
java.lang.StringIndexOutOfBoundsException: String index out of range: -66
org.checkerframework.checker.test.junit.RegexTest > run[D:\a\1\s\checker\tests\regex_poly] STANDARD_OUT
To see the javac command line and output, run with: -Pemit.test.debug
org.checkerframework.checker.test.junit.RegexTest > run[D:\a\1\s\checker\tests\regex_poly] FAILED
java.lang.AssertionError: 0 out of 11 expected diagnostics were found.
11 unexpected diagnostics were found:
PolyRegexTests.java:-1: other: :18: error: (assignment.type.incompatible)
@Regex String s = method(str); // error
....
11 expected diagnostics were not found:
PolyRegexTests.java:18: error: (assignment.type.incompatible)
In regex
there is an unexpected StringIndexOutOfBoundsException
. Please try to minimize for which test case in that directory the exception happens.
In regex_poly
it looks like all the right errors are produced, but something about the error format doesn't work as expected. Notice the -1: other:
part. Please have a look at where this matching happens and where the unexpected part comes from.
I tried in your branch on my windows machine, ./gradlew assembleforjava works but ./gradlew test is still failing.
@Ao-senXiong What failures do you get? In #698 just running
test
passed.
It says that
PS C:\Users\aosen\Documents\eisop-windows\checker-framework> .\gradlew test
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :cloneAndBuildJSpecify FAILED
Building JSpecify repository.
Executing in directory: C:\Users\aosen\Documents\eisop-windows/jspecify
> Task :checker-qual:jar
warning: Classpath is empty. Private-Package, -privatepackage, and Export-Package can only expand from the classpath when there is one
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':cloneAndBuildJSpecify'.
A problem occurred starting process 'command 'sh''
@Ao-senXiong
The cloneAndBuildJSpecify
target was removed in #693, so please pull in master into whatever branch you're testing.
Azure on Windows seems to still use a bash shell. Can you look into how to use cmd instead? See https://github.com/eisop/checker-framework/pull/691#issuecomment-1925776641
@WeilanTao It looks like your path matching fix is working correctly and the
RegexTest
target is now executed. Great! However, we're back to the test mismatch that you had observed before. If you look at the CI output, you'll see:org.checkerframework.checker.test.junit.RegexTest > run[D:\a\1\s\checker\tests\regex] FAILED java.lang.StringIndexOutOfBoundsException: String index out of range: -66 org.checkerframework.checker.test.junit.RegexTest > run[D:\a\1\s\checker\tests\regex_poly] STANDARD_OUT To see the javac command line and output, run with: -Pemit.test.debug org.checkerframework.checker.test.junit.RegexTest > run[D:\a\1\s\checker\tests\regex_poly] FAILED java.lang.AssertionError: 0 out of 11 expected diagnostics were found. 11 unexpected diagnostics were found: PolyRegexTests.java:-1: other: :18: error: (assignment.type.incompatible) @Regex String s = method(str); // error .... 11 expected diagnostics were not found: PolyRegexTests.java:18: error: (assignment.type.incompatible)
In
regex
there is an unexpectedStringIndexOutOfBoundsException
. Please try to minimize for which test case in that directory the exception happens.In
regex_poly
it looks like all the right errors are produced, but something about the error format doesn't work as expected. Notice the-1: other:
part. Please have a look at where this matching happens and where the unexpected part comes from.
For the directory of regex
, do you mean: /checker-framework/checker/tests/regex? Which command should I use to run those tests? I can't find one from ./gradlew tasks
For regex_poly
I can see the annotation of @PolyRegex
and @Regex
are on the line that gives the error messages, which I doubt is related to the mismatch; but I can't locate them in the folder: https://github.com/eisop/checker-framework/tree/master/checker-qual/src/main/java/org/checkerframework/framework/qual Am I on the right track?
What noticeable is that I found AlternateTestRootPerDirTest is giving some similar error. Is this something related?
@WeilanTao Please don't use edits of comments for substantive changes. I didn't get a notification about all the additions you made.
You should be able to use https://github.com/eisop/checker-framework/blob/master/checker/bin/javac.bat (or just javac if you have bash) on your Windows console. And then javac -processor regex checker/tests/regex/*.java
. That should show you all the error messages for those test files.
The regex annotations are here: https://github.com/eisop/checker-framework/tree/master/checker-qual/src/main/java/org/checkerframework/checker/regex/qual
I think the -1: other
comes from these files:
https://github.com/eisop/checker-framework/blob/276cdd2c036f6d82553e2eaf4a9824f0ba33f458/framework-test/src/main/java/org/checkerframework/framework/test/diagnostics/DiagnosticKind.java#L15
In particular, maybe one of the regexes here needs adjusting for Windows: https://github.com/eisop/checker-framework/blob/276cdd2c036f6d82553e2eaf4a9824f0ba33f458/framework-test/src/main/java/org/checkerframework/framework/test/diagnostics/TestDiagnosticUtils.java#L24
@WeilanTao Please don't use edits of comments for substantive changes. I didn't get a notification about all the additions you made.
You should be able to use https://github.com/eisop/checker-framework/blob/master/checker/bin/javac.bat (or just javac if you have bash) on your Windows console. And then
javac -processor regex checker/tests/regex/*.java
. That should show you all the error messages for those test files.The regex annotations are here: https://github.com/eisop/checker-framework/tree/master/checker-qual/src/main/java/org/checkerframework/checker/regex/qual
I think the
-1: other
comes from these files:In particular, maybe one of the regexes here needs adjusting for Windows:
Thank you. Let me look at it
The mismatch of -1: other:
in regex-poly
seems to be fixed now.
The exception of StringIndexOutOfBoundsException
in regex
doesn't seem to happen on my local
The misc
CI failure is from:
framework-test/src/main/java/org/checkerframework/framework/test/diagnostics/TestDiagnosticUtils.java:32:32: missing documentation for DIAGNOSTIC_WARNING_IN_JAVA_REGEX
framework-test/src/main/java/org/checkerframework/framework/test/diagnostics/TestDiagnosticUtils.java:34:33: missing documentation for DIAGNOSTIC_WARNING_IN_JAVA_PATTERN
So please add some javadoc to these fields.
Thanks for the further cleanups @WeilanTao !
Don't worry about the plume_lib_jdk21
downstream failure. That is happening because of the upgrade to gradle 8.7 in that downstream project and you see similar errors in other recent PRs.
I'm looking into a workaround.
Thanks for the further cleanups @WeilanTao ! Don't worry about the
plume_lib_jdk21
downstream failure. That is happening because of the upgrade to gradle 8.7 in that downstream project and you see similar errors in other recent PRs. I'm looking into a workaround.
Thank you so much! Can I now work on the byte code thing?
Thank you so much! Can I now work on the byte code thing?
Sent you more info by mail. Once CI is working properly again I'll revisit this PR.
This pr enables CF run on Windows, which passes the simple nullness check.