Skip to content

textidote: install (and then test/run) supports openjdk 24 #221845

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

Merged
merged 2 commits into from
May 1, 2025

Conversation

calvinit
Copy link
Contributor

  • 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>?

It appears that #221584 doesn’t fully cover openjdk 24 support in this formula. Specifically, bin.write_jar_script does not pass through JAVA_OPTS from the environment to the wrapper script textidote - it only respects JAVA_HOME.

The relevant implementation is shown below:

# Copied from Homebrew/brew@master
# Library/Homebrew/extend/pathname.rb#L428-L435
def write_jar_script(target_jar, script_name, java_opts = "", java_version: nil)
  mkpath
  (self/script_name).write <<~EOS
    #!/bin/bash
    export JAVA_HOME="#{Language::Java.overridable_java_home_env(java_version)[:JAVA_HOME]}"
    exec "${JAVA_HOME}/bin/java" #{java_opts} -jar "#{target_jar}" "$@"
  EOS
end

This behavior means that even if users set JAVA_OPTS globally, the JVM options won’t be picked up when launching textidote. As a workaround, we can follow the pattern in #221709 by explicitly adding the necessary JVM options to the final exec call within the generated wrapper script.

Additionally, to avoid errors like JAXP00010004 caused by changes in openjdk 24 (where jdk.xml.totalEntitySizeLimit was set to 100,000), adding the JVM option to override the default size limit may be necessary.

To provide better flexibility and avoid similar issues in the future, I believe that bin.write_jar_script should include logic similar to bin.env_script_all_files, which reads the JAVA_OPTS environment variable. This would allow users to have more control over their JVM options, helping them manage such configurations based on their specific needs.

@github-actions github-actions bot added the java Java use is a significant feature of the PR or issue label Apr 29, 2025
@calvinit calvinit force-pushed the textidote-support-openjdk24 branch from 255a92e to 7c00787 Compare April 30, 2025 02:23
@calvinit calvinit force-pushed the textidote-support-openjdk24 branch from 7c00787 to 92c0a35 Compare April 30, 2025 09:42
@calvinit calvinit requested a review from SMillerDev April 30, 2025 10:01
Copy link
Contributor

github-actions bot commented May 1, 2025

🤖 An automated task has requested bottles to be published to this PR.

Please do not push to this PR branch before the bottle commits have been pushed, as this results in a state that is difficult to recover from. If you need to resolve a merge conflict, please use a merge commit. Do not force-push to this PR branch.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label May 1, 2025
@BrewTestBot BrewTestBot enabled auto-merge May 1, 2025 10:05
@BrewTestBot BrewTestBot added this pull request to the merge queue May 1, 2025
Merged via the queue into Homebrew:master with commit b68855c May 1, 2025
14 checks passed
@calvinit calvinit deleted the textidote-support-openjdk24 branch May 3, 2025 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. java Java use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants