On Fri, 7 May 2021 13:42:49 GMT, Kevin Rushforth <[email protected]> wrote:
> It would be more convenient to ask the developer set `VSCMD_DEBUG` via an env
> variable, rather than asking them to edit `win.gradle`.
Thanks, Kevin. That is the most direct approach. I didn't document it that way
for the following reasons:
1. Using the `export` command under Cygwin sets the variable for the *entire*
build. In the current commit, the variable, when defined, is set only for the
duration of the `genVSproperties.bat` batch file and the batch files it calls.
2. I would like to see this documented in the code, even if just as comments,
as opposed to the Wiki. When I got the error, the first thing I did was search
through the code base for `WINSDK_DIR`. I would have found the lines added by
this pull request right away.
Don't let the name confused you. The variable is not a debugging variable; it
doesn't enable debug trace logging. What it actually does is prevent the batch
files from sending both standard output and standard error to "NUL", which they
do by default. Defining it with `VSCMD_DEBUG=3` really means, "Please don't
silently discard really important error messages!" You don't expect all error
messages to be hidden from you when you invoke 3,985 Windows batch file
statements, but that's exactly what's happening now:
$ cloc trace.bat
1 text file.
1 unique file.
0 files ignored.
github.com/AlDanial/cloc v 1.82 T=0.01 s (73.6 files/s, 438775.4 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
DOS Batch 1 1938 40 3985
-------------------------------------------------------------------------------
I'll up the ante and suggest that we set the value to "3" by default in the
build file (and disable telemetry). Then the batch files will behave as one
would expect. I tested all values of the variable (undefined, valid, and
invalid), and the generated file `windows_tools.properties` was identical in
all cases.
Otherwise, where do you suggest we document this? If you disfavor the current
options ("" and "3"), what do you think of making it three comment lines in the
`win.gradle` file?
-------------
PR: https://git.openjdk.java.net/jfx/pull/488