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@8 1.8.0-432 #194719

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

calvinit
Copy link
Contributor

@calvinit calvinit commented Oct 17, 2024

  • Have you followed the guidelines for contributing?
  • Have you ensured that your commits follow the commit style guide?
  • Have you checked that there aren't other open pull requests for the same formula update/change?
  • Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)? If this is a new formula, does it pass brew audit --new <formula>?

@github-actions github-actions bot added legacy Relates to a versioned @ formula no ARM bottle Formula has no ARM bottle labels Oct 17, 2024
@calvinit calvinit mentioned this pull request Oct 17, 2024
6 tasks
@chenrui333 chenrui333 added CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. CI-no-fail-fast-deps Continue dependent tests despite failing GitHub Actions matrix tests. and removed CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. labels Oct 17, 2024
@calvinit
Copy link
Contributor Author

calvinit commented Oct 18, 2024

Why is the openjdk version used to test embulk here openjdk@21 instead of openjdk@8? Did the following check fail to work correctly?

on_arm do
  depends_on "openjdk@21"
end
on_intel do
  depends_on "openjdk@8"
end

I printed the content of the embulk script at bin/embulk on my Intel Mac, and it is as follows:

#!/bin/bash
export JAVA_HOME="${JAVA_HOME:-/usr/local/opt/openjdk@8/libexec/openjdk.jdk/Contents/Home}"
exec "${JAVA_HOME}/bin/java"  -jar "/usr/local/Cellar/embulk/0.11.5/libexec/embulk-0.11.5.jar" "$@"

It seems that the JAVA_HOME environment variable already has a value (which is /usr/local/opt/openjdk@21/libexec/openjdk.jdk/Contents/Home), so the subsequent openjdk@8 environment variable value is not being applied. Alternatively, the value of java_version might actually be 21 (java_version = Hardware::CPU.intel? ? "1.8" : "21"). Could this be a bug in the test-bot or brew? Because when testing embulk individually, there is no problem, but here, when it is tested as a dependency of openjdk@8 1.8.0-432, the problem arises.

P.S. def install of embulk.rb:

def install
  java_version = Hardware::CPU.intel? ? "1.8" : "21"
  libexec.install "embulk-#{version}.jar"
  bin.write_jar_script libexec/"embulk-#{version}.jar", "embulk", java_version:
end

@calvinit
Copy link
Contributor Author

Help wanted! @cho-m
Why is the embulk test section unable to correctly retrieve the value of the JAVA_HOME environment variable?
#191470

@chenrui333 chenrui333 added the test failure CI fails while running the test-do block label Oct 21, 2024
@github-actions github-actions bot added the automerge-skip `brew pr-automerge` will skip this pull request label Oct 23, 2024
@github-actions github-actions bot removed the automerge-skip `brew pr-automerge` will skip this pull request label Oct 23, 2024
@github-actions github-actions bot added automerge-skip `brew pr-automerge` will skip this pull request and removed automerge-skip `brew pr-automerge` will skip this pull request labels Oct 24, 2024
@calvinit calvinit force-pushed the openjdk@8_1.8.0-432 branch 6 times, most recently from 79c16e8 to bd657e1 Compare October 25, 2024 11:46
@github-actions github-actions bot added the autosquash Automatically squash pull request commits according to Homebrew style. label Oct 25, 2024
@github-actions github-actions bot removed the autosquash Automatically squash pull request commits according to Homebrew style. label Oct 25, 2024
@calvinit calvinit force-pushed the openjdk@8_1.8.0-432 branch 3 times, most recently from 14edc3f to e34a3cd Compare October 25, 2024 12:41
@chenrui333 chenrui333 added the CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. label Oct 25, 2024
@github-actions github-actions bot added the autosquash Automatically squash pull request commits according to Homebrew style. label Oct 29, 2024
@github-actions github-actions bot removed the autosquash Automatically squash pull request commits according to Homebrew style. label Oct 29, 2024
@calvinit calvinit force-pushed the openjdk@8_1.8.0-432 branch 4 times, most recently from cd7e267 to 88bbd2a Compare October 30, 2024 05:14
@carlocab
Copy link
Member

Ping @Homebrew/core -- @calvinit could use some help here. (I'll try to look myself later today.)

@calvinit calvinit force-pushed the openjdk@8_1.8.0-432 branch 4 times, most recently from d57916e to 05169e1 Compare October 30, 2024 09:51
@calvinit
Copy link
Contributor Author

Ping @Homebrew/core -- @calvinit could use some help here. (I'll try to look myself later today.)

Thank you, it would be the best.

I'll talk about the latest progress now: with the latest PR commit now, the build-from-source compilation on my macOS 15 Intel laptop is successful, but now the macOS 14 CI PR check is a bit problematic (in fact, it was okay before, but it didn't work after retrying because of the test embulk problem, and it feels like it may be related to upgrading Xcode).

The other one is the test embulk issue mentioned above, JAVA_HOME the wrong choice of openjdk@21 causes the problem (on the x86_64 architecture, it should choose openjdk@8, which is the Formula of this PR).

BTW: it looks like JNF is no longer a hindrance to compiling openjdk@8 on macOS 14+, is it possible to add CI check for macOS 15 x86_64 architecture as well as a dedicated bottle?

@calvinit calvinit force-pushed the openjdk@8_1.8.0-432 branch 2 times, most recently from d4705ea to 724e806 Compare October 31, 2024 03:27
Comment on lines 139 to 148
# Pre-build JNF (JavaNativeFoundation.framework) in macOS Sonoma or newer
# to fix the issue of its necessary headers not being found.
if MacOS.version >= :sonoma
ENV["SDKPATH"] = ENV["SDKROOT"] = MacOS::CLT.sdk_path(MacOS.version)
resource("JavaNativeFoundation").stage do
cd "apple/JavaNativeFoundation" do
xcodebuild "-arch", Hardware::CPU.arch,
"OTHER_CFLAGS=-Wno-strict-prototypes",
"-project", "JavaNativeFoundation.xcodeproj"
my_jnf_path = buildpath/"build/Frameworks"
my_jnf_path.install "build/Release/JavaNativeFoundation.framework"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the tbd file is still there in the SDK and it's just the headers that are missing - have you tried just -isystem the headers directory here rather than building the whole framework?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven’t tried it yet. It sounds like a feasible approach, but I first need to find a source that can be downloaded to these headers.

Comment on lines +137 to +138
DevelopmentTools.clang_build_version == 1600 &&
ENV.append_to_cflags("-mllvm -enable-constraint-elimination=0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DevelopmentTools.clang_build_version == 1600 &&
ENV.append_to_cflags("-mllvm -enable-constraint-elimination=0")
if DevelopmentTools.clang_build_version == 1600
ENV.append_to_cflags("-mllvm -enable-constraint-elimination=0")
end

Could we change this please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@carlocab Hi, I have tried both 2 all, but CI / tap_syntax (pull_request) check cannot pass.

@github-actions github-actions bot added the autosquash Automatically squash pull request commits according to Homebrew style. label Oct 31, 2024
@github-actions github-actions bot removed the autosquash Automatically squash pull request commits according to Homebrew style. label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-no-fail-fast Continue CI tests despite failing GitHub Actions matrix builds. CI-no-fail-fast-deps Continue dependent tests despite failing GitHub Actions matrix tests. legacy Relates to a versioned @ formula no ARM bottle Formula has no ARM bottle test failure CI fails while running the test-do block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants