Improve macOS executable fallback for Homebrew paths#49721
Open
froggy-hyun wants to merge 2 commits intospring-projects:mainfrom
Open
Improve macOS executable fallback for Homebrew paths#49721froggy-hyun wants to merge 2 commits intospring-projects:mainfrom
froggy-hyun wants to merge 2 commits intospring-projects:mainfrom
Conversation
Add /opt/homebrew/bin as an additional macOS fallback location (alongside /usr/local/bin) when starting external processes. The previous fallback assumed /usr/local/bin only, which can fail on Apple Silicon Homebrew setups in restricted PATH environments (for example IDE or GUI-launched processes). Apply the same fallback behavior to: - docker compose process runner - DisabledIfProcessUnavailable condition - docker credential helper startup Also update CredentialHelperTests to verify both macOS fallback paths are attempted. Signed-off-by: 1233day <1233day@naver.com>
wilkinsona
requested changes
Mar 25, 2026
Comment on lines
+107
to
+110
| private String getCommandName(String command) { | ||
| int lastSlash = command.lastIndexOf('/'); | ||
| return (lastSlash != -1) ? command.substring(lastSlash + 1) : command; | ||
| } |
Member
There was a problem hiding this comment.
This is unrelated to falling back to an additional path. It's also unnecessary as @DisabledIfProcessUnavailable is never used with slashes in the command names as that would likely hurt their portability. Please revert.
Author
There was a problem hiding this comment.
Agreed. I reverted the command-name extraction and kept the change focused on adding the additional macOS fallback path only.
...docker-compose/src/main/java/org/springframework/boot/docker/compose/core/ProcessRunner.java
Outdated
Show resolved
Hide resolved
.../java/org/springframework/boot/buildpack/platform/docker/configuration/CredentialHelper.java
Outdated
Show resolved
Hide resolved
- Remove the helper methods introduced for extracting command/executable names and keep this change focused on adding /opt/homebrew/bin as an additional macOS fallback path Signed-off-by: 1233day <1233day@naver.com>
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.
Summary
Improve macOS process startup fallback by supporting both Homebrew bin locations:
/opt/homebrew/bin(default on Apple Silicon)/usr/local/bin(default on Intel macOS; also common in older or Rosetta-based setups)Problem
Some macOS code paths retried process startup using only
/usr/local/bin.On Apple Silicon systems, executables installed via Homebrew are typically located under
/opt/homebrew/bin, so process startup could fail whenPATHis restricted or does notinclude that location.
Changes
OPT_HOMEBREW_BINas an additional fallback alongside the existingUSR_LOCAL_BIN.core/spring-boot-docker-composeProcessRunnertest-supportDisabledIfProcessUnavailableConditionbuildpackCredentialHelperCredentialHelperTeststo verify that both fallback candidates are attempted.Why this is low risk
/usr/local/binfallback behavior is preserved.Verification
Executed with JDK 25:
:buildpack:spring-boot-buildpack-platform:test --tests org.springframework.boot.buildpack.platform.docker.configuration.CredentialHelperTests:test-support:spring-boot-test-support:test --tests org.springframework.boot.testsupport.process.DisabledIfProcessUnavailableTests:core:spring-boot-docker-compose:test --tests org.springframework.boot.docker.compose.core.ProcessRunnerTests:core:spring-boot-docker-compose:checkstyleMain:test-support:spring-boot-test-support:checkstyleMain:buildpack:spring-boot-buildpack-platform:checkstyleMainAll tests and checks passed.