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

Build the JSpecify JDK #114

Merged
merged 23 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ba27da4
Try adding the JSpecify annotations to see if it helps with CI.
cpovirk Oct 7, 2024
13ae048
Trim list of platforms.
cpovirk Oct 7, 2024
c62e6d0
Try --disable-jvm-feature-jvmti.
cpovirk Oct 7, 2024
c87fa58
Merge branch 'jspecify-annotations-for-ci' of https://github.com/jspe…
wmdietl Nov 15, 2024
1b4743c
Delete unused files
wmdietl Dec 16, 2024
30005e1
Merge branch 'main' of https://github.com/jspecify/jdk into jspecify-…
wmdietl Dec 16, 2024
b9c9aea
Delete Checker Framework annotation declarations
wmdietl Dec 16, 2024
3b2d67e
Remove uses of Checker Framework annotations
wmdietl Dec 16, 2024
817de16
Add missing imports
wmdietl Dec 16, 2024
3510a10
Static method needs a body.
wmdietl Dec 16, 2024
053209b
Make signature compatible with Hashtable
wmdietl Dec 16, 2024
db687aa
Make build files consistent with eisop/jdk versions
wmdietl Dec 16, 2024
4fed369
Hacky handling of type annotations.
wmdietl Dec 16, 2024
1c19f4a
Add file that was lost in some merge
wmdietl Dec 16, 2024
00585ac
Use ASCII letters only
wmdietl Dec 16, 2024
09309ef
Strip JSpecify annotations from file in bootstrap tools.
wmdietl Dec 17, 2024
34da1c8
Minimal GitHub Actions CI setup
wmdietl Dec 17, 2024
efbb1e3
Install dependencies
wmdietl Dec 17, 2024
75a3cf4
Fix stack overflow
wmdietl Dec 17, 2024
56bb9db
Avoid annotation on Object wildcard bound
wmdietl Dec 17, 2024
ea1d2b7
Only run JSpecify CI job
wmdietl Dec 17, 2024
858e3ea
Revert "Try --disable-jvm-feature-jvmti."
wmdietl Dec 17, 2024
9f0fe99
Fix build warnings by reducing diffs to openjdk/jdk
wmdietl Dec 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 36 additions & 0 deletions .github/workflows/jspecify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: JSpecify JDK CI tests

on:
pull_request:
push:
branches: [ "main" ]

jobs:
build_jdk:
name: Build the JSpecify JDK
runs-on: ubuntu-latest
permissions:
contents: read
env:
JAVA_VERSION: 23
steps:
- uses: actions/checkout@v4
- name: Set up JDK 23
uses: actions/setup-java@v4
with:
java-version: 23
distribution: 'temurin'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install --only-upgrade apt
sudo apt-get install gcc-10 g++-10 libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
- name: Install jtreg
run: |
wget https://builds.shipilev.net/jtreg/jtreg-7.5%2B1.zip -O /tmp/jtreg.zip
unzip /tmp/jtreg.zip -d /tmp/
- name: Configure the JDK
run: bash ./configure --with-jtreg=/tmp/jtreg --disable-warnings-as-errors
- name: Build the JDK
run: make jdk

10 changes: 7 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ on:
inputs:
platforms:
description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
required: true
default: 'linux-x64, linux-x64-variants, linux-cross-compile, alpine-linux-x64, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
required: false
default: ''
# default: 'linux-x64, linux-x64-variants, linux-cross-compile, alpine-linux-x64, macos-x64, macos-aarch64, windows-x64, windows-aarch64, docs'
configure-arguments:
description: 'Additional configure arguments'
required: false
Expand Down Expand Up @@ -120,7 +121,9 @@ jobs:
return
fi
done
echo 'true'
# echo 'true'
# WMD: Assume empty means no platforms
echo 'false'
return
else
# Check for all acceptable platform names
Expand Down Expand Up @@ -163,6 +166,7 @@ jobs:
uses: ./.github/workflows/build-linux.yml
with:
platform: linux-x64
debug-levels: '[ "debug" ]'
gcc-major-version: '10'
configure-arguments: ${{ github.event.inputs.configure-arguments }}
make-arguments: ${{ github.event.inputs.make-arguments }}
Expand Down
Binary file removed checker-qual.jar
Binary file not shown.
15 changes: 0 additions & 15 deletions createjdkJAR.sh

This file was deleted.

5 changes: 5 additions & 0 deletions make/CompileInterimLangtools.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ TARGETS += $(COPY_PREVIEW_FEATURES)
# would require the source files to be copied into directories named after the
# actual interim modules.

## DON'T PUT COMMAS within this macro definition, as in
# --add-exports java.base/org.checkerframework.checker.builder.qual=java.compiler.interim,jdk.compiler.interim \

