From dd7d2c32f44bfb0e00a2fa988aaeb41b8349b3b2 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Thu, 7 Mar 2024 17:16:58 -0300 Subject: [PATCH 1/5] +openjdk.org@11 --- projects/openjdk.org/package.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/projects/openjdk.org/package.yml b/projects/openjdk.org/package.yml index f444c03d09..1439f3a2a3 100644 --- a/projects/openjdk.org/package.yml +++ b/projects/openjdk.org/package.yml @@ -1,11 +1,13 @@ distributable: - # TODO: add jdk11 and jdk8 + # TODO: add jdk8 - url: https://github.com/openjdk/jdk21u/archive/{{version.tag}}.tar.gz strip-components: 1 - url: https://github.com/openjdk/jdk20u/archive/{{version.tag}}.tar.gz strip-components: 1 - url: https://github.com/openjdk/jdk17u/archive/{{version.tag}}.tar.gz strip-components: 1 + - url: https://github.com/openjdk/jdk11u/archive/{{version.tag}}.tar.gz + strip-components: 1 versions: # each repo contains all the prior repo tags at the time of the fork, @@ -17,6 +19,8 @@ versions: transform: 'v => v.match(/jdk-20\.0\./) ? v.replace(/\+/, ".").replace(/^jdk-/, "") : undefined' - github: openjdk/jdk17u/tags transform: 'v => v.match(/jdk-17\.0\./) ? v.replace(/\+/, ".").replace(/^jdk-/, "") : undefined' + - github: openjdk/jdk11u/tags + transform: 'v => v.match(/jdk-11\.0\./) ? v.replace(/\+/, ".").replace(/^jdk-/, "") : undefined' interprets: extensions: java @@ -103,9 +107,10 @@ build: # from https://jdk.java.net/archive/ # the boot jdk should point to the last version of the previous major version # or the last previous version of the current major version - BOOT_JDK17: https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2 - BOOT_JDK20: https://download.java.net/java/GA/jdk20.0.2/6e380f22cbe7469fa75fb448bd903d8e/9/GPL/openjdk-20.0.2 BOOT_JDK21: https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1 + BOOT_JDK20: https://download.java.net/java/GA/jdk20.0.2/6e380f22cbe7469fa75fb448bd903d8e/9/GPL/openjdk-20.0.2 + BOOT_JDK17: https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2 + BOOT_JDK11: https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2 ARGS: - --disable-warnings-as-errors @@ -152,7 +157,8 @@ provides: - bin/jstack - bin/jstat - bin/jstatd - # TODO: if: {{version.major}} >= 21 + # TODO: this bin should only be available in jdk21+ + # https://github.com/pkgxdev/libpkgx/issues/68 # - bin/jwebserver - bin/keytool - bin/rmiregistry From 5d5cd38020da6db1cb4108c299da100ab7119927 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Thu, 7 Mar 2024 18:07:02 -0300 Subject: [PATCH 2/5] add customizations for v11 --- projects/openjdk.org/package.yml | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/projects/openjdk.org/package.yml b/projects/openjdk.org/package.yml index 1439f3a2a3..92482851f6 100644 --- a/projects/openjdk.org/package.yml +++ b/projects/openjdk.org/package.yml @@ -68,12 +68,19 @@ build: - run: sed -i -e's/c..filt/llvm-cxxfilt/' toolchain.m4 working-directory: make/autoconf if: linux - - bash configure $ARGS - --with-boot-jdk="$BOOT_JDK_DIR" - --with-vendor-version-string="$(pkgx --version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')" - --with-extra-cflags="$CFLAGS" - --with-extra-cxxflags="$CXXFLAGS" - --with-extra-ldflags="$LDFLAGS" + - | + if [ {{version.major}} -gt 11 ]; then + version_args=--with-version-build={{version.minor}} + else + version_args="--disable-hotspot-gtest --with-conf-name=release --with-jvm-features=shenandoahgc" + fi + + bash configure $ARGS $version_args \ + --with-boot-jdk="$BOOT_JDK_DIR" \ + --with-vendor-version-string="$(pkgx --version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')" \ + --with-extra-cflags="$CFLAGS" \ + --with-extra-cxxflags="$CXXFLAGS" \ + --with-extra-ldflags="$LDFLAGS" - make images - mkdir -p {{prefix}} - mv $JDK_DIR {{prefix}}/ @@ -85,16 +92,18 @@ build: JDK_DIR: build/*/images/jdk-bundle/jdk-{{version.marketing}}.{{version.patch}}.jdk/Contents/Home/* ARGS: - --enable-dtrace + # - --with-sysroot=#{MacOS.sdk_path} # from homebrew's formulae linux: STRIP: 1 BOOT_JDK_DIR: $SRCROOT/boot-jdk JDK_DIR: build/*/images/jdk/* ARGS: + - --with-x={{deps.x.org/x11.prefix}} # from homebrew's formulae - --with-cups={{deps.openprinting.github.io/cups.prefix}} - --with-fontconfig={{deps.freedesktop.org/fontconfig.prefix}} - --with-freetype=system - --with-stdc++lib=dynamic - - --with-toolchain-type=clang + - --with-toolchain-type=clang # not in brew's formulae darwin/aarch64: JDK_ARCH: macos-aarch64 darwin/x86-64: @@ -121,7 +130,6 @@ build: - --with-vendor-name="tea.xyz" - --with-vendor-url="https://github.com/teaxyz/pantry/issues" - --with-vendor-vm-bug-url="https://github.com/teaxyz/pantry/issues" - - --with-version-build={{version.minor}} - --without-version-opt - --without-version-pre - --with-giflib=system From 430680d0acdd3fb939fc750630277cfe1d2d187f Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Thu, 7 Mar 2024 18:33:33 -0300 Subject: [PATCH 3/5] address comments --- projects/openjdk.org/package.yml | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/projects/openjdk.org/package.yml b/projects/openjdk.org/package.yml index 92482851f6..310bc03f3d 100644 --- a/projects/openjdk.org/package.yml +++ b/projects/openjdk.org/package.yml @@ -68,19 +68,16 @@ build: - run: sed -i -e's/c..filt/llvm-cxxfilt/' toolchain.m4 working-directory: make/autoconf if: linux - - | - if [ {{version.major}} -gt 11 ]; then - version_args=--with-version-build={{version.minor}} - else - version_args="--disable-hotspot-gtest --with-conf-name=release --with-jvm-features=shenandoahgc" - fi - - bash configure $ARGS $version_args \ - --with-boot-jdk="$BOOT_JDK_DIR" \ - --with-vendor-version-string="$(pkgx --version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')" \ - --with-extra-cflags="$CFLAGS" \ - --with-extra-cxxflags="$CXXFLAGS" \ - --with-extra-ldflags="$LDFLAGS" + - run: version_args=--with-version-build={{version.minor}} + if: '>=12' + - run: version_args="--disable-hotspot-gtest --with-conf-name=release --with-jvm-features=shenandoahgc" + if: <12 + - bash configure $ARGS $version_args + --with-boot-jdk="$BOOT_JDK_DIR" + --with-vendor-version-string="pkgx@$(pkgx --version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')" + --with-extra-cflags="$CFLAGS" + --with-extra-cxxflags="$CXXFLAGS" + --with-extra-ldflags="$LDFLAGS" - make images - mkdir -p {{prefix}} - mv $JDK_DIR {{prefix}}/ @@ -92,18 +89,19 @@ build: JDK_DIR: build/*/images/jdk-bundle/jdk-{{version.marketing}}.{{version.patch}}.jdk/Contents/Home/* ARGS: - --enable-dtrace - # - --with-sysroot=#{MacOS.sdk_path} # from homebrew's formulae + - --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk linux: STRIP: 1 BOOT_JDK_DIR: $SRCROOT/boot-jdk JDK_DIR: build/*/images/jdk/* ARGS: - - --with-x={{deps.x.org/x11.prefix}} # from homebrew's formulae + - --with-x={{deps.x.org/x11.prefix}} - --with-cups={{deps.openprinting.github.io/cups.prefix}} - --with-fontconfig={{deps.freedesktop.org/fontconfig.prefix}} - --with-freetype=system - --with-stdc++lib=dynamic - - --with-toolchain-type=clang # not in brew's formulae + - --with-toolchain-type=clang + - CXXFILT=llvm-cxxfilt # apparently not required in CI darwin/aarch64: JDK_ARCH: macos-aarch64 darwin/x86-64: From 9d7c5564638588145ff892d87a0903fedd824509 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Thu, 7 Mar 2024 19:37:25 -0300 Subject: [PATCH 4/5] more fixes --- projects/openjdk.org/package.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/projects/openjdk.org/package.yml b/projects/openjdk.org/package.yml index 310bc03f3d..7c7fb5659f 100644 --- a/projects/openjdk.org/package.yml +++ b/projects/openjdk.org/package.yml @@ -64,16 +64,11 @@ build: script: - run: wget -c ${BOOT_JDK{{version.major}}}_${JDK_ARCH}_bin.tar.gz -O - | tar xz -C . --strip-components=$STRIP working-directory: boot-jdk - # autoconf won't find llvm-cxxfilt for c++filt, and won't take an envvar - - run: sed -i -e's/c..filt/llvm-cxxfilt/' toolchain.m4 - working-directory: make/autoconf - if: linux - - run: version_args=--with-version-build={{version.minor}} - if: '>=12' - - run: version_args="--disable-hotspot-gtest --with-conf-name=release --with-jvm-features=shenandoahgc" + - run: extra_args="--disable-hotspot-gtest --with-jvm-features=shenandoahgc --with-conf-name=release" if: <12 - - bash configure $ARGS $version_args + - bash configure $ARGS $extra_args --with-boot-jdk="$BOOT_JDK_DIR" + --with-version-build=$(echo {{version.raw}} | grep -o '[0-9]\+$') --with-vendor-version-string="pkgx@$(pkgx --version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')" --with-extra-cflags="$CFLAGS" --with-extra-cxxflags="$CXXFLAGS" @@ -101,7 +96,7 @@ build: - --with-freetype=system - --with-stdc++lib=dynamic - --with-toolchain-type=clang - - CXXFILT=llvm-cxxfilt # apparently not required in CI + - CXXFILT=llvm-cxxfilt darwin/aarch64: JDK_ARCH: macos-aarch64 darwin/x86-64: @@ -128,8 +123,8 @@ build: - --with-vendor-name="tea.xyz" - --with-vendor-url="https://github.com/teaxyz/pantry/issues" - --with-vendor-vm-bug-url="https://github.com/teaxyz/pantry/issues" - - --without-version-opt - - --without-version-pre + - --with-version-opt="" + - --with-version-pre="" - --with-giflib=system - --with-harfbuzz=system - --with-lcms=system From 7494fc5669cc5c9a04cab803adf373c493a90b8d Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Fri, 8 Mar 2024 19:00:20 -0300 Subject: [PATCH 5/5] Fix boot jdk --- projects/openjdk.org/package.yml | 35 ++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/projects/openjdk.org/package.yml b/projects/openjdk.org/package.yml index 7c7fb5659f..ba37e9716b 100644 --- a/projects/openjdk.org/package.yml +++ b/projects/openjdk.org/package.yml @@ -56,28 +56,34 @@ runtime: build: dependencies: linux: - llvm.org: <17 + llvm.org: <16 # due to jdk11, jdk17+ compiles with llvm.org <17 gnu.org/make: '*' gnu.org/autoconf: '*' freedesktop.org/pkg-config: '*' gnu.org/wget: '*' script: - - run: wget -c ${BOOT_JDK{{version.major}}}_${JDK_ARCH}_bin.tar.gz -O - | tar xz -C . --strip-components=$STRIP + - run: | + BOOT_JDK_VERSION="${BOOT_JDK{{version.major}}_VERSION}" + BOOT_JDK_MAJOR=$(echo "$version" | grep -o '^[0-9]\+') + BOOT_JDK_URL="https://github.com/adoptium/temurin${BOOT_JDK_MAJOR}-binaries/releases/download/jdk-${BOOT_JDK_VERSION}/OpenJDK${BOOT_JDK_MAJOR}U-jdk_${BOOT_JDK_ARCH}_mac_hotspot_${BOOT_JDK_VERSION//+/_}.tar.gz" + wget -c "${BOOT_JDK_URL}" -O - | tar xz -C . --strip-components=$STRIP working-directory: boot-jdk - - run: extra_args="--disable-hotspot-gtest --with-jvm-features=shenandoahgc --with-conf-name=release" + - run: | + ARGS+=" --disable-hotspot-gtest --with-jvm-features=shenandoahgc --with-conf-name=release" + MAKE_ARGS+=" CONF=release" if: <12 - - bash configure $ARGS $extra_args + - bash configure $ARGS --with-boot-jdk="$BOOT_JDK_DIR" --with-version-build=$(echo {{version.raw}} | grep -o '[0-9]\+$') --with-vendor-version-string="pkgx@$(pkgx --version | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')" --with-extra-cflags="$CFLAGS" --with-extra-cxxflags="$CXXFLAGS" --with-extra-ldflags="$LDFLAGS" - - make images + - make images $MAKE_ARGS - mkdir -p {{prefix}} - mv $JDK_DIR {{prefix}}/ env: - MAKEFLAGS: 'JOBS={{ hw.concurrency }}' + MAKE_ARGS: 'JOBS={{ hw.concurrency }}' darwin: STRIP: 2 BOOT_JDK_DIR: $SRCROOT/boot-jdk/Contents/Home @@ -98,21 +104,20 @@ build: - --with-toolchain-type=clang - CXXFILT=llvm-cxxfilt darwin/aarch64: - JDK_ARCH: macos-aarch64 + BOOT_JDK_ARCH: aarch64_macos darwin/x86-64: - JDK_ARCH: macos-x64 + BOOT_JDK_ARCH: x64_macos linux/aarch64: - JDK_ARCH: linux-aarch64 + BOOT_JDK_ARCH: aarch64_linux linux/x86-64: - JDK_ARCH: linux-x64 + BOOT_JDK_ARCH: x64_linux - # from https://jdk.java.net/archive/ # the boot jdk should point to the last version of the previous major version # or the last previous version of the current major version - BOOT_JDK21: https://download.java.net/java/GA/jdk21.0.1/415e3f918a1f4062a0074a2794853d0d/12/GPL/openjdk-21.0.1 - BOOT_JDK20: https://download.java.net/java/GA/jdk20.0.2/6e380f22cbe7469fa75fb448bd903d8e/9/GPL/openjdk-20.0.2 - BOOT_JDK17: https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2 - BOOT_JDK11: https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2 + BOOT_JDK21_VERSION: 21.0.2+13 + BOOT_JDK20_VERSION: 20.0.2+9 + BOOT_JDK17_VERSION: 17.0.9+9 + BOOT_JDK11_VERSION: 11.0.22+7 ARGS: - --disable-warnings-as-errors