From d30ebee6d096acfbc03bf6eec8672770d046cd77 Mon Sep 17 00:00:00 2001 From: Werner Dietl Date: Sun, 11 Aug 2024 21:34:58 -0400 Subject: [PATCH] Check that building the JSpecify Reference Checker works (#821) --- .github/workflows/ci.yml | 4 +-- .../test-jspecify-reference-checker.sh | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 checker/bin-devel/test-jspecify-reference-checker.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cf79834a2d..09b8e6a8a9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: strategy: matrix: # No need to run 'cftests-junit-jdk21' on JDK 21. - script: ['typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'daikon-part1', 'daikon-part2', 'jspecify-conformance'] + script: ['typecheck-part1', 'typecheck-part2', 'guava', 'plume-lib', 'daikon-part1', 'daikon-part2', 'jspecify-conformance', 'jspecify-reference-checker'] java_version: [21] env: JAVA_VERSION: ${{ matrix.java_version }} @@ -76,7 +76,7 @@ jobs: strategy: fail-fast: false matrix: - # jspecify-conformance only tested on JDK 21. + # jspecify-conformance and jspecify-reference-checker only tested on JDK 21. 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}, diff --git a/checker/bin-devel/test-jspecify-reference-checker.sh b/checker/bin-devel/test-jspecify-reference-checker.sh new file mode 100755 index 00000000000..6974fbfbc54 --- /dev/null +++ b/checker/bin-devel/test-jspecify-reference-checker.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e +set -o verbose +set -o xtrace +export SHELLOPTS +echo "SHELLOPTS=${SHELLOPTS}" + +SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" +# shellcheck disable=SC1090 # In newer shellcheck than 0.6.0, pass: "-P SCRIPTDIR" (literally) +export ORG_GRADLE_PROJECT_useJdk17Compiler=true +source "$SCRIPTDIR"/clone-related.sh +./gradlew assembleForJavac --console=plain -Dorg.gradle.internal.http.socketTimeout=60000 -Dorg.gradle.internal.http.connectionTimeout=60000 + +GIT_SCRIPTS="$SCRIPTDIR/.git-scripts" +# TODO: remove uses of `main-eisop` once that becomes `main`. +"$GIT_SCRIPTS/git-clone-related" jspecify jspecify-reference-checker -b main-eisop + +# Delete the eisop/jdk that was already cloned... +rm -r ../jdk +# instead clone the jspecify/jdk. +"$GIT_SCRIPTS/git-clone-related" jspecify jdk + +cd ../jspecify-reference-checker +git switch main-eisop +./gradlew build conformanceTests demoTest --console=plain --include-build "$CHECKERFRAMEWORK"