# Param 1 - Name of module to compile
define SetupInterimModule
$$(eval $$(call SetupJavaCompilation, BUILD_$1.interim, \
Expand All @@ -112,6 +115,8 @@ define SetupInterimModule
DISABLED_WARNINGS := module options, \
JAVAC_FLAGS := \
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
-cp $(TOPDIR)/src/java.base/share/classes/ \
--add-reads $1.interim=ALL-UNNAMED \
$$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \
--add-exports java.base/jdk.internal.javac=java.compiler.interim \
Expand Down
4 changes: 4 additions & 0 deletions make/CopyInterimTZDB.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ define tzdb_copyfiles
$(call MakeTargetDir)
$(RM) '$@'
$(SED) -e "s/package java.time.zone/package build.tools.tzdb/" \
-e "s/import org.jspecify.annotations.NullMarked;//" \
-e "s/import org.jspecify.annotations.Nullable;//" \
-e "s/@NullMarked//" \
-e "s/@Nullable //" \
< $(<) > $@
endef

Expand Down
1 change: 1 addition & 0 deletions make/autoconf/spec.gmk.template
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ INTERIM_LANGTOOLS_ARGS := \
--add-modules $(INTERIM_LANGTOOLS_MODULES_COMMA) \
--module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
--patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \
-cp $(TOPDIR)/src/java.base/share/classes/ \
$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
#
JAVAC_MAIN_CLASS := -m jdk.compiler.interim/com.sun.tools.javac.Main
Expand Down
2 changes: 1 addition & 1 deletion make/common/JavaCompilation.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ define SetupJavaCompilationBody
endif

# Allow overriding on the command line
JAVA_WARNINGS_ARE_ERRORS ?= -Werror
JAVA_WARNINGS_ARE_ERRORS ?=

# Tell javac to do exactly as told and no more
PARANOIA_FLAGS := -implicit:none -Xprefer:source -XDignore.symbol.file=true -encoding ascii
Expand Down
4 changes: 2 additions & 2 deletions make/langtools/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
#

#javac configuration for "normal build" (these will be passed to the bootstrap compiler):
javac.opts = -XDignore.symbol.file=true -Xlint:all,-deprecation,-exports -Werror -g:source,lines,vars
javac.opts = -XDignore.symbol.file=true -Xlint:all,-deprecation,-exports -g:source,lines,vars

#version used to compile build tools
javac.build.opts = -XDignore.symbol.file=true -Xlint:all,-deprecation,-options -Werror -g:source,lines,vars
javac.build.opts = -XDignore.symbol.file=true -Xlint:all,-deprecation,-options -g:source,lines,vars
javac.build.source = 8
javac.build.target = 8

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2613,6 +2613,10 @@ private boolean readAttribute(ClassFile cf, FeatureDescription feature, Attribut
((MethodDescription) feature).classParameterAnnotations =
parameterAnnotations2Description(cf.constant_pool, attr);
break;
case "RuntimeInvisibleTypeAnnotations":
case "RuntimeVisibleTypeAnnotations":
// TODO(wmdietl): What should happen to type annotations?
break;
case Attribute.Module: {
assert feature instanceof ModuleHeaderDescription;
ModuleHeaderDescription header =
Expand Down
3 changes: 3 additions & 0 deletions src/java.base/share/classes/java/io/DataOutputStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

import jdk.internal.access.JavaLangAccess;
import jdk.internal.access.SharedSecrets;
import jdk.internal.util.ByteArray;

import static jdk.internal.util.ModifiedUtf.putChar;
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/java/lang/Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
*/

@NullMarked
public class Runtime {
public class Runtime {
private static final Runtime currentRuntime = new Runtime();

private static Version version;
Expand Down Expand Up @@ -177,7 +177,6 @@ private Runtime() {}
* @see #removeShutdownHook
* @see #halt(int)
*/

public void exit(int status) {
Shutdown.exit(status);
}
Expand Down Expand Up @@ -368,6 +367,7 @@ public Process exec(String command) throws IOException {
* @see #exec(String[], String[], File)
* @see ProcessBuilder
*/
@Deprecated(since="18")
public Process exec(String command, String @Nullable [] envp) throws IOException {
return exec(command, envp, null);
}
Expand Down
1 change: 0 additions & 1 deletion src/java.base/share/classes/java/net/DatagramSocket.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

package java.net;

import org.checkerframework.checker.interning.qual.UsesObjectEquals;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;

Expand Down
6 changes: 1 addition & 5 deletions src/java.base/share/classes/java/nio/file/Files.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@

package java.nio.file;

import org.checkerframework.checker.interning.qual.UsesObjectEquals;
import org.checkerframework.checker.signedness.qual.PolySigned;
import org.checkerframework.framework.qual.AnnotatedFor;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.Closeable;
Expand Down Expand Up @@ -3173,7 +3169,7 @@ public static List<String> readAllLines(Path path) throws IOException {
* StandardOpenOption#CREATE_NEW CREATE_NEW} option is specified
* <i>(optional specific exception)</i>
*/
public static Path write(Path path, @PolySigned byte[] bytes, OpenOption... options)
public static Path write(Path path, byte[] bytes, OpenOption... options)
throws IOException
{
// ensure bytes is not null before opening file
Expand Down
Loading
Loading