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

openjdk: test build with llvm@17 #190817

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions Formula/o/openjdk.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Openjdk < Formula

Check warning on line 1 in Formula/o/openjdk.rb

View workflow job for this annotation

GitHub Actions / macOS 15-arm64

`brew linkage --cached --test --strict openjdk` failed on macOS Sequoia (15) on Apple Silicon!

Indirect dependencies with linkage: freetype

Check warning on line 1 in Formula/o/openjdk.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew linkage --cached --test --strict openjdk` failed on macOS Sonoma (14) on Apple Silicon!

Indirect dependencies with linkage: freetype

Check warning on line 1 in Formula/o/openjdk.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

`brew linkage --cached --test --strict openjdk` failed on macOS Ventura (13) on Apple Silicon!

Indirect dependencies with linkage: freetype
desc "Development kit for the Java programming language"
homepage "https://openjdk.java.net/"
url "https://github.com/openjdk/jdk22u/archive/refs/tags/jdk-22.0.2-ga.tar.gz"
Expand All @@ -24,6 +24,7 @@
keg_only :shadowed_by_macos

depends_on "autoconf" => :build
depends_on "llvm@17" => :build
depends_on "pkg-config" => :build
depends_on xcode: :build
depends_on "giflib"
Expand All @@ -38,20 +39,6 @@
uses_from_macos "zip"
uses_from_macos "zlib"

on_macos do
if DevelopmentTools.clang_build_version == 1600
depends_on "llvm" => :build

fails_with :clang do
cause <<~EOS
Exception in thread "main" java.lang.ClassFormatError: StackMapTable format error: bad verification type
at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:64)
at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:52)
EOS
end
end
end

on_linux do
depends_on "alsa-lib"
depends_on "fontconfig"
Expand Down Expand Up @@ -91,11 +78,9 @@
end
end

def install

Check failure on line 81 in Formula/o/openjdk.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew install --verbose --formula --build-bottle openjdk` failed on Linux!

