From b254ced2dc15300f1d50c160c4edc76b8aae820f Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Wed, 7 Aug 2024 10:52:13 -0400 Subject: [PATCH 01/26] Don't block daikon on misc_jdk21 --- azure-pipelines.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1fd481f3956..0b86878495b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -581,9 +581,9 @@ jobs: - bash: ./checker/bin-devel/test-daikon.sh displayName: test-daikon.sh - job: daikon_jdk17 - dependsOn: - - canary_jobs - - daikon_jdk21 + # dependsOn: + # - canary_jobs + # - daikon_jdk21 pool: vmImage: 'ubuntu-latest' container: wmdietl/cf-ubuntu-jdk17:latest @@ -594,8 +594,8 @@ jobs: - bash: ./checker/bin-devel/test-daikon.sh displayName: test-daikon.sh - job: daikon_part1_jdk21 - dependsOn: - - canary_jobs + # dependsOn: + # - canary_jobs pool: vmImage: 'ubuntu-latest' container: wmdietl/cf-ubuntu-jdk21:latest @@ -606,8 +606,8 @@ jobs: - bash: ./checker/bin-devel/test-daikon-part1.sh displayName: test-daikon.sh - job: daikon_part2_jdk21 - dependsOn: - - canary_jobs + # dependsOn: + # - canary_jobs pool: vmImage: 'ubuntu-latest' container: wmdietl/cf-ubuntu-jdk21:latest @@ -640,9 +640,9 @@ jobs: # - bash: ./checker/bin-devel/test-daikon.sh # displayName: test-daikon.sh - job: daikon_jdk_next - dependsOn: - - framework_jobs - - daikon_jdk21 + # dependsOn: + # - framework_jobs + # - daikon_jdk21 pool: vmImage: 'ubuntu-latest' container: wmdietl/cf-ubuntu-jdk-next:latest From cdb2d251718a30ec6c0bba7b082bb0503f700135 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Wed, 7 Aug 2024 10:52:53 -0400 Subject: [PATCH 02/26] Attempt running daikon on GitHub Actions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f46712b2646..a35533ee878 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: strategy: matrix: # No need to run 'cftests-junit-jdk21' on JDK 21. - script: ['typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'jspecify-conformance'] + script: ['typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'jspecify-conformance', 'daikon-part1', 'daikon-part2'] java_version: [21] env: JAVA_VERSION: ${{ matrix.java_version }} From 85bf2a21abb2e722e80cb61d82b5b8ce5981b5b8 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Wed, 7 Aug 2024 12:24:58 -0400 Subject: [PATCH 03/26] Improve documentation --- build.gradle | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 30b923ca25d..bf1b7340a96 100644 --- a/build.gradle +++ b/build.gradle @@ -460,14 +460,18 @@ allprojects { // -classfile: classgraph jar file and https://bugs.openjdk.org/browse/JDK-8190452 String lint = '-Xlint:-options,-fallthrough,-classfile' // Java 8 uses the Error Prone javac, not what is requested with useJdkCompiler. - if (!isJava8 && useJdkCompiler >= 21) { - // TODO: Ignore this-escape for now, we may want to review and suppress each one later. - lint +=',-this-escape' - } - if (!isJava8 && useJdkCompiler >= 23) { - // TODO: Ignore dangling-doc-comments for now, we may want to fix them later. - lint +=',-dangling-doc-comments' + // So there is no need to set additional lint options. + if (!isJava8) { + if (useJdkCompiler >= 21) { + // TODO: Ignore this-escape for now, we may want to review and suppress each one later. + lint +=',-this-escape' + } + if (useJdkCompiler >= 23) { + // TODO: Ignore dangling-doc-comments for now, we may want to fix them later. + lint +=',-dangling-doc-comments' + } } + options.compilerArgs += [ '-g', '-Werror', From 6b4d10b297fa09810a16d0f4124bb326a83543b0 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Wed, 7 Aug 2024 12:25:46 -0400 Subject: [PATCH 04/26] Only keep misc jobs in Azure Pipelines, run them in parallel --- azure-pipelines.yml | 860 +------------------------------------------- 1 file changed, 8 insertions(+), 852 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0b86878495b..068eb5090d3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -10,385 +10,10 @@ pr: jobs: -# Tests run on -# * "LTS" releases (8, 11, 17, 21), -# * jdk_latest, which is the latest JDK release. This is currently JDK 21, so not separate. -# (jdk_latest will move to JDK 22 once it is released.) -# * jdk_next, which is the next JDK version, which is not yet released and might still fail. -# This is currently JDK 22. -# -# The dependsOn clauses are: -# * Everything depends on the canary jobs (the 4 main jdk_21 jobs (the newest LTS release)), except those jobs themselves. -# * Anything *_jdk8, *_jdk11, *_jdk17, *_jdk_latest, or *_jdk_next depends on *_jdk21. -# * Anything daikon_* and guava_* depends on the framework jobs (all core CF tests for JDK 8, 11, 17, and 21). -# (This avoids running these long-running jobs if something already failed in the framework.) - -# Use inference/typecheck part1/part2 to reduce latency. -# Include misc_jdk_latest because JDK 20+ adds more strict checking (e.g., Javadoc) -- job: canary_jobs - dependsOn: - # - junit_jdk21 - # - nonjunit_jdk21 - # - inference_part1_jdk21 - # - inference_part2_jdk21 - # - typecheck_part1_jdk21 - # - typecheck_part2_jdk21 - - misc_jdk21 - # - misc_jdk_latest - pool: - vmImage: 'ubuntu-latest' - steps: - - checkout: none - -- job: framework_jobs - dependsOn: - - canary_jobs - # - junit_jdk8 - # - junit_jdk11 - # - junit_jdk17 - # - junit_jdk_latest - # - junit_jdk_next - # - nonjunit_jdk8 - # - nonjunit_jdk11 - # - nonjunit_jdk17 - # - nonjunit_jdk_latest - # - nonjunit_jdk_next - # - inference_jdk8 - # - inference_jdk11 - # - inference_jdk17 - # - inference_jdk_latest - # - inference_jdk_next - # - typecheck_jdk8 - # - typecheck_jdk11 - # - typecheck_jdk17 - # - typecheck_jdk_latest - # - typecheck_jdk_next - pool: - vmImage: 'ubuntu-latest' - steps: - - checkout: none - -- job: required_jobs - dependsOn: - - framework_jobs - # - daikon_jdk8 - # - daikon_jdk11 - - daikon_jdk17 - - daikon_jdk21 - # - daikon_jdk_latest - # Not daikon_jdk_next - # - guava_jdk8 - # - guava_jdk11 - # - guava_jdk17 - # - guava_jdk21 - # - guava_jdk_latest - # Not guava_jdk_next - # - plume_lib_jdk8 - # - plume_lib_jdk11 - # - plume_lib_jdk17 - # - plume_lib_jdk21 - # - plume_lib_jdk_latest - # Not plume_lib_jdk_next - # - windows_junit_jdk17 - # - jspecify_conformance_jdk21 - pool: - vmImage: 'ubuntu-latest' - steps: - - checkout: none - -- job: junit_jdk8 - condition: false - dependsOn: - - canary_jobs - - junit_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk8:latest - timeoutInMinutes: 70 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-cftests-junit.sh - displayName: test-cftests-junit.sh - - task: PublishPipelineArtifact@1 - inputs: - targetPath: ./checker/dist - artifactName: cf_jdk8 - artifactType: pipeline -- job: junit_jdk11 - condition: false - dependsOn: - - canary_jobs - - junit_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk11:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-cftests-junit.sh - displayName: test-cftests-junit.sh - - task: PublishPipelineArtifact@1 - inputs: - targetPath: ./checker/dist - artifactName: cf_jdk11 - artifactType: pipeline -- job: junit_jdk17 - condition: false - dependsOn: - - canary_jobs - - junit_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk17:latest - timeoutInMinutes: 70 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-cftests-junit.sh - displayName: test-cftests-junit.sh - - task: PublishPipelineArtifact@1 - inputs: - targetPath: ./checker/dist - artifactName: cf_jdk17 - artifactType: pipeline -- job: junit_jdk21 - condition: false - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk21:latest - timeoutInMinutes: 70 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-cftests-junit.sh - displayName: test-cftests-junit.sh - - task: PublishPipelineArtifact@1 - inputs: - targetPath: ./checker/dist - artifactName: cf_jdk_latest - artifactType: pipeline -# Disable until JDK 22 is stable -# - job: junit_jdk_latest -# dependsOn: -# - canary_jobs -# - junit_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk-latest:latest -# timeoutInMinutes: 70 -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-cftests-junit.sh -# displayName: test-cftests-junit.sh -# - task: PublishPipelineArtifact@1 -# inputs: -# targetPath: ./checker/dist -# artifactName: cf_jdk_latest -# artifactType: pipeline -- job: junit_jdk_next - condition: false - dependsOn: - - canary_jobs - - junit_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk-next:latest - timeoutInMinutes: 70 - steps: - - checkout: self - fetchDepth: 25 - # Run test, but do not cause overall failure - - bash: ./checker/bin-devel/test-cftests-junit.sh - continueOnError: true - displayName: test-cftests-junit.sh - - task: PublishPipelineArtifact@1 - continueOnError: true - inputs: - targetPath: ./checker/dist - artifactName: cf_jdk_next - artifactType: pipeline - -- job: nonjunit_jdk8 - condition: false - dependsOn: - - canary_jobs - - nonjunit_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk8:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-cftests-nonjunit.sh - displayName: test-cftests-nonjunit.sh -- job: nonjunit_jdk11 - condition: false - dependsOn: - - canary_jobs - - nonjunit_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk11:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-cftests-nonjunit.sh - displayName: test-cftests-nonjunit.sh -- job: nonjunit_jdk17 - condition: false - dependsOn: - - canary_jobs - - nonjunit_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk17:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-cftests-nonjunit.sh - displayName: test-cftests-nonjunit.sh -- job: nonjunit_jdk21 - condition: false - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk21:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-cftests-nonjunit.sh - displayName: test-cftests-nonjunit.sh -# Disable until JDK 22 is stable -# - job: nonjunit_jdk_latest -# dependsOn: -# - canary_jobs -# - nonjunit_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk-latest:latest -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-cftests-nonjunit.sh -# displayName: test-cftests-nonjunit.sh -- job: nonjunit_jdk_next - condition: false - dependsOn: - - canary_jobs - - nonjunit_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk-next:latest - steps: - - checkout: self - fetchDepth: 25 - # Run test, but do not cause overall failure - - bash: ./checker/bin-devel/test-cftests-nonjunit.sh - continueOnError: true - displayName: test-cftests-nonjunit.sh - -# # Inference tests in EISOP do nothing, so disable the jobs here. -# # Sometimes one of the invocations of wpi-many in `./gradlew wpiManyTest` -# # takes much longer to complete than normal, and this Azure job times out. -# # When there is a timeout, one cannot examine wpi or wpi-many logs. -# # So use a timeout of 90 minutes, and hope that is enough. -# - job: inference_jdk8 -# dependsOn: -# - canary_jobs -# - inference_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk8:latest -# timeoutInMinutes: 90 -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-cftests-inference.sh -# displayName: test-cftests-inference.sh -# - job: inference_jdk11 -# dependsOn: -# - canary_jobs -# - inference_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk11:latest -# timeoutInMinutes: 90 -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-cftests-inference.sh -# displayName: test-cftests-inference.sh -# - job: inference_jdk17 -# dependsOn: -# - canary_jobs -# - inference_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk17:latest -# timeoutInMinutes: 90 -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-cftests-inference.sh -# displayName: test-cftests-inference.sh -# # Split into part1 and part2 only for the inference job that "canary_jobs" depends on. -# - job: inference_part1_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk21:latest -# timeoutInMinutes: 90 -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-cftests-inference-part1.sh -# displayName: test-cftests-inference-part1.sh -# - job: inference_part2_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk21:latest -# timeoutInMinutes: 90 -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-cftests-inference-part2.sh -# displayName: test-cftests-inference-part2.sh -# # Disable until JDK 22 is stable -# # - job: inference_jdk_latest -# # dependsOn: -# # - canary_jobs -# # - inference_part1_jdk21 -# # - inference_part2_jdk21 -# # pool: -# # vmImage: 'ubuntu-latest' -# # container: wmdietl/cf-ubuntu-jdk-latest:latest -# # timeoutInMinutes: 90 -# # steps: -# # - checkout: self -# # fetchDepth: 25 -# # - bash: ./checker/bin-devel/test-cftests-inference.sh -# # displayName: test-cftests-inference.sh -# - job: inference_jdk_next -# dependsOn: -# - canary_jobs -# - inference_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk-next:latest -# timeoutInMinutes: 70 -# steps: -# - checkout: self -# fetchDepth: 25 -# # Run test, but do not cause overall failure -# - bash: ./checker/bin-devel/test-cftests-inference.sh -# continueOnError: true -# displayName: test-cftests-inference.sh - # Unlimited fetchDepth for misc_jobs, because of need to make contributors.tex - job: misc_jdk8 - dependsOn: - # - canary_jobs - - misc_jdk21 + # dependsOn: + # - misc_jdk21 pool: vmImage: 'ubuntu-latest' container: wmdietl/cf-ubuntu-jdk8-plus:latest @@ -397,9 +22,8 @@ jobs: - bash: ./checker/bin-devel/test-misc.sh displayName: test-misc.sh - job: misc_jdk11 - dependsOn: - # - canary_jobs - - misc_jdk21 + # dependsOn: + # - misc_jdk21 pool: vmImage: 'ubuntu-latest' container: wmdietl/cf-ubuntu-jdk11-plus:latest @@ -408,9 +32,8 @@ jobs: - bash: ./checker/bin-devel/test-misc.sh displayName: test-misc.sh - job: misc_jdk17 - dependsOn: - # - canary_jobs - - misc_jdk21 + # dependsOn: + # - misc_jdk21 pool: vmImage: 'ubuntu-latest' container: wmdietl/cf-ubuntu-jdk17-plus:latest @@ -439,9 +62,8 @@ jobs: # - bash: ./checker/bin-devel/test-misc.sh # displayName: test-misc.sh - job: misc_jdk_next - dependsOn: - # - canary_jobs - - misc_jdk21 + # dependsOn: + # - misc_jdk21 pool: vmImage: 'ubuntu-latest' container: wmdietl/cf-ubuntu-jdk-next-plus:latest @@ -451,469 +73,3 @@ jobs: - bash: ./checker/bin-devel/test-misc.sh continueOnError: true displayName: test-misc.sh - -- job: typecheck_jdk8 - condition: false - dependsOn: - - canary_jobs - - typecheck_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk8:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-typecheck.sh - displayName: test-typecheck.sh -- job: typecheck_jdk11 - condition: false - dependsOn: - - canary_jobs - - typecheck_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk11:latest - steps: - - checkout: self - fetchDepth: 1000 - - bash: ./checker/bin-devel/test-typecheck.sh - displayName: test-typecheck.sh -- job: typecheck_jdk17 - condition: false - dependsOn: - - canary_jobs - - typecheck_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk17-plus:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-typecheck.sh - displayName: test-typecheck.sh -# Split into part1 and part2 only for the type-checking job that "canary_jobs" depends on. -- job: typecheck_part1_jdk21 - condition: false - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk21-plus:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-typecheck-part1.sh - displayName: test-typecheck-part1.sh -- job: typecheck_part2_jdk21 - condition: false - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk21-plus:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-typecheck-part2.sh - displayName: test-typecheck-part2.sh -- job: typecheck_jdk21 - condition: false - dependsOn: - - typecheck_part1_jdk21 - - typecheck_part2_jdk21 - pool: - vmImage: 'ubuntu-latest' - steps: - - checkout: none -# Disable until JDK 22 is stable -# - job: typecheck_jdk_latest -# dependsOn: -# - canary_jobs -# - typecheck_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk-latest-plus:latest -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-typecheck.sh -# displayName: test-typecheck.sh -- job: typecheck_jdk_next - condition: false - dependsOn: - - canary_jobs - - typecheck_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk-next:latest - steps: - - checkout: self - fetchDepth: 25 - # Run test, but do not cause overall failure - - bash: ./checker/bin-devel/test-typecheck.sh - continueOnError: true - displayName: test-typecheck.sh - -- job: daikon_jdk8 - # Disable test on older JDK - condition: false - dependsOn: - - framework_jobs - - daikon_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk8:latest - timeoutInMinutes: 70 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-daikon.sh - displayName: test-daikon.sh -- job: daikon_jdk11 - # Disable test on older JDK - condition: false - dependsOn: - - framework_jobs - - daikon_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk11:latest - timeoutInMinutes: 80 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-daikon.sh - displayName: test-daikon.sh -- job: daikon_jdk17 - # dependsOn: - # - canary_jobs - # - daikon_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk17:latest - timeoutInMinutes: 80 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-daikon.sh - displayName: test-daikon.sh -- job: daikon_part1_jdk21 - # dependsOn: - # - canary_jobs - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk21:latest - timeoutInMinutes: 70 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-daikon-part1.sh - displayName: test-daikon.sh -- job: daikon_part2_jdk21 - # dependsOn: - # - canary_jobs - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk21:latest - timeoutInMinutes: 80 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-daikon-part2.sh - displayName: test-daikon-part2.sh -- job: daikon_jdk21 - dependsOn: - - daikon_part1_jdk21 - - daikon_part2_jdk21 - pool: - vmImage: 'ubuntu-latest' - steps: - - checkout: none -# Disable until JDK 22 is stable -# - job: daikon_jdk_latest -# dependsOn: -# - canary_jobs -# - daikon_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk-latest:latest -# timeoutInMinutes: 80 -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-daikon.sh -# displayName: test-daikon.sh -- job: daikon_jdk_next - # dependsOn: - # - framework_jobs - # - daikon_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk-next:latest - timeoutInMinutes: 70 - steps: - - checkout: self - fetchDepth: 25 - # Run test, but do not cause overall failure - - bash: ./checker/bin-devel/test-daikon.sh - continueOnError: true - displayName: test-daikon.sh - -- job: guava_jdk8 - # Disable test on older JDK - condition: false - dependsOn: - - framework_jobs - - guava_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk8:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-guava.sh - displayName: test-guava.sh -- job: guava_jdk11 - # Disable test on older JDK - condition: false - dependsOn: - - framework_jobs - - guava_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk11:latest - timeoutInMinutes: 60 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-guava.sh - displayName: test-guava.sh -- job: guava_jdk17 - condition: false - dependsOn: - - framework_jobs - - guava_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk17:latest - timeoutInMinutes: 60 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-guava.sh - displayName: test-guava.sh -- job: guava_jdk21 - condition: false - dependsOn: - - canary_jobs - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk21:latest - # The guava job sometimes times out, because the time between these lines can be 30 minutes! - # [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools-generators/3.5.1/maven-plugin-tools-generators-3.5.1.pom - # [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugin-tools/maven-plugin-tools-generators/3.5.1/maven-plugin-tools-generators-3.5.1.pom - # I tried to configure Maven to prevent that problem, but it is still ocurring. - # Maybe I need to use caching? https://learn.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops - timeoutInMinutes: 60 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-guava.sh - displayName: test-guava.sh -# Disable until JDK 22 is stable -# - job: guava_jdk_latest -# dependsOn: -# - framework_jobs -# - guava_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk-latest:latest -# timeoutInMinutes: 60 -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-guava.sh -# displayName: test-guava.sh -- job: guava_jdk_next - condition: false - dependsOn: - - framework_jobs - - guava_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk-next:latest - steps: - - checkout: self - fetchDepth: 25 - # Run test, but do not cause overall failure - - bash: ./checker/bin-devel/test-guava.sh - continueOnError: true - displayName: test-guava.sh - -- job: plume_lib_jdk8 - # Disable test on older JDK - condition: false - dependsOn: - - canary_jobs - - plume_lib_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk8:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-plume-lib.sh - displayName: test-plume-lib.sh -- job: plume_lib_jdk11 - # Disable test on older JDK - condition: false - dependsOn: - - canary_jobs - - plume_lib_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk11:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-plume-lib.sh - displayName: test-plume-lib.sh -- job: plume_lib_jdk17 - condition: false - dependsOn: - - canary_jobs - - plume_lib_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk17:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-plume-lib.sh - displayName: test-plume-lib.sh -- job: plume_lib_jdk21 - condition: false - dependsOn: - - canary_jobs - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk21:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-plume-lib.sh - displayName: test-plume-lib.sh -# Disable until JDK 22 is stable -# - job: plume_lib_jdk_latest -# dependsOn: -# - canary_jobs -# - plume_lib_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk-latest:latest -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-plume-lib.sh -# displayName: test-plume-lib.sh -- job: plume_lib_jdk_next - condition: false - dependsOn: - - canary_jobs - - plume_lib_jdk17 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk-next:latest - steps: - - checkout: self - fetchDepth: 25 - # Run test, but do not cause overall failure - - bash: ./checker/bin-devel/test-plume-lib.sh - continueOnError: true - displayName: test-plume-lib.sh - -- job: jspecify_conformance_jdk21 - condition: false - dependsOn: - - junit_jdk21 - pool: - vmImage: 'ubuntu-latest' - container: wmdietl/cf-ubuntu-jdk21:latest - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-jspecify-conformance.sh - displayName: test-jspecify-conformance.sh - -## The downstream jobs are not currently needed because test-downstream.sh is empty. -# - job: downstream_jdk8 -# dependsOn: -# - canary_jobs -# - downstream_jdk17 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk8:latest -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-downstream.sh -# displayName: test-downstream.sh -# - job: downstream_jdk11 -# dependsOn: -# - canary_jobs -# - downstream_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk11:latest -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-downstream.sh -# displayName: test-downstream.sh -# - job: downstream_jdk17 -# dependsOn: -# - canary_jobs -# - downstream_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk17:latest -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-downstream.sh -# displayName: test-downstream.sh -# - job: downstream_jdk21 -# dependsOn: -# - canary_jobs -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk21:latest -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-downstream.sh -# displayName: test-downstream.sh -# - job: downstream_jdk20 -# dependsOn: -# - canary_jobs -# - downstream_jdk21 -# pool: -# vmImage: 'ubuntu-latest' -# container: wmdietl/cf-ubuntu-jdk-latest:latest -# steps: -# - checkout: self -# fetchDepth: 25 -# - bash: ./checker/bin-devel/test-downstream.sh -# displayName: test-downstream.sh - -- job: windows_junit_jdk17 - condition: false - dependsOn: - - junit_jdk21 - pool: - vmImage: 'windows-latest' - timeoutInMinutes: 90 - steps: - - checkout: self - fetchDepth: 25 - - bash: ./checker/bin-devel/test-cftests-junit.sh - displayName: Run all JUnit tests - env: - JAVA_HOME: $(JAVA_HOME_17_X64) - PATH: $(JAVA_HOME_17_X64)/bin:$(PATH) From 706a2e11020ed8dd3e214dcccb45bd23583ab50d Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Wed, 7 Aug 2024 12:26:39 -0400 Subject: [PATCH 05/26] Check daikon on all JDKs (is this worth it??), JDK 22 is not experimental --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a35533ee878..1d339dd6ab8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: strategy: matrix: # No need to run 'cftests-junit-jdk21' on JDK 21. - script: ['typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'jspecify-conformance', 'daikon-part1', 'daikon-part2'] + script: ['typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'daikon-part1', 'daikon-part2', 'jspecify-conformance'] java_version: [21] env: JAVA_VERSION: ${{ matrix.java_version }} @@ -67,19 +67,20 @@ jobs: otherjdks: name: ${{ matrix.script }} on JDK ${{ matrix.java.version }} runs-on: ubuntu-latest - needs: remainder + needs: sanity permissions: contents: read strategy: fail-fast: false matrix: # jspecify-conformance only tested on JDK 21. - script: ['cftests-junit', 'cftests-nonjunit', 'cftests-junit-jdk21', 'typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib'] + script: ['cftests-junit', 'cftests-nonjunit', 'cftests-junit-jdk21', + 'typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'daikon-part1', 'daikon-part2'] # JDK 21 used by sanity before java: [{version: '8', experimental: false}, {version: '11', experimental: false}, {version: '17', experimental: false}, - {version: '22', experimental: true}, + {version: '22', experimental: false}, {version: '23-ea', experimental: true}, {version: '24-ea', experimental: true}] env: From 07529289b64d5877b96751b96c0d2b949a0979e6 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Wed, 7 Aug 2024 19:18:54 -0400 Subject: [PATCH 06/26] Document absence of dependency --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d339dd6ab8..ea6a14376ac 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,9 @@ jobs: remainder: name: ${{ matrix.script }} on JDK ${{ matrix.java_version }} runs-on: ubuntu-latest + # Don't depend on sanity jobs, to have more parallelism. + # TODO: cancel these jobs if sanity fails. + # needs: sanity permissions: contents: read strategy: From d05394a305e306fe2e85e00cf056de72116d8817 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Wed, 7 Aug 2024 19:22:14 -0400 Subject: [PATCH 07/26] Add debugging output --- .../java/org/checkerframework/dataflow/cfg/CFGProcessor.java | 3 +++ .../dataflow/cfg/visualize/CFGVisualizeLauncher.java | 1 + 2 files changed, 4 insertions(+) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java index a35ebe8eb97..3e8f9304e27 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java @@ -57,6 +57,7 @@ public class CFGProcessor extends BasicTypeProcessor { public CFGProcessor(String className, String methodName) { this.className = className; this.methodName = methodName; + System.err.println("Instantiating CFGProcessor for " + className + "::" + methodName); } /** @@ -70,6 +71,8 @@ public CFGProcessor(String className, String methodName) { @Override public void typeProcessingOver() { + System.err.println("Calling typeProcessingOver()!!"); + Thread.dumpStack(); if (rootTree == null) { result = new CFGProcessResult("Root tree is null."); } else if (classTree == null) { diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java index 8b2c6a28360..743dbc48c89 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java @@ -268,6 +268,7 @@ public void write(int b) throws IOException {} printError( "internal error in type processor! method typeProcessOver() doesn't get" + " called."); + Thread.dumpStack(); System.exit(1); } From 56c9d409a5981dbbaf0e5e4e4b47ec78f101d3db Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Wed, 7 Aug 2024 20:41:43 -0400 Subject: [PATCH 08/26] Revert "Add debugging output" This reverts commit d05394a305e306fe2e85e00cf056de72116d8817. --- .../java/org/checkerframework/dataflow/cfg/CFGProcessor.java | 3 --- .../dataflow/cfg/visualize/CFGVisualizeLauncher.java | 1 - 2 files changed, 4 deletions(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java index 3e8f9304e27..a35ebe8eb97 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java @@ -57,7 +57,6 @@ public class CFGProcessor extends BasicTypeProcessor { public CFGProcessor(String className, String methodName) { this.className = className; this.methodName = methodName; - System.err.println("Instantiating CFGProcessor for " + className + "::" + methodName); } /** @@ -71,8 +70,6 @@ public CFGProcessor(String className, String methodName) { @Override public void typeProcessingOver() { - System.err.println("Calling typeProcessingOver()!!"); - Thread.dumpStack(); if (rootTree == null) { result = new CFGProcessResult("Root tree is null."); } else if (classTree == null) { diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java index 743dbc48c89..8b2c6a28360 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java @@ -268,7 +268,6 @@ public void write(int b) throws IOException {} printError( "internal error in type processor! method typeProcessOver() doesn't get" + " called."); - Thread.dumpStack(); System.exit(1); } From c604a3f347a8d0eca221c4ce9fc1747d85d6c24b Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Wed, 7 Aug 2024 20:47:45 -0400 Subject: [PATCH 09/26] Daikon fails with `this-escape` warnings in JDK 23+ --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea6a14376ac..b13cab17df7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,7 +118,8 @@ jobs: # # At least one plume-lib project no longer works on Java 8. # Java 8 does not allow toolchains, so testing 'cftests-junit-jdk21' is unnecessary. - if: matrix.java.version != 8 || (matrix.script != 'plume-lib' && matrix.script != 'cftests-junit-jdk21') + if: (matrix.java.version != 8 || (matrix.script != 'plume-lib' && matrix.script != 'cftests-junit-jdk21')) && + (matrix.java.version <= 22 || (matrix.script != 'daikon-part1' && matrix.script != 'daikon-part2')) # Set the compiler version to use, allowing us to e.g. run Java 23 while gradle does not work # on Java 23 yet. This only tests the compiler, it does not use that version to run the tests. env: From ba9dd3125c8a2815b776643e909d5abdb49c24f4 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 10:01:01 -0400 Subject: [PATCH 10/26] Revert "Revert "Add debugging output"" This reverts commit 56c9d409a5981dbbaf0e5e4e4b47ec78f101d3db. --- .../java/org/checkerframework/dataflow/cfg/CFGProcessor.java | 3 +++ .../dataflow/cfg/visualize/CFGVisualizeLauncher.java | 1 + 2 files changed, 4 insertions(+) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java index a35ebe8eb97..3e8f9304e27 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java @@ -57,6 +57,7 @@ public class CFGProcessor extends BasicTypeProcessor { public CFGProcessor(String className, String methodName) { this.className = className; this.methodName = methodName; + System.err.println("Instantiating CFGProcessor for " + className + "::" + methodName); } /** @@ -70,6 +71,8 @@ public CFGProcessor(String className, String methodName) { @Override public void typeProcessingOver() { + System.err.println("Calling typeProcessingOver()!!"); + Thread.dumpStack(); if (rootTree == null) { result = new CFGProcessResult("Root tree is null."); } else if (classTree == null) { diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java index 8b2c6a28360..743dbc48c89 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java @@ -268,6 +268,7 @@ public void write(int b) throws IOException {} printError( "internal error in type processor! method typeProcessOver() doesn't get" + " called."); + Thread.dumpStack(); System.exit(1); } From 5c850b4388541b435396c2039014b366707187e7 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 10:02:17 -0400 Subject: [PATCH 11/26] Document daikon exclusions. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b13cab17df7..d937a443d28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,8 +118,9 @@ jobs: # # At least one plume-lib project no longer works on Java 8. # Java 8 does not allow toolchains, so testing 'cftests-junit-jdk21' is unnecessary. + # Daikon produces 'this-escape' compiler warnings in JDK 22+. if: (matrix.java.version != 8 || (matrix.script != 'plume-lib' && matrix.script != 'cftests-junit-jdk21')) && - (matrix.java.version <= 22 || (matrix.script != 'daikon-part1' && matrix.script != 'daikon-part2')) + (matrix.java.version <= 21 || (matrix.script != 'daikon-part1' && matrix.script != 'daikon-part2')) # Set the compiler version to use, allowing us to e.g. run Java 23 while gradle does not work # on Java 23 yet. This only tests the compiler, it does not use that version to run the tests. env: From ad194d0041475b39ba282828339813c6a07cbd81 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 12:03:32 -0400 Subject: [PATCH 12/26] More debugging --- .../dataflow/cfg/visualize/CFGVisualizeLauncher.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java index 743dbc48c89..a44fefe0499 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java @@ -223,6 +223,7 @@ void generateDOTofCFG( * @return control flow graph of the specified method */ public static ControlFlowGraph generateMethodCFG(String file, String clas, String method) { + System.err.println("generateMethodCFG: " + file + " clas: " + clas + " method: " + method); CFGProcessor cfgProcessor = new CFGProcessor(clas, method); Context context = new Context(); @@ -254,9 +255,10 @@ public static ControlFlowGraph generateMethodCFG(String file, String clas, Strin @Override public void write(int b) throws IOException {} }; - System.setErr(new PrintStream(nullOS)); + // System.setErr(new PrintStream(nullOS)); javac.compile(List.of(l), List.of(clas), List.of(cfgProcessor), List.nil()); } catch (Throwable e) { + System.err.println("generateMethodCFG caught " + e); // ok } finally { System.setErr(err); From 45063ed766e9b52932b2528c3775e1e1d9d83c5f Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 12:08:55 -0400 Subject: [PATCH 13/26] Fix compilation error --- .../cfg/visualize/CFGVisualizeLauncher.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java index a44fefe0499..2b081968a14 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java @@ -6,7 +6,6 @@ import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.Options; -import org.checkerframework.checker.mustcall.qual.MustCall; import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.dataflow.analysis.AbstractValue; import org.checkerframework.dataflow.analysis.Analysis; @@ -19,7 +18,6 @@ import java.io.FileWriter; import java.io.IOException; -import java.io.OutputStream; import java.io.PrintStream; import java.util.Collections; import java.util.Map; @@ -243,19 +241,21 @@ public static ControlFlowGraph generateMethodCFG(String file, String clas, Strin PrintStream err = System.err; try { - // Redirect syserr to nothing (and prevent the compiler from issuing - // warnings about our exception). - @SuppressWarnings({ - "builder:required.method.not.called", - "mustcall:assignment" - }) // Won't be needed in JDK 11+ with use of "OutputStream.nullOutputStream()". - @MustCall() OutputStream nullOS = - // In JDK 11+, this can be just "OutputStream.nullOutputStream()". - new OutputStream() { - @Override - public void write(int b) throws IOException {} - }; - // System.setErr(new PrintStream(nullOS)); + /* + // Redirect syserr to nothing (and prevent the compiler from issuing + // warnings about our exception). + @SuppressWarnings({ + "builder:required.method.not.called", + "mustcall:assignment" + }) // Won't be needed in JDK 11+ with use of "OutputStream.nullOutputStream()". + @MustCall() OutputStream nullOS = + // In JDK 11+, this can be just "OutputStream.nullOutputStream()". + new OutputStream() { + @Override + public void write(int b) throws IOException {} + }; + System.setErr(new PrintStream(nullOS)); + */ javac.compile(List.of(l), List.of(clas), List.of(cfgProcessor), List.nil()); } catch (Throwable e) { System.err.println("generateMethodCFG caught " + e); From 9e10cd851f27a6dbfdbb302dd5100e3e4722fa12 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 12:24:48 -0400 Subject: [PATCH 14/26] Debugging --- .../java/org/checkerframework/dataflow/cfg/CFGProcessor.java | 2 +- .../org/checkerframework/javacutil/BasicTypeProcessor.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java index 3e8f9304e27..4519921b709 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java @@ -113,7 +113,7 @@ public Void visitMethod(MethodTree tree, Void p) { // Stop execution by throwing an exception. This makes sure that compilation // does not proceed, and thus the AST is not modified by further phases of the // compilation (and we save the work to do the compilation). - throw new RuntimeException(); + throw new RuntimeException("CFGProcessor found suitable method"); } return null; } diff --git a/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java b/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java index 0d14696f205..a93cf6cd54d 100644 --- a/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java +++ b/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java @@ -37,9 +37,10 @@ public void typeProcess(TypeElement e, TreePath p) { System.err.println( "BasicTypeProcessor.typeProcess: unexpected Throwable (" + t.getClass().getSimpleName() - + ") when processing " + + ") when processing " + currentRoot.getSourceFile().getName() + (t.getMessage() != null ? "; message: " + t.getMessage() : "")); } + System.err.println("BasicTypeProcessor done with element: " + e); } } From b2127049ef1ecb44a1a53bfec2245e31624e82ac Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 14:45:51 -0400 Subject: [PATCH 15/26] Start undoing debugging output, see at what point it fails --- .../dataflow/cfg/visualize/CFGVisualizeLauncher.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java index 2b081968a14..b4a2e30c144 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java @@ -221,7 +221,8 @@ void generateDOTofCFG( * @return control flow graph of the specified method */ public static ControlFlowGraph generateMethodCFG(String file, String clas, String method) { - System.err.println("generateMethodCFG: " + file + " clas: " + clas + " method: " + method); + // System.err.println("generateMethodCFG: " + file + " clas: " + clas + " method: " + + // method); CFGProcessor cfgProcessor = new CFGProcessor(clas, method); Context context = new Context(); From dc120e3bfeaf7370072e73803e3a488b22a3396a Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 15:18:59 -0400 Subject: [PATCH 16/26] Undo --- .../java/org/checkerframework/dataflow/cfg/CFGProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java index 4519921b709..0e3c183df7c 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java @@ -57,7 +57,7 @@ public class CFGProcessor extends BasicTypeProcessor { public CFGProcessor(String className, String methodName) { this.className = className; this.methodName = methodName; - System.err.println("Instantiating CFGProcessor for " + className + "::" + methodName); + // System.err.println("Instantiating CFGProcessor for " + className + "::" + methodName); } /** From e8ab042d732878a6d3009ac1784198ea66f9df06 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 15:25:59 -0400 Subject: [PATCH 17/26] Undo --- .../java/org/checkerframework/dataflow/cfg/CFGProcessor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java index 0e3c183df7c..669fdf4920f 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java @@ -71,8 +71,8 @@ public CFGProcessor(String className, String methodName) { @Override public void typeProcessingOver() { - System.err.println("Calling typeProcessingOver()!!"); - Thread.dumpStack(); + // System.err.println("Calling typeProcessingOver()!!"); + // Thread.dumpStack(); if (rootTree == null) { result = new CFGProcessResult("Root tree is null."); } else if (classTree == null) { From a16d78e8a5a80824f62602544cb2fe0c3b949b00 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 15:26:18 -0400 Subject: [PATCH 18/26] Comment out other tests for now --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d937a443d28..c1c5c4da963 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,8 +77,10 @@ jobs: fail-fast: false matrix: # jspecify-conformance only tested on JDK 21. - script: ['cftests-junit', 'cftests-nonjunit', 'cftests-junit-jdk21', - 'typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'daikon-part1', 'daikon-part2'] + script: ['cftests-junit', 'cftests-nonjunit' + #, 'cftests-junit-jdk21', + #'typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'daikon-part1', 'daikon-part2' + ] # JDK 21 used by sanity before java: [{version: '8', experimental: false}, {version: '11', experimental: false}, From 3da3eefd9af32602d76cf82b78e237a308b41c22 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 15:27:55 -0400 Subject: [PATCH 19/26] Disable remainder --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1c5c4da963..47581d86e05 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,7 @@ jobs: remainder: name: ${{ matrix.script }} on JDK ${{ matrix.java_version }} runs-on: ubuntu-latest + if: false # Don't depend on sanity jobs, to have more parallelism. # TODO: cancel these jobs if sanity fails. # needs: sanity From 55360dbe5cf26e79cea977da0a8968c067d7038e Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 16:25:35 -0400 Subject: [PATCH 20/26] Let's see whether `System.setErr` is the problem... --- .../cfg/visualize/CFGVisualizeLauncher.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java index b4a2e30c144..03557eab523 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java @@ -6,6 +6,7 @@ import com.sun.tools.javac.util.List; import com.sun.tools.javac.util.Options; +import org.checkerframework.checker.mustcall.qual.MustCall; import org.checkerframework.checker.nullness.qual.Nullable; import org.checkerframework.dataflow.analysis.AbstractValue; import org.checkerframework.dataflow.analysis.Analysis; @@ -18,6 +19,7 @@ import java.io.FileWriter; import java.io.IOException; +import java.io.OutputStream; import java.io.PrintStream; import java.util.Collections; import java.util.Map; @@ -242,21 +244,19 @@ public static ControlFlowGraph generateMethodCFG(String file, String clas, Strin PrintStream err = System.err; try { - /* - // Redirect syserr to nothing (and prevent the compiler from issuing - // warnings about our exception). - @SuppressWarnings({ - "builder:required.method.not.called", - "mustcall:assignment" - }) // Won't be needed in JDK 11+ with use of "OutputStream.nullOutputStream()". - @MustCall() OutputStream nullOS = - // In JDK 11+, this can be just "OutputStream.nullOutputStream()". - new OutputStream() { - @Override - public void write(int b) throws IOException {} - }; - System.setErr(new PrintStream(nullOS)); - */ + // Redirect syserr to nothing (and prevent the compiler from issuing + // warnings about our exception). + @SuppressWarnings({ + "builder:required.method.not.called", + "mustcall:assignment" + }) // Won't be needed in JDK 11+ with use of "OutputStream.nullOutputStream()". + @MustCall() OutputStream nullOS = + // In JDK 11+, this can be just "OutputStream.nullOutputStream()". + new OutputStream() { + @Override + public void write(int b) throws IOException {} + }; + System.setErr(new PrintStream(nullOS)); javac.compile(List.of(l), List.of(clas), List.of(cfgProcessor), List.nil()); } catch (Throwable e) { System.err.println("generateMethodCFG caught " + e); From 7bfa32b8abc5473f6ba08b2384a98b6c2c1d0148 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 16:57:40 -0400 Subject: [PATCH 21/26] Things are still working... --- .../dataflow/cfg/visualize/CFGVisualizeLauncher.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java index 03557eab523..a9001aff8e9 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java @@ -259,7 +259,7 @@ public void write(int b) throws IOException {} System.setErr(new PrintStream(nullOS)); javac.compile(List.of(l), List.of(clas), List.of(cfgProcessor), List.nil()); } catch (Throwable e) { - System.err.println("generateMethodCFG caught " + e); + // System.err.println("generateMethodCFG caught " + e); // ok } finally { System.setErr(err); @@ -271,7 +271,7 @@ public void write(int b) throws IOException {} printError( "internal error in type processor! method typeProcessOver() doesn't get" + " called."); - Thread.dumpStack(); + // Thread.dumpStack(); System.exit(1); } From 2a78128db6ae904152aeddd456d75130e08dab10 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 17:43:21 -0400 Subject: [PATCH 22/26] Comment out output... --- .../java/org/checkerframework/javacutil/BasicTypeProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java b/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java index a93cf6cd54d..0dcc7bb291e 100644 --- a/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java +++ b/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java @@ -41,6 +41,6 @@ public void typeProcess(TypeElement e, TreePath p) { + currentRoot.getSourceFile().getName() + (t.getMessage() != null ? "; message: " + t.getMessage() : "")); } - System.err.println("BasicTypeProcessor done with element: " + e); + // System.err.println("BasicTypeProcessor done with element: " + e); } } From a9792c7c543f4cdd09032a60d55e8edf36303d91 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 17:43:56 -0400 Subject: [PATCH 23/26] Keep JDK 22 experimental until bug is fixed --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 47581d86e05..a92a33e1813 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: java: [{version: '8', experimental: false}, {version: '11', experimental: false}, {version: '17', experimental: false}, - {version: '22', experimental: false}, + {version: '22', experimental: true}, {version: '23-ea', experimental: true}, {version: '24-ea', experimental: true}] env: From cff5a5182b999c705df6fa6fddf9f6faf1438226 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 18:11:01 -0400 Subject: [PATCH 24/26] Only comment changes are left... --- .../java/org/checkerframework/dataflow/cfg/CFGProcessor.java | 3 ++- .../org/checkerframework/javacutil/BasicTypeProcessor.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java index 669fdf4920f..b64928023cb 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java @@ -113,7 +113,8 @@ public Void visitMethod(MethodTree tree, Void p) { // Stop execution by throwing an exception. This makes sure that compilation // does not proceed, and thus the AST is not modified by further phases of the // compilation (and we save the work to do the compilation). - throw new RuntimeException("CFGProcessor found suitable method"); + // TODO throw new RuntimeException("CFGProcessor found suitable method"); + throw new RuntimeException(); } return null; } diff --git a/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java b/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java index 0dcc7bb291e..668be66cb48 100644 --- a/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java +++ b/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java @@ -37,10 +37,11 @@ public void typeProcess(TypeElement e, TreePath p) { System.err.println( "BasicTypeProcessor.typeProcess: unexpected Throwable (" + t.getClass().getSimpleName() - + ") when processing " + + ") when processing " + currentRoot.getSourceFile().getName() + (t.getMessage() != null ? "; message: " + t.getMessage() : "")); } + // TODO Spacing before `when` above. // System.err.println("BasicTypeProcessor done with element: " + e); } } From 9e1b684fab326d896250c61fb0d470c8e8293c07 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 20:20:24 -0400 Subject: [PATCH 25/26] Only remove comments... --- .../java/org/checkerframework/dataflow/cfg/CFGProcessor.java | 4 ---- .../dataflow/cfg/visualize/CFGVisualizeLauncher.java | 4 ---- .../org/checkerframework/javacutil/BasicTypeProcessor.java | 2 -- 3 files changed, 10 deletions(-) diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java index b64928023cb..a35ebe8eb97 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/CFGProcessor.java @@ -57,7 +57,6 @@ public class CFGProcessor extends BasicTypeProcessor { public CFGProcessor(String className, String methodName) { this.className = className; this.methodName = methodName; - // System.err.println("Instantiating CFGProcessor for " + className + "::" + methodName); } /** @@ -71,8 +70,6 @@ public CFGProcessor(String className, String methodName) { @Override public void typeProcessingOver() { - // System.err.println("Calling typeProcessingOver()!!"); - // Thread.dumpStack(); if (rootTree == null) { result = new CFGProcessResult("Root tree is null."); } else if (classTree == null) { @@ -113,7 +110,6 @@ public Void visitMethod(MethodTree tree, Void p) { // Stop execution by throwing an exception. This makes sure that compilation // does not proceed, and thus the AST is not modified by further phases of the // compilation (and we save the work to do the compilation). - // TODO throw new RuntimeException("CFGProcessor found suitable method"); throw new RuntimeException(); } return null; diff --git a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java index a9001aff8e9..8b2c6a28360 100644 --- a/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java +++ b/dataflow/src/main/java/org/checkerframework/dataflow/cfg/visualize/CFGVisualizeLauncher.java @@ -223,8 +223,6 @@ void generateDOTofCFG( * @return control flow graph of the specified method */ public static ControlFlowGraph generateMethodCFG(String file, String clas, String method) { - // System.err.println("generateMethodCFG: " + file + " clas: " + clas + " method: " + - // method); CFGProcessor cfgProcessor = new CFGProcessor(clas, method); Context context = new Context(); @@ -259,7 +257,6 @@ public void write(int b) throws IOException {} System.setErr(new PrintStream(nullOS)); javac.compile(List.of(l), List.of(clas), List.of(cfgProcessor), List.nil()); } catch (Throwable e) { - // System.err.println("generateMethodCFG caught " + e); // ok } finally { System.setErr(err); @@ -271,7 +268,6 @@ public void write(int b) throws IOException {} printError( "internal error in type processor! method typeProcessOver() doesn't get" + " called."); - // Thread.dumpStack(); System.exit(1); } diff --git a/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java b/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java index 668be66cb48..0d14696f205 100644 --- a/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java +++ b/javacutil/src/main/java/org/checkerframework/javacutil/BasicTypeProcessor.java @@ -41,7 +41,5 @@ public void typeProcess(TypeElement e, TreePath p) { + currentRoot.getSourceFile().getName() + (t.getMessage() != null ? "; message: " + t.getMessage() : "")); } - // TODO Spacing before `when` above. - // System.err.println("BasicTypeProcessor done with element: " + e); } } From 54c74df7950c2ce9b2864b4f1d6af987bd27be6e Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Thu, 8 Aug 2024 20:57:28 -0400 Subject: [PATCH 26/26] Restore all jobs --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a92a33e1813..3f30f430358 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,6 @@ jobs: remainder: name: ${{ matrix.script }} on JDK ${{ matrix.java_version }} runs-on: ubuntu-latest - if: false # Don't depend on sanity jobs, to have more parallelism. # TODO: cancel these jobs if sanity fails. # needs: sanity @@ -78,10 +77,7 @@ jobs: fail-fast: false matrix: # jspecify-conformance only tested on JDK 21. - script: ['cftests-junit', 'cftests-nonjunit' - #, 'cftests-junit-jdk21', - #'typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'daikon-part1', 'daikon-part2' - ] + script: ['cftests-junit', 'cftests-nonjunit', 'cftests-junit-jdk21', 'typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'daikon-part1', 'daikon-part2'] # JDK 21 used by sanity before java: [{version: '8', experimental: false}, {version: '11', experimental: false},