Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

CMD incompatibility

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
 
Is this issue different from the ones reported earlier on these forums ( [title] ) where the solution was to set some environment variable first?
 
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\
 
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).
 
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.
 
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]
 
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.
 
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.
 
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.
 
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).
 
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.
 
You can comment out the if and it will work I guess the echo will expand things correctly
@REM TCC LE expansion different MJC
@REM if "%VSCMD_DEBUG%" GEQ "2" (
@echo [DEBUG:%~nx0] inner argument {%%a}
@REM )
call :parse_argument %%a
 

Similar threads

Replies
0
Views
1K
Back
Top