Repository navigation
Conversation
Use ":=" so the shell commands run once, not on every expansion.
|
Warning Review limit reached
This review includes 7 billable files and costs up to $1.75. Or wait 34 minutes for your next included review. View limit details
Comment |
Check that javac is on the PATH even when JAVA_HOME is set, report a failure of /usr/libexec/java_home, warn when JAVA_HOME disagrees with the javac on the PATH, compute JAVA_HOME with Make built-ins, and export it. Include the fragment once in tests/Makefile.common, relative to that file rather than DAIKONDIR, and after the Makefile.user includes. Co-Authored-By: Claude <noreply@anthropic.com>
On macOS, use /usr/libexec/java_home only when the javac on the PATH is the /usr/bin/javac stub; otherwise derive JAVA_HOME from the javac on the PATH. Check that the derived JAVA_HOME contains bin/javac. Make a mismatch between JAVA_HOME and the javac on the PATH an error. Do not export JAVA_HOME. Simplify DAIKONDIR in tests/Makefile.common, and let Makefile.common add JUNIT_CLASSPATH to JAVAC rather than redefining JAVAC in Makefile.user files.
- daikon.bashrc uses the same PATH-first JAVA_HOME logic as java-home.mak. - java-home.mak recognizes a JDK by its release file, so a javac wrapper is neither used to infer JAVA_HOME nor checked against it. - java-home.mak reports a nonexistent JAVA_HOME and paths with whitespace. - The staging target sets JAVA_HOME only if /usr/lib/jvm/java-11 exists. - JUnit tests use JUNIT_CLASSPATH even if JAVAC is set in the environment. - tests/Makefile.common includes java-home.mak via DAIKONDIR.
mernst
added a commit
to mernst/daikon
that referenced
this pull request
Oct 11, 2026
java/Makefile and tests/Makefile.common include java/java-home.mk, which asks the JVM that runs javac for its home directory, so that a javac wrapper script (as used by jenv, asdf, or mise) works. If the user set JAVA_HOME, it warns when the javac on the PATH is in a different JDK. scripts/daikon.bashrc uses the same logic. In the tests, the Java version check uses the JDK in JAVA_HOME and is skipped when there is no JDK, so that targets such as "clean" work without one. JAVALIB_CLASSPATH contains only jar files that exist. This incorporates the changes of codespecs#896.
Member
Author
|
Closing in favor of #897, which now incorporates this pull request's changes: one shared JAVA_HOME detection fragment ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The JAVA_HOME detection block was copied into java/Makefile, tests/Makefile.common, and both junit Makefile.user files. This moves it to scripts/java-home.mak, which each of those files includes. It also uses ":=" (inside
ifndef JAVA_HOME) so that the shell commands run once rather than on every expansion of JAVA_HOME.This conflicts with #892 in the deleted lines; resolve by keeping the deletion.