On Tue, 8 Apr 2025 19:50:43 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:
> This bug report was triggered by the discussion in > https://github.com/openjdk/jdk/pull/21999. > > In TOOLCHAIN_PRE_DETECTION, we prepend $TOOLCHAIN_PATH to the actual PATH, > and then restore this in TOOLCHAIN_POST_DETECTION. This is likely a remnant > of older times, before we started using our own UTIL_LOOKUP* functions. > > Instead, we should update UTIL_LOOKUP_TOOLCHAIN_PROGS to use > $TOOLCHAIN_PATH:$PATH as 3rd variable to UTIL_LOOKUP_PROGS (if it is not > given). > > The risk we need to be aware of is if some tool we're running assume that the > TOOLCHAIN_PATH is properly included on the PATH, e.g. because it tries to > execute a helper command in turn. This could specifically be a problem for > Visual Studio, and we need to double-check that removing TOOLCHAIN_PATH from > the PATH does not break anything. (In fact, I believe we already append > TOOLCHAIN_PATH to the PATH specifically for Windows already, so this could > very well be done twice...) > > With these changes in place, the hack introduced by > [JDK-8343883](https://bugs.openjdk.org/browse/JDK-8343883) can be changed to > a simple call to UTIL_LOOKUP_TOOLCHAIN_PROGS. This pull request has now been integrated. Changeset: 33244c82 Author: Magnus Ihse Bursie <i...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/33244c82445994131a9168451275216916ce635c Stats: 69 lines in 6 files changed: 6 ins; 51 del; 12 mod 8344030: Improved handling of TOOLCHAIN_PATH Reviewed-by: erikj ------------- PR: https://git.openjdk.org/jdk/pull/24525