RFR: 8372943: Restore --with-tools-dir

Aleksey Shipilev shade at openjdk.org
Wed Dec 3 09:02:45 UTC 2025


On Tue, 2 Dec 2025 22:07:05 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> In [JDK-8344030](https://bugs.openjdk.org/browse/JDK-8344030) the configure option --with-tools-dir was deprecated. There are however still references to it in the configure script. Specifically toolchain_microsoft is still using the variable it was setting up, and there are error messages telling the user to try using it.
> 
> Digging further into this, the way we use `--with-tools-dir` to find Visual Studio is quite convoluted. It used to be that you would point to something like ".../Community/VC/bin" or ".../Community/VC/bin/amd64", which would make sense as those were directories with the compiler executables. Configure would then walk up two or three levels to find the root of the Visual Studio installation. Modern Visual Studio installations have a much deeper and more complex directory structure, so this doesn't work as it used to. However, because the configure logic just checks two and three levels above the directory given to `--with-tools-dir`, you can actually supply any existing directory inside the installation at the appropriate depth, e.g. ".../Community/VC/Auxiliary/Build".
> 
> This really isn't a great situation and the proper fix would be some kind of overhaul, probably a new explicit configure parameter pointing to the Visual Studio root to use. However, I don't have the time to invest in such a big rewrite at this time, so I will limit this bug to just restoring --with-tools-dir for it's current functionality on Windows, with a help text that describes what it currently does. This will at least let users currently relying on this option to continue building with Visual Studio in a nonstandard location.

Marked as reviewed by shade (Reviewer).

-------------

PR Review: https://git.openjdk.org/jdk/pull/28618#pullrequestreview-3533907970


More information about the build-dev mailing list