Skip to content

refactor(internal/librarian/java): resolve tool paths using central cache - #6331

Merged
JoeWang1127 merged 16 commits into
mainfrom
chore/java-bin-2
Jun 8, 2026
Merged

JoeWang1127 merged 16 commits into
mainfrom
chore/java-bin-2

Conversation

@JoeWang1127

@JoeWang1127 JoeWang1127 commented Jun 7, 2026 •

Copy link
Copy Markdown
Contributor

The Java tools installer and command runners are refactored to use the central cache directory resolved via the cache package instead of a hardcoded location under the user home directory.

The command runner helper inside the command package is also updated to properly merge the PATH environment variable for child processes, ensuring that wrappers which depend on system utilities (like java) function correctly when executed.

For #5850

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the Java tools installer to resolve the installation directory using the central cache package instead of the LIBRARIAN_INSTALL_DIR environment variable. The review feedback recommends placing the executable wrappers directly in the central bin directory (cache.BinDirectory()) rather than nesting them under a subdirectory, which simplifies the user's PATH configuration. Consequently, the helper function getInstallDir() can be removed, and the corresponding tests should be updated to verify the wrappers in the root of the temporary bin directory.

Comment thread internal/librarian/java/install.go Resolved
Comment thread internal/librarian/java/install.go Resolved
Comment thread internal/librarian/java/install_test.go Resolved
@JoeWang1127 JoeWang1127 changed the title chore(internal/librarian/java): use central bin directory for installation refactor(internal/librarian/java): resolve tool paths using central cache Jun 7, 2026
@JoeWang1127
JoeWang1127 marked this pull request as ready for review June 7, 2026 19:09
@JoeWang1127
JoeWang1127 requested a review from a team as a code owner June 7, 2026 19:09
@JoeWang1127
JoeWang1127 requested a review from suztomo June 7, 2026 19:10
@JoeWang1127
JoeWang1127 merged commit d123ec9 into main Jun 8, 2026
52 of 53 checks passed
@JoeWang1127
JoeWang1127 deleted the chore/java-bin-2 branch June 8, 2026 17:21
zhumin8 added a commit that referenced this pull request Jun 10, 2026
…ob (#6372)

Updates the integration job in the Java workflow to use the centralized
cache path ($HOME/.cache/librarian/bin/java_tools/bin) when updating
GITHUB_PATH.

Following #6331, this path
should be updated same as the test job.
haphungw pushed a commit to haphungw/librarian that referenced this pull request Jun 26, 2026
…ache (googleapis#6331)

The Java tools installer and command runners are refactored to use the
central cache directory resolved via the cache package instead of a
hardcoded location under the user home directory.

The command runner helper inside the command package is also updated to
properly merge the `PATH` environment variable for child processes,
ensuring that wrappers which depend on system utilities (like `java`)
function correctly when executed.

For googleapis#5850
haphungw pushed a commit to haphungw/librarian that referenced this pull request Jun 26, 2026
…ob (googleapis#6372)

Updates the integration job in the Java workflow to use the centralized
cache path ($HOME/.cache/librarian/bin/java_tools/bin) when updating
GITHUB_PATH.

Following googleapis#6331, this path
should be updated same as the test job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants