The MSVC team recently test Terminal project failed to Build due to error C2146 and C2063 on windows_x86 and windows_x64 #17059

Closed
opened 2026-01-31 05:31:04 +00:00 by claunia · 17 comments
Owner

Originally created by @rachelhe123 on GitHub (Mar 23, 2022).

Windows Terminal version

No response

Windows build number

VS 2019 + Windows Server 2019

Other Software

Setup
VS 2019 + Windows Server 2019

Steps to reproduce

Below are issue's details on windows_x64, but this issue repro on windows_x86 as well.

  1. git -C "F:\gitP" clone https://github.com/microsoft/terminal microsoft\terminal
  2. cd F:\gitP\microsoft\terminal
  3. git fetch --recurse-submodules=no --force
  4. git reset --hard 53a454f
  5. git remote prune origin
  6. git submodule sync
  7. git submodule update --init --recursive
  8. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
  9. cd F:\gitP\microsoft\terminal
  10. set path=F:\gitP\microsoft\terminal\dep\nuget;%PATH%
  11. nuget restore OpenConsole.sln 2>&1
  12. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64
  13. set CL=/wd4189 /wd5104
  14. msbuild /m /p:Platform=x64 /p:Configuration=Release /p:WindowsTargetPlatformVersion=10.0.19041.0 OpenConsole.sln /t:Restore /t:Rebuild 2>&1

Expected Behavior

Run pass and complier successfully.

Actual Behavior

Error message

F:\gitP\microsoft\terminal\src\host\telemetry.cpp(59,5): error C2146: syntax error: missing ')' before identifier '_tlgEvtTagVal_tlgApplyArgs_UNWRAP'

F:\gitP\microsoft\terminal\src\host\telemetry.cpp(59): error C2062: type 'unknown-type' unexpected

F:\gitP\microsoft\terminal\src\host\telemetry.cpp(59,5): error C2146: syntax error: missing '}' before identifier '_tlgLevelVal_tlgApplyArgs_UNWRAP'

More Info
build.log

Originally created by @rachelhe123 on GitHub (Mar 23, 2022). ### Windows Terminal version _No response_ ### Windows build number VS 2019 + Windows Server 2019 ### Other Software **Setup** VS 2019 + Windows Server 2019 ### Steps to reproduce Below are issue's details on windows_x64, but this issue repro on windows_x86 as well. 1. git -C "F:\gitP" clone https://github.com/microsoft/terminal microsoft\terminal 2. cd F:\gitP\microsoft\terminal 3. git fetch --recurse-submodules=no --force 4. git reset --hard 53a454f 5. git remote prune origin 6. git submodule sync 7. git submodule update --init --recursive 8. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64 9. cd F:\gitP\microsoft\terminal 10. set path=F:\gitP\microsoft\terminal\dep\nuget;%PATH% 11. nuget restore OpenConsole.sln 2>&1 12. set VSCMD_SKIP_SENDTELEMETRY=1 & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -host_arch=amd64 -arch=amd64 13. set _CL_=/wd4189 /wd5104 14. msbuild /m /p:Platform=x64 /p:Configuration=Release /p:WindowsTargetPlatformVersion=10.0.19041.0 OpenConsole.sln /t:Restore /t:Rebuild 2>&1 ### Expected Behavior Run pass and complier successfully. ### Actual Behavior **Error message** F:\gitP\microsoft\terminal\src\host\telemetry.cpp(59,5): error C2146: syntax error: missing ')' before identifier '_tlgEvtTagVal_tlgApplyArgs_UNWRAP' F:\gitP\microsoft\terminal\src\host\telemetry.cpp(59): error C2062: type 'unknown-type' unexpected F:\gitP\microsoft\terminal\src\host\telemetry.cpp(59,5): error C2146: syntax error: missing '}' before identifier '_tlgLevelVal_tlgApplyArgs_UNWRAP' **More Info** [build.log](https://github.com/microsoft/terminal/files/8332103/build.log)
Author
Owner

