Skip to content

Commit

Permalink
openjdk: test build with llvm@17
Browse files Browse the repository at this point in the history
Let's test whether this builds with `llvm@17` to help track down the
build failure with Apple Clang 16.
  • Loading branch information
carlocab committed Sep 16, 2024
1 parent 4789368 commit ee53c6e
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions Formula/o/openjdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Openjdk < Formula
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 @@ class Openjdk < Formula
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 @@ -92,10 +79,8 @@ class Openjdk < Formula
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-15861-l3a3ea /usr/bin/env cp -pR /tmp/homebrew-unpack20240916-15861-l3a3ea/jdk22u-jdk-22.0.2-ga/. /tmp/openjdk-20240916-15861-kkert8/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-15861-5ep7og /usr/bin/env cp -pR /tmp/homebrew-unpack20240916-15861-5ep7og/jdk-22.0.1/. /tmp/openjdk--boot-jdk-20240916-15861-4sh8pf/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-15861-kkert8/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++"

boot_jdk = buildpath/"boot-jdk"
resource("boot-jdk").stage boot_jdk
Expand Down Expand Up @@ -145,8 +130,13 @@ def install
--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? }
args << "--with-extra-cflags=#{cflags.join(" ")}"
args << "--with-extra-cxxflags=#{cflags.join(" ")}"

system "bash", "configure", *args

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

0 comments on commit ee53c6e

Please sign in to comment.