On Thu, 13 May 2021 19:11:26 GMT, John Neffenger <jgn...@openjdk.org> wrote:

>> John Neffenger has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Skip sending telemetry to fix "file in use" error
>
> I wrote a Bash shell script, included below, that can help in reviewing this 
> pull request. It isolates the call to `vcvarsall.bat`, making it easier to 
> experiment with different choices, such as:
> 
> - leaving `VSCMD_SKIP_SENDTELEMETRY` undefined,
> - adding the `/q` option to `cmd`,
> - removing `2>&1` to use the default standard error, or
> - discarding standard output with `> /dev/null`.
> 
> 
> #!/bin/bash
> # Tests the Visual Studio 'vcvarsall.bat' batch file
> trap exit INT TERM
> set -o errexit
> 
> # Path to 'vcvarsall.bat' batch file
> vsroot="C:\\Program Files (x86)\\Microsoft Visual Studio"
> vcfile="2019\\Community\\VC\\Auxiliary\\Build\\vcvarsall.bat"
> vcpath="$vsroot\$vcfile"
> 
> # Windows command interpreter and options
> #   /C  Carries out the command specified by string and then terminates
> #   /Q  Turns echo off
> command="cmd /c"
> 
> # Skips calling PowerShell script to send telemetry
> export VSCMD_SKIP_SENDTELEMETRY="1"
> printf "VSCMD_SKIP_SENDTELEMETRY="%s"\n" "$VSCMD_SKIP_SENDTELEMETRY"
> 
> # VSCMD_DEBUG undefined
> unset VSCMD_DEBUG
> printf "Testing VSCMD_DEBUG="%s"\n" "$VSCMD_DEBUG"
> $command "$vcpath" x86 > 0-debug.log 2>&1
> $command "$vcpath" x64 >> 0-debug.log 2>&1
> 
> # VSCMD_DEBUG = 1 (basic), 2 (detailed), and 3 (trace)
> for n in 1 2 3; do
>     export VSCMD_DEBUG="$n"
>     printf "Testing VSCMD_DEBUG="%s"\n" "$VSCMD_DEBUG"
>     $command "$vcpath" x86 > $n-debug.log 2>&1
>     $command "$vcpath" x64 >> $n-debug.log 2>&1
> done
> 
> 
> I run the script under Cygwin on Windows and evaluate its output as follows:
> 
> 
> $ ./vcvarstest.sh
> VSCMD_SKIP_SENDTELEMETRY="1"
> Testing VSCMD_DEBUG=""
> Testing VSCMD_DEBUG="1"
> Testing VSCMD_DEBUG="2"
> Testing VSCMD_DEBUG="3"
> $ wc -l *.log
>     10 0-debug.log
>     92 1-debug.log
>    508 2-debug.log
>   5690 3-debug.log
>   6300 total

@jgneff, do you have an idea of what kind of errors would be better detected 
with these changes? For instance, I've changed the `PATH` environment variable 
so that it no longer includes `/cygdrive/c/Windows/System32`. When running 
`./gradlew help` it fails as expected with the known message:

    > FAIL: WINSDK_DIR not defined

However, while inspecting the `build/vcvarsall.log` file to look for clues, it 
didn't reveal anything interesting to point me to the possible cause of the 
gradle failure. From the looks of it, it even seems to have been successfully 
executed.

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

PR: https://git.openjdk.java.net/jfx/pull/488

Reply via email to