@zadjii-msft commented on GitHub (Mar 23, 2022):

Hmmm. Those are supposed to be in TraceLoggingActivity.h I think. I wonder why that didn't work.

set path=F:\gitP\microsoft\terminal\dep\nuget;%PATH%

@rachelhe123 are you sure that's not supposed to be:

-set path=F:\gitP\microsoft\terminal\dep\nuget;%PATH%
+set path=F:\microsoft\terminal\dep\nuget;%PATH%

I don't think that'll necessarily help, just looked like a typo

@zadjii-msft commented on GitHub (Mar 23, 2022): Hmmm. Those are supposed to be in `TraceLoggingActivity.h` I think. I wonder why that didn't work. ``` set path=F:\gitP\microsoft\terminal\dep\nuget;%PATH% ``` @rachelhe123 are you sure that's not supposed to be: ```diff -set path=F:\gitP\microsoft\terminal\dep\nuget;%PATH% +set path=F:\microsoft\terminal\dep\nuget;%PATH% ``` I don't think that'll necessarily help, just looked like a typo
Author
Owner

@rachelhe123 commented on GitHub (Mar 24, 2022):

Hi @zadjii-msft , I have update the repro steps again, this issue still exist, and this issue related with "telemetry.cpp" file, please help check it again, thanks~

@rachelhe123 commented on GitHub (Mar 24, 2022): Hi @zadjii-msft , I have update the repro steps again, this issue still exist, and this issue related with **"telemetry.cpp" file**, please help check it again, thanks~
Author
Owner

@zadjii-msft commented on GitHub (Apr 28, 2022):