==> Fetching openjdk ==> Downloading https://download.java.net/java/GA/jdk22.0.1/c7ec1332f7bb44aeba2eb341ae18aca4/8/GPL/openjdk-22.0.1_linux-x64_bin.tar.gz Already downloaded: /home/linuxbrew/.cache/Homebrew/downloads/47f553ebd9693d51c50eacc635f40c4faf05df6260cf0d3a63fefe02cbe48baa--openjdk-22.0.1_linux-x64_bin.tar.gz ==> Verifying checksum for '47f553ebd9693d51c50eacc635f40c4faf05df6260cf0d3a63fefe02cbe48baa--openjdk-22.0.1_linux-x64_bin.tar.gz' ==> Downloading https://github.com/openjdk/jdk22u/archive/refs/tags/jdk-22.0.2-ga.tar.gz Already downloaded: /home/linuxbrew/.cache/Homebrew/downloads/836456b5ed316470f1de74c051ba45be702c049613007987b7682142b8d07199--jdk22u-jdk-22.0.2-ga.tar.gz ==> Verifying checksum for '836456b5ed316470f1de74c051ba45be702c049613007987b7682142b8d07199--jdk22u-jdk-22.0.2-ga.tar.gz' /usr/bin/env tar --extract --no-same-owner --file /home/linuxbrew/.cache/Homebrew/downloads/836456b5ed316470f1de74c051ba45be702c049613007987b7682142b8d07199--jdk22u-jdk-22.0.2-ga.tar.gz --directory /tmp/homebrew-unpack20240916-15753-vf3vsx /usr/bin/env cp -pR /tmp/homebrew-unpack20240916-15753-vf3vsx/jdk22u-jdk-22.0.2-ga/. /tmp/openjdk-20240916-15753-aqeiih/jdk22u-jdk-22.0.2-ga /usr/bin/env tar --extract --no-same-owner --file /home/linuxbrew/.cache/Homebrew/downloads/47f553ebd9693d51c50eacc635f40c4faf05df6260cf0d3a63fefe02cbe48baa--openjdk-22.0.1_linux-x64_bin.tar.gz --directory /tmp/homebrew-unpack20240916-15753-3qfoug /usr/bin/env cp -pR /tmp/homebrew-unpack20240916-15753-3qfoug/jdk-22.0.1/. /tmp/openjdk--boot-jdk-20240916-15753-liwv5h/jdk-22.0.1 ==> bash configure --disable-warnings-as-errors --with-boot-jdk-jvmargs=-Duser.home=/home/linuxbrew/.cache/Homebrew/java_cache --with-boot-jdk=/tmp/openjdk-20240916-15753-aqeiih/jdk22u-jdk-22.0.2-ga/boot-jdk --with-debug-level=release --with-jvm-variants=server --with-native-debug-symbols=none --with-vendor-bug-url=https://github.com/Homebrew/homebrew-core/issues --with-vendor-name=Homebrew --with-vendor-url=https://github.com/Homebrew/homebrew-core/issues --with-vendor-version-string=Homebrew --with-vendor-vm-bug-url=https://github.com/Homebrew/homebrew-core/issues --with-version-build=0 --without-version-opt --without-version-pre --with-giflib=system --with-harfbuzz=system --with-lcms=system --with-libjpeg=system --with-libpng=system --with-zlib=system --with-x=/home/linuxbrew/.linuxbrew --with-cups=/home/linuxbrew/.linuxbrew --with-fontconfig=/home/linuxbrew/.linuxbrew --with-freetype=system --with-stdc++lib=dynamic --with-extra-ldflags=-Wl,-rpath,\$$ORIGIN -Wl,-rpath,\$$ORIGIN/server -L/home/linuxbrew/.linuxbrew/opt/giflib/lib -L/home/linuxbrew/.linuxbrew/opt/harfbuzz/lib -L/home/linuxbrew/.linuxbrew/opt/jpeg-turbo/lib -L/home/linuxbrew/.linuxbrew/opt/libpng/lib -L/home/linuxbrew/.linuxbrew/opt/little-cms2/lib -L/home/linuxbrew/.linuxbrew/opt/cups/lib -L/home/linuxbrew/.linuxbrew/opt/unzip/lib -L/home/linuxbrew/.linuxbrew/opt/zip/lib -L/home/linuxbrew/.linuxbrew/opt/zlib/lib -L/home/linuxbrew/.linuxbrew/opt/alsa-lib/lib -L/home/linuxbrew/.linuxbrew/opt/fontconfig/lib -L/home/linuxbrew/.linuxbrew/opt/freetype/lib -L/home/linuxbrew/.linuxbrew/opt/libx11/lib -L/home/linuxbrew/.linuxbrew/opt/libxext/lib -L/home/linuxbrew/.linuxbrew/opt/libxi/lib -L/home/linuxbrew/.linuxbrew/opt/libxrandr/lib -L/home/linuxbrew/.linuxbrew/opt/libxrender/lib -L/home/linuxbrew/.linuxbrew/opt/libxt/lib -L/home/linuxbrew/.linuxbrew/opt/libxtst/lib --with-extra-cflags=-I/home/linuxbrew/.linuxbrew/opt/giflib/include -I/home/linuxbrew/.linuxbrew/opt/harfbuzz/include -I/home/linuxbrew/.linuxbrew/opt/jpeg-turbo/include -I/home/linuxbrew/.linuxbrew/opt/libpng/include -I/home/linuxbrew/.linuxbrew/opt/little-cms2/include -I/home/linuxbrew/.linuxbrew/opt/cups/include -I/home/linuxbrew/.linuxbrew/opt/unzip/include -I/home/linuxbrew/.linuxbrew/opt/zip/include -I/home/linuxbrew/.linuxbrew/opt/zlib/include -I/home/linuxbrew/.linuxbrew/opt/alsa-lib/include -I/home/linuxbrew/.linuxbrew/opt/fontconfig/include -I/home/linuxbrew/.linuxbrew/opt/freetype/include -I/home/linuxbrew/.linuxbrew/opt/libx11/include -I/ho
if DevelopmentTools.clang_build_version == 1600
ENV.llvm_clang
ENV.remove "HOMEBREW_LIBRARY_PATHS", Formula["llvm"].opt_lib
end
ENV["CC"] = Formula["llvm@17"].opt_bin/"clang"
ENV["CXX"] = Formula["llvm@17"].opt_bin/"clang++"
carlocab marked this conversation as resolved.
Show resolved Hide resolved

boot_jdk = buildpath/"boot-jdk"
resource("boot-jdk").stage boot_jdk
Expand Down Expand Up @@ -145,8 +130,14 @@
--with-stdc++lib=dynamic
]
end
ldflags += deps.filter_map { |dep| "-L#{dep.to_formula.opt_lib}" unless dep.build? }
args << "--with-extra-ldflags=#{ldflags.join(" ")}"

cflags = deps.filter_map { |dep| "-I#{dep.to_formula.opt_include}" unless dep.build? }
cflags << "-Os"
carlocab marked this conversation as resolved.
Show resolved Hide resolved
args << "--with-extra-cflags=#{cflags.join(" ")}"
args << "--with-extra-cxxflags=#{cflags.join(" ")}"

system "bash", "configure", *args

ENV["MAKEFLAGS"] = "JOBS=#{ENV.make_jobs}"
Expand Down
Loading