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

Support JDK 17 #4936

Merged
merged 24 commits into from Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 20 additions & 20 deletions azure-pipelines.yml
Expand Up @@ -34,15 +34,15 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-cftests-junit.sh
displayName: test-cftests-junit.sh
- job: junit_tests_jdk16
- job: junit_tests_jdk17
dependsOn:
- junit_tests_jdk11
- nonjunit_tests_jdk11
- misc_jdk11
- typecheck_jdk11
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk16:latest
container: mdernst/cf-ubuntu-jdk17:latest
timeoutInMinutes: 70
steps:
- checkout: self
Expand Down Expand Up @@ -72,15 +72,15 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-cftests-nonjunit.sh
displayName: test-cftests-nonjunit.sh
- job: nonjunit_tests_jdk16
- job: nonjunit_tests_jdk17
dependsOn:
- junit_tests_jdk11
- nonjunit_tests_jdk11
- misc_jdk11
- typecheck_jdk11
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk16:latest
container: mdernst/cf-ubuntu-jdk17:latest
steps:
- checkout: self
fetchDepth: 25
Expand Down Expand Up @@ -109,15 +109,15 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-cftests-inference.sh
displayName: test-cftests-inference.sh
- job: inference_tests_jdk16
- job: inference_tests_jdk17
dependsOn:
- junit_tests_jdk11
- inference_tests_jdk11
- misc_jdk11
- typecheck_jdk11
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk16:latest
container: mdernst/cf-ubuntu-jdk17:latest
steps:
- checkout: self
fetchDepth: 25
Expand Down Expand Up @@ -146,15 +146,15 @@ jobs:
fetchDepth: 1000
- bash: ./checker/bin-devel/test-misc.sh
displayName: test-misc.sh
- job: misc_jdk16
- job: misc_jdk17
dependsOn:
- junit_tests_jdk11
- nonjunit_tests_jdk11
- misc_jdk11
- typecheck_jdk11
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk16-plus:latest
container: mdernst/cf-ubuntu-jdk17-plus:latest
steps:
- checkout: self
fetchDepth: 1000
Expand Down Expand Up @@ -183,15 +183,15 @@ jobs:
fetchDepth: 1000
- bash: ./checker/bin-devel/test-typecheck.sh
displayName: test-typecheck.sh
- job: typecheck_jdk16
- job: typecheck_jdk17
dependsOn:
- junit_tests_jdk11
- nonjunit_tests_jdk11
- misc_jdk11
- typecheck_jdk11
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk16-plus:latest
container: mdernst/cf-ubuntu-jdk17-plus:latest
steps:
- checkout: self
fetchDepth: 1000
Expand Down Expand Up @@ -224,18 +224,18 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-daikon.sh
displayName: test-daikon.sh
## Daikon does not yet support JDK 16. TODO: Make Daikon run under JDK 16.
# - job: daikon_jdk16
## Daikon does not yet support JDK 17. TODO: Make Daikon run under JDK 17.
# - job: daikon_jdk17
# dependsOn:
# - junit_tests_jdk11
# - nonjunit_tests_jdk11
# - misc_jdk11
# - typecheck_jdk11
# # ## Commented to reduce latency and eliminate the "daikon_jdk11 -> daikon_jdk16" critical path.
# # ## Commented to reduce latency and eliminate the "daikon_jdk11 -> daikon_jdk17" critical path.
# # # - daikon_jdk11
# pool:
# vmImage: 'ubuntu-latest'
# container: mdernst/cf-ubuntu-jdk16:latest
# container: mdernst/cf-ubuntu-jdk17:latest
# timeoutInMinutes: 70
# steps:
# - checkout: self
Expand Down Expand Up @@ -266,7 +266,7 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-guava.sh
displayName: test-guava.sh
- job: guava_jdk16
- job: guava_jdk17
dependsOn:
- junit_tests_jdk11
- nonjunit_tests_jdk11
Expand All @@ -275,7 +275,7 @@ jobs:
- guava_jdk11
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk16:latest
container: mdernst/cf-ubuntu-jdk17:latest
steps:
- checkout: self
fetchDepth: 25
Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:
fetchDepth: 25
- bash: ./checker/bin-devel/test-plume-lib.sh
displayName: test-plume-lib.sh
- job: plume_lib_jdk16
- job: plume_lib_jdk17
dependsOn:
- junit_tests_jdk11
- nonjunit_tests_jdk11
Expand All @@ -314,7 +314,7 @@ jobs:
- plume_lib_jdk11
pool:
vmImage: 'ubuntu-latest'
container: mdernst/cf-ubuntu-jdk16:latest
container: mdernst/cf-ubuntu-jdk17:latest
steps:
- checkout: self
fetchDepth: 25
Expand Down Expand Up @@ -345,7 +345,7 @@ jobs:
# fetchDepth: 25
# - bash: ./checker/bin-devel/test-downstream.sh
# displayName: test-downstream.sh
# - job: downstream_jdk16
# - job: downstream_jdk17
# dependsOn:
# - junit_tests_jdk11
# - nonjunit_tests_jdk11
Expand All @@ -354,7 +354,7 @@ jobs:
# - downstream_jdk11
# pool:
# vmImage: 'ubuntu-latest'
# container: mdernst/cf-ubuntu-jdk16:latest
# container: mdernst/cf-ubuntu-jdk17:latest
# steps:
# - checkout: self
# fetchDepth: 25
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Expand Up @@ -26,7 +26,7 @@ ext {
// On a Java 9+ JVM, use the host javac, default source/target, and required module flags.
isJava8 = JavaVersion.current() == JavaVersion.VERSION_1_8

isJava16 = JavaVersion.current() == JavaVersion.VERSION_16
isJava17 = JavaVersion.current() == JavaVersion.VERSION_17

errorproneJavacVersion = '9+181-r4173-1'

Expand Down Expand Up @@ -55,15 +55,15 @@ switch (JavaVersion.current()) {
case JavaVersion.VERSION_1_9:
case JavaVersion.VERSION_1_10:
case JavaVersion.VERSION_12:
logger.warn("The Checker Framework has only been tested with JDK 8 and 11." +
logger.warn("The Checker Framework has only been tested with JDK 8, 11, and 17." +
" Found version " + JavaVersion.current().majorVersion);
break;
case JavaVersion.VERSION_1_8:
case JavaVersion.VERSION_11:
case JavaVersion.VERSION_16:
case JavaVersion.VERSION_17:
break; // Supported versions
default:
throw new GradleException("Build the Checker Framework with JDK 8 or JDK 11." +
throw new GradleException("Build the Checker Framework with JDK 8, 11, or 17." +
" Found version " + JavaVersion.current().majorVersion);
}

Expand Down Expand Up @@ -406,7 +406,7 @@ List<String> getJavaFilesToFormat(projectName) {
&& !details.path.contains("calledmethods-delomboked")
&& !details.path.contains("returnsreceiverdelomboked")
&& !details.path.contains("build")
&& (isJava16 || !details.path.contains("-records"))
&& (isJava17 || !details.path.contains("-records"))
&& details.name.endsWith('.java')) {
javaFiles.add(details.file)
}
Expand Down
@@ -1,3 +1,5 @@
// @above-java11-skip-test until this is fixed: https://tinyurl.com/cfissue/4934

package org.checkerframework.checker.mustcall.qual;

import java.lang.annotation.ElementType;
Expand Down
4 changes: 2 additions & 2 deletions checker/bin-devel/Dockerfile-README
Expand Up @@ -49,12 +49,12 @@ export PROJECT=cf
create_upload_docker_image

export OS=ubuntu
export JDKVER=jdk16
export JDKVER=jdk17
export PROJECT=cf
create_upload_docker_image

export OS=ubuntu
export JDKVER=jdk16-plus
export JDKVER=jdk17-plus
export PROJECT=cf
create_upload_docker_image

Expand Down
@@ -1,5 +1,5 @@
# Create a Docker image that is ready to run the main Checker Framework tests,
# using JDK 16.
# using JDK 17.

# "ubuntu" is the latest LTS release. "ubuntu:rolling" is the latest release.
FROM ubuntu
Expand All @@ -10,18 +10,19 @@ MAINTAINER Michael Ernst <mernst@cs.washington.edu>
# * Put "apt-get update" and "apt-get install" and apt cleanup in the same RUN command.
# * Do not run "apt-get upgrade"; instead get upstream to update.

# Instructions for installing Java 16 on Ubuntu:
# https://www.linuxuprising.com/2021/03/how-to-install-oracle-java-16-on-debian.html
# Instructions for installing Java 17 on Ubuntu:
# https://www.linuxuprising.com/2021/09/how-to-install-oracle-java-17-lts-on.html
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
&& apt-get -qqy install software-properties-common \
&& add-apt-repository ppa:linuxuprising/java

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
&& echo oracle-java16-installer shared/accepted-oracle-license-v1-2 select true | /usr/bin/debconf-set-selections \
&& echo oracle-java17-installer shared/accepted-oracle-license-v1-3 select true | /usr/bin/debconf-set-selections \
&& echo oracle-java17-installer shared/accepted-oracle-licence-v1-3 boolean true | /usr/bin/debconf-set-selections \
&& apt-get -qqy install \
oracle-java16-installer --install-recommends
oracle-java17-installer --install-recommends

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
Expand All @@ -41,9 +42,9 @@ RUN export DEBIAN_FRONTEND=noninteractive \
wget

RUN export DEBIAN_FRONTEND=noninteractive \
&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.tar.gz \
&& tar xzvf apache-maven-3.8.1-bin.tar.gz
ENV PATH="/apache-maven-3.8.1/bin:$PATH"
&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.8.3/binaries/apache-maven-3.8.3-bin.tar.gz \
&& tar xzvf apache-maven-3.8.3-bin.tar.gz
ENV PATH="/apache-maven-3.8.3/bin:$PATH"

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get clean \
Expand Down
@@ -1,5 +1,5 @@
# Create a Docker image that is ready to run the full Checker Framework tests,
# including building the manual and Javadoc, using JDK 16.
# including building the manual and Javadoc, using JDK 17.

# "ubuntu" is the latest LTS release. "ubuntu:rolling" is the latest release.
FROM ubuntu
Expand All @@ -12,18 +12,19 @@ MAINTAINER Michael Ernst <mernst@cs.washington.edu>
# * Put "apt-get update" and "apt-get install" and apt cleanup in the same RUN command.
# * Do not run "apt-get upgrade"; instead get upstream to update.

# Instructions for installing Java 16 on Ubuntu:
# https://www.linuxuprising.com/2021/03/how-to-install-oracle-java-16-on-debian.html
# Instructions for installing Java 17 on Ubuntu:
# https://www.linuxuprising.com/2021/09/how-to-install-oracle-java-17-lts-on.html
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
&& apt-get -qqy install software-properties-common \
&& add-apt-repository ppa:linuxuprising/java

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
&& echo oracle-java16-installer shared/accepted-oracle-license-v1-2 select true | /usr/bin/debconf-set-selections \
&& echo oracle-java17-installer shared/accepted-oracle-license-v1-3 select true | /usr/bin/debconf-set-selections \
&& echo oracle-java17-installer shared/accepted-oracle-licence-v1-3 boolean true | /usr/bin/debconf-set-selections \
&& apt-get -qqy install \
oracle-java16-installer --install-recommends
oracle-java17-installer --install-recommends

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
Expand All @@ -43,9 +44,9 @@ RUN export DEBIAN_FRONTEND=noninteractive \
wget

RUN export DEBIAN_FRONTEND=noninteractive \
&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.8.1/binaries/apache-maven-3.8.1-bin.tar.gz \
&& tar xzvf apache-maven-3.8.1-bin.tar.gz
ENV PATH="/apache-maven-3.8.1/bin:$PATH"
&& wget https://mirrors.sonic.net/apache/maven/maven-3/3.8.3/binaries/apache-maven-3.8.3-bin.tar.gz \
&& tar xzvf apache-maven-3.8.3-bin.tar.gz
ENV PATH="/apache-maven-3.8.3/bin:$PATH"

RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qqy update \
Expand Down
22 changes: 11 additions & 11 deletions checker/bin/wpi-many.sh
Expand Up @@ -66,11 +66,11 @@ else
has_java11="yes"
fi

# shellcheck disable=SC2153 # testing for JAVA16_HOME, not a typo of JAVA_HOME
if [ "${JAVA16_HOME}" = "" ]; then
has_java16="no"
# shellcheck disable=SC2153 # testing for JAVA17_HOME, not a typo of JAVA_HOME
if [ "${JAVA17_HOME}" = "" ]; then
has_java17="no"
else
has_java16="yes"
has_java17="yes"
fi

if [ "${has_java_home}" = "yes" ] && [ ! -d "${JAVA_HOME}" ]; then
Expand All @@ -88,9 +88,9 @@ if [ "${has_java_home}" = "yes" ]; then
export JAVA11_HOME="${JAVA_HOME}"
has_java11="yes"
fi
if [ "${has_java16}" = "no" ] && [ "${java_version}" = 16 ]; then
export JAVA16_HOME="${JAVA_HOME}"
has_java16="yes"
if [ "${has_java17}" = "no" ] && [ "${java_version}" = 17 ]; then
export JAVA17_HOME="${JAVA_HOME}"
has_java17="yes"
fi
fi

Expand All @@ -104,13 +104,13 @@ if [ "${has_java11}" = "yes" ] && [ ! -d "${JAVA11_HOME}" ]; then
exit 1
fi

if [ "${has_java16}" = "yes" ] && [ ! -d "${JAVA16_HOME}" ]; then
echo "JAVA16_HOME is set to a non-existent directory ${JAVA16_HOME}"
if [ "${has_java17}" = "yes" ] && [ ! -d "${JAVA17_HOME}" ]; then
echo "JAVA17_HOME is set to a non-existent directory ${JAVA17_HOME}"
exit 1
fi

if [ "${has_java8}" = "no" ] && [ "${has_java11}" = "no" ] && [ "${has_java16}" = "no" ]; then
echo "No Java 8, 11, or 16 JDKs found. At least one of JAVA_HOME, JAVA8_HOME, JAVA11_HOME, or JAVA16_HOME must be set."
if [ "${has_java8}" = "no" ] && [ "${has_java11}" = "no" ] && [ "${has_java17}" = "no" ]; then
echo "No Java 8, 11, or 17 JDKs found. At least one of JAVA_HOME, JAVA8_HOME, JAVA11_HOME, or JAVA17_HOME must be set."
exit 1
fi

Expand Down