Welp. Just tried reproing and investigating this myself this morning. Did everything except the git reset --hard 53a454fbd3e2992be5c1f2c8ed9e2c2974f0e7b8 step, and now I'm getting all sorts of

   113>Done Building Project "d:\dev\gh-12741\microsoft\terminal\build\rules\GenerateFeatureFlags.proj" (default targets).
    25>d:\dev\gh-12741\microsoft\terminal\src\common.nugetversions.targets(99,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to downloa
       d them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is d:\dev\gh-12741\microsoft\terminal\src\..\packages\Microsoft.Windows.ImplementationLibrary.1.
       0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets. [d:\dev\gh-12741\microsoft\terminal\src\renderer\vt\lib\vt.vcxproj]
    25>Done Building Project "d:\dev\gh-12741\microsoft\terminal\src\renderer\vt\lib\vt.vcxproj" (Rebuild target(s)) -- FAILED.

errors. Hmm, that nuget package should be in our nuget feed....

@zadjii-msft commented on GitHub (Apr 28, 2022): Welp. Just tried reproing and investigating this myself this morning. Did everything except the `git reset --hard 53a454fbd3e2992be5c1f2c8ed9e2c2974f0e7b8` step, and now I'm getting all sorts of ``` 113>Done Building Project "d:\dev\gh-12741\microsoft\terminal\build\rules\GenerateFeatureFlags.proj" (default targets). 25>d:\dev\gh-12741\microsoft\terminal\src\common.nugetversions.targets(99,5): error : This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to downloa d them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is d:\dev\gh-12741\microsoft\terminal\src\..\packages\Microsoft.Windows.ImplementationLibrary.1. 0.220201.1\build\native\Microsoft.Windows.ImplementationLibrary.targets. [d:\dev\gh-12741\microsoft\terminal\src\renderer\vt\lib\vt.vcxproj] 25>Done Building Project "d:\dev\gh-12741\microsoft\terminal\src\renderer\vt\lib\vt.vcxproj" (Rebuild target(s)) -- FAILED. ``` errors. Hmm, that nuget package should be in our nuget feed....
Author
Owner

@zadjii-msft commented on GitHub (Apr 28, 2022):

We might need to change step 11 to

nuget restore dep\nuget\packages.config

because for some reason, nuget restore OpenConsole.sln isn't smart enough to actually include the packages listed in there...

@dmachaj as an FYI.

@zadjii-msft commented on GitHub (Apr 28, 2022): We might need to change step 11 to ``` nuget restore dep\nuget\packages.config ``` because for some reason, `nuget restore OpenConsole.sln` isn't smart enough to actually include the packages listed in there... @dmachaj as an FYI.
Author
Owner

@zadjii-msft commented on GitHub (Apr 28, 2022):

Oh well that'd do it.

@rachelhe123 can you remove the /p:WindowsTargetPlatformVersion=10.0.19041.0 from line 14/? I believe as of #11728 our WindowsTargetPlatformVersion is 22000

@zadjii-msft commented on GitHub (Apr 28, 2022): Oh well that'd do it. @rachelhe123 can you remove the `/p:WindowsTargetPlatformVersion=10.0.19041.0` from line 14/? I believe as of #11728 our `WindowsTargetPlatformVersion` is 22000
Author
Owner

@ghost commented on GitHub (May 2, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (May 2, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@dmachaj commented on GitHub (May 2, 2022):

We might need to change step 11 to

nuget restore dep\nuget\packages.config

because for some reason, nuget restore OpenConsole.sln isn't smart enough to actually include the packages listed in there...

@dmachaj David Machaj FTE as an FYI.

I think it would be a separate restore of dep/nuget/packages.config in addition to the restore of OpenConsole.sln. It is possible for them to list separate packages.

When the work was done to consolidate nuget versions all known bootstrap scripts, pipelines, msbuild targets, etc. were updated to restore the global packages.config in addition to the solution package list. However, it is possible that places were missed or that any manual replication of init.cmd would need the same type of edit.

@dmachaj commented on GitHub (May 2, 2022): > We might need to change step 11 to > > ``` > nuget restore dep\nuget\packages.config > ``` > > because for some reason, `nuget restore OpenConsole.sln` isn't smart enough to actually include the packages listed in there... > > @dmachaj David Machaj FTE as an FYI. I think it would be a separate restore of dep/nuget/packages.config _in addition_ to the restore of OpenConsole.sln. It is possible for them to list separate packages. When the work was done to consolidate nuget versions all known bootstrap scripts, pipelines, msbuild targets, etc. were updated to restore the global packages.config in addition to the solution package list. However, it is possible that places were missed or that any manual replication of init.cmd would need the same type of edit.
Author
Owner

@rachelhe123 commented on GitHub (May 5, 2022):

Hi @zadjii-msft, I will try your suggestion on my side to verify it, thank you ~

@rachelhe123 commented on GitHub (May 5, 2022): Hi @zadjii-msft, I will try your suggestion on my side to verify it, thank you ~
Author
Owner

@zadjii-msft commented on GitHub (Jun 7, 2022):

@rachelhe123 did that work for you?

@zadjii-msft commented on GitHub (Jun 7, 2022): @rachelhe123 did that work for you?
Author
Owner

@ghost commented on GitHub (Jun 11, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Jun 11, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@rachelhe123 commented on GitHub (Jun 13, 2022):

Hi @zadjii-msft, it works fine on my machine, I will verify it on newest commit. Thank you ~

@rachelhe123 commented on GitHub (Jun 13, 2022): Hi @zadjii-msft, it works fine on my machine, I will verify it on newest commit. Thank you ~
Author
Owner

@Zhaojun-Liu commented on GitHub (Jun 17, 2022):

Hi @zadjii-msft,
I met the same issue. When I add the steps: nuget restore dep\nuget\packages.config and change the last step to be: msbuild /m /p:Platform=x64 /p:Configuration=Release /p:WindowsTargetPlatformVersion=10.0.22000.0 OpenConsole.sln /t:Restore /t:Rebuild 2>&1, it reported error C2039, error C2065, error C3544 and error 2955. You can check the details in the below image and attached log files. Could you help look this issue? Thanks.

The commit I used : 848314e

image

The detailed log :
Terminal_build4.log

@Zhaojun-Liu commented on GitHub (Jun 17, 2022): Hi @zadjii-msft, I met the same issue. When I add the steps: `nuget restore dep\nuget\packages.config` and change the last step to be: `msbuild /m /p:Platform=x64 /p:Configuration=Release /p:WindowsTargetPlatformVersion=10.0.22000.0 OpenConsole.sln /t:Restore /t:Rebuild 2>&1`, it reported error C2039, error C2065, error C3544 and error 2955. You can check the details in the below image and attached log files. Could you help look this issue? Thanks. The commit I used : 848314e ![image](https://user-images.githubusercontent.com/103498042/174266446-6efc1e0c-9d62-43e4-aadd-beca16704948.png) The detailed log : [Terminal_build4.log](https://github.com/microsoft/terminal/files/8926182/Terminal_build4.log)
Author
Owner

@ghost commented on GitHub (Jun 21, 2022):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Jun 21, 2022): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Author
Owner

@zadjii-msft commented on GitHub (Jun 21, 2022):

The more relevant error in that build log, to me, looks like the

    41>F:\gitP\microsoft\terminal\packages\Microsoft.Windows.CppWinRT.2.0.210825.3\build\native\Microsoft.Windows.CppWinRT.targets(137,9): error MSB3061: Unable to delete file "Generated Files\winrt\impl\Windows.System.Diagnostics.2.h". The process cannot access the file 'F:\gitP\microsoft\terminal\src\cascadia\TerminalControl\Generated Files\winrt\impl\Windows.System.Diagnostics.2.h' because it is being used by another process. [F:\gitP\microsoft\terminal\src\cascadia\TerminalControl\TerminalControlLib.vcxproj]``

message. That would seem to indicate that there wasn't a successful clean phase, and the subsequent error might have been caused by referencing the old version of that file. I just ran through the steps on a clean repo, and got a clean build. Were you possibly re-using a directory from a previous build/?

@zadjii-msft commented on GitHub (Jun 21, 2022): The more relevant error in that build log, to me, looks like the ``` 41>F:\gitP\microsoft\terminal\packages\Microsoft.Windows.CppWinRT.2.0.210825.3\build\native\Microsoft.Windows.CppWinRT.targets(137,9): error MSB3061: Unable to delete file "Generated Files\winrt\impl\Windows.System.Diagnostics.2.h". The process cannot access the file 'F:\gitP\microsoft\terminal\src\cascadia\TerminalControl\Generated Files\winrt\impl\Windows.System.Diagnostics.2.h' because it is being used by another process. [F:\gitP\microsoft\terminal\src\cascadia\TerminalControl\TerminalControlLib.vcxproj]`` ``` message. That would seem to indicate that there wasn't a successful _clean_ phase, and the subsequent error might have been caused by referencing the old version of that file. I just ran through the steps on a clean repo, and got a clean build. Were you possibly re-using a directory from a previous build/?
Author
Owner

@Zhaojun-Liu commented on GitHub (Jun 23, 2022):

@zadjii-msft Thanks for your reply. And I tried the build on a clean repo, it built successfully. Thank you.

@Zhaojun-Liu commented on GitHub (Jun 23, 2022): @zadjii-msft Thanks for your reply. And I tried the build on a clean repo, it built successfully. Thank you.
Author
Owner

@zadjii-msft commented on GitHub (Jun 23, 2022):

Great to hear! Is there anything else for us to do here/?

@zadjii-msft commented on GitHub (Jun 23, 2022): Great to hear! Is there anything else for us to do here/?
Author
Owner

@Zhaojun-Liu commented on GitHub (Jun 23, 2022):

I have no questions on my side, thank you very much. If there are any further questions, I will contact you again. Thank you~

@Zhaojun-Liu commented on GitHub (Jun 23, 2022): I have no questions on my side, thank you very much. If there are any further questions, I will contact you again. Thank you~
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17059