CMD incompatibility

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
May 20, 2008
420
2
#1
I'm trying to run the vcvarsall.bat from VS2015 update 3 to include the Windows SDK version 10.0.14393.0. Unfortunately, the batch file does not work correctly under TCC. I get this:
Code:
vcvarsall.bat amd64 10.0.14393.0
!ERROR! Windows SDK 10.0.14393.0 : 'C:\Program Files (x86)\Windows Kits\10\inclu
de\10.0.14393.0\um'
This appear to be related to something in
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\vcvarsqueryregistry.bat.
Around line 88, it has this block of code:
Code:
@setlocal enableDelayedExpansion
@if not "%WindowsSdkDir%"=="" @for /f %%i IN ('dir "%WindowsSdkDir%include\" /b /ad-h /on') DO (
    @REM Skip if Windows.h is not found in %%i\um.  This would indicate that only the UCRT MSIs were
    @REM installed for this Windows SDK version.
    @if EXIST "%WindowsSdkDir%include\%%i\um\Windows.h" (
        @set result=%%i
        @if "!result:~0,3!"=="10." (
            @set SDK=!result!
            @if "!result!"=="%user_inputversion%" set findSDK=1
        )
    )
)
Since the DIR command appears to be working, I suspect the issue is something related to the enabledDelayedExpansion parameter to setlocal, but that's as far as I have gotten.

When I run it under CMD, it works just fine.

Code:
TCC  20.11.40 x64   Windows 10 [Version 6.3.14393]
TCC Build 40   Windows 10 Build 14393
 
May 20, 2008
420
2
#4
If you're referring to the environment variable, that is set from the default environment.
Code:
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
 
#5
Ok, seems to be another problem, then. There was also a mention of enabling delayed expansion in TCMD.ini (through the OPTION command) IIRC. That is as far as I can help (no experience with Visual Studio).
 
May 20, 2008
420
2
#6
I think, in this case, there are parameters in the SETLOCAL of CMD that are not supported in TCC. There may be additional things, but that was the most apparent.
 

rconn

Administrator
Staff member
May 14, 2008
10,101
85
#7
I'm trying to run the vcvarsall.bat from VS2015 update 3 to include the Windows SDK version 10.0.14393.0. Unfortunately, the batch file does not work correctly under TCC. I get this:
Code:
vcvarsall.bat amd64 10.0.14393.0
!ERROR! Windows SDK 10.0.14393.0 : 'C:\Program Files (x86)\Windows Kits\10\include\10.0.14393.0\um'
Not reproducible here (and I run VCVARSALL several times a day, every day).

SETLOCAL in TCC does support the "EnableDelayedExpansion" variable (as well as "DisableDelayedExpansion, EnableExtensions, and DisableExtensions). They are not documented in the TCMD help because TCC doesn't need them.

I suspect the issue is more likely in your TCMD.INI.[/QUOTE]
 
May 20, 2008
420
2
#8
This is with a fresh install in a brand new VM. So, no pre-existing cruft hanging around to corrupt the INI. I don't recall changing too much from the INI defaults, insert mode, complete hidden, add \ to directories, and hiding a bunch of stuff in the UI.
 
May 20, 2008
420
2
#9
It's no longer causing the error for me now either. My TCC/TCMD are unchanged. I did install an older SDK version for a project, though that's not the one that is set when I run vsvarsall x64 and let it default the SDK. But, no error. Strange.
 
Jun 5, 2015
12
0
#10
Same issue here. I'm using
TCC LE 14.00.9 x64 Windows 10 [Version 6.3.14393]
TCC LE Build 9 Windows 10 Build 14393

the vcvarsall.bat includes this loop:
for /F "tokens=1,* delims= " %%a in ("%__VCVARSALL_ARGS_LIST%") do (
if "%VSCMD_DEBUG%" GEQ "2" (
@echo [DEBUG:%~nx0] inner argument {%%a}
)
call :parse_argument %%a
set "__VCVARSALL_ARGS_LIST=%%b"
goto :parse_loop
)​

which seems to work fine in CMD but not in TCC.

Testing with a reduced version test.bat, with just the following 4 lines:
set __VCVARSALL_ARGS_LIST=amd64
for /F "tokens=1,* delims= " %%a in ("%__VCVARSALL_ARGS_LIST%") do (
echo %%a
)
this works fine in TCC too and prints "amd64", but this one
set __VCVARSALL_ARGS_LIST=amd64
for /F "tokens=1,* delims= " %%a in ("%__VCVARSALL_ARGS_LIST%") do (
if "%VSCMD_DEBUG%" GEQ "2" (
@echo [DEBUG:%~nx0] inner argument {%%a}
)
echo %%a
)​
doesn't work and prints nothing. So it seems that that "if" inside "for" is causing some issue. Am I missing some ini setting to make it work?

This doesn't seem to be the only issue, however it is possible the cause of the other issues is the same.
 

rconn

Administrator
Staff member
May 14, 2008
10,101
85
#11
but this one
set __VCVARSALL_ARGS_LIST=amd64
for /F "tokens=1,* delims= " %%a in ("%__VCVARSALL_ARGS_LIST%") do (
if "%VSCMD_DEBUG%" GEQ "2" (
@echo [DEBUG:%~nx0] inner argument {%%a}
)
echo %%a
)​
doesn't work and prints nothing. So it seems that that "if" inside "for" is causing some issue. Am I missing some ini setting to make it work?
That snippet works fine in TCC v21 (as does the entire vcvarsall.bat).
 
Jun 5, 2015
12
0
#12
Good, I double checked and with TCC v21 it always works fine (both with my ini file and default options), while with TCC/LE v14 it never works fine (either with my ini file or default options).
So, it seems a TCC/LE v14 bug.