VS install found through --with-tools-dir value is discarded

Erik Joelsson erik.joelsson at oracle.com
Thu Oct 10 17:52:06 UTC 2019


Hello Jorn,

On 2019-10-09 07:00, Jorn Vernee wrote:
> Hi,
>
> I was testing with different versions of Visual Studio to try and nail 
> down the source of a deprecation warning. I was using the 
> --with-tools-dir config option to quickly switch between installations 
> but noticed the VS install that was being found through that method 
> was being discarded, leading to a failed configuration.
>
> The fix is pretty simple: 
> http://cr.openjdk.java.net/~jvernee/vs_tools_dir/webrev.00/
>
> The TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT macro sets the 
> VS_ENV_CMD  var, and skips doing anything when it is already set. So, 
> previously, by setting it to an empty string _after_ the check for 
> --with-tools-dir any VS install that's found with that method is 
> always discarded, or otherwise overwritten when another method for 
> finding a VS installation also works.
>
Looks good, thanks for fixing it!
> With that fix selecting the VS installation works as expected.
>
> On a side note; I noticed that the hostx86 toolchain is preferred over 
> the hostx64 version in VS 2017+, due to the order of values in 
> VCVARSFILES in TOOLCHAIN_CHECK_POSSIBLE_VISUAL_STUDIO_ROOT. Is there 
> any particular reason for this? I'd expect the x64 toolchain would be 
> preferred on x64 platforms.
>
Hm, I think I agree. I'm probably responsible for that choice and I 
think I was just trying to be conservative with changes. Would you mind 
changing it and see if it has any effect on performance?

/Erik

> Jorn
>



More information about the build-dev mailing list