[PR #11804] [MERGED] Fix for missing CopyComplete files in TerminalConnection.vcxproj #28737

Open
opened 2026-01-31 09:30:27 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/11804
Author: @zadjii-msft
Created: 11/22/2021
Status: Merged
Merged: 11/23/2021
Merged by: @undefined

Base: mainHead: dev/migrie/eim/copycomplete


📝 Commits (3)

  • 968014b Maximum bodgy. Manually create the copycomplete file for TerminalConnection, because vcpkg never writes it.
  • 23d235e comments too
  • 08a3ceb spe

📊 Changes

1 file changed (+36 additions, -1 deletions)

View changed files

📝 src/cascadia/TerminalConnection/TerminalConnection.vcxproj (+36 -1)

📄 Description

I'm working on making the FastUpToDate check in Vs work for the Terminal project. This is one of a few PRs in this area.

FastUpToDate lets vs check quickly determine that it doesn't need to do anything for a given project.

However, a few of our projects don't produce all the right artifacts, or check too many things, and this eventually causes the wapproj to rebuild, EVERY TIME YOU F5 in VS.

This first PR deals with the .copycomplete file in obj\x64\debug\terminalconnection\. Below are my verbatim notes, which led to the solution in this PR.

Problem 1

  • There were missing .copycomplete files across the repo.

    obj\x64\debug\microsoft.terminal.settings.model.lib\microsoft.terminal.settings.modellib.vcxproj.copycomplete
    obj\x64\debug\microsoft.terminal.settings.model\microsoft.terminal.settings.model.vcxproj.copycomplete
    obj\x64\debug\terminalapplib\terminalapplib.vcxproj.copycomplete
    obj\x64\debug\terminalapp\terminalapp.vcxproj.copycomplete
    obj\x64\debug\terminalconnection\terminalconnection.vcxproj.copycomplete
    
    • just making empty files there seemed good enough.
    • Might be because the CopyLocal target was already there, but the task didn't ever run to create that file? Weird.
  • UPDATE: checking out main, and building again - the .copycompletes are gone. So that's something that can be improved.

  • The only place I could find a reference was in "obj\x64\Debug\TerminalConnection\TerminalConnection.vcxproj.FileListAbsolute.txt", which will get updated if you remove the line from that file (but no one seemingly writes it or mentiones it in the log)

  • Deleting bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll then building the project did copy the file, but it didn't touch the copycomplete. Weird.

  • Why does

    • TerminalConnection think it needs this
    • Microsoft.Terminal.Settings.Model.Lib have one
    • Microsoft.Terminal.Control* NOT have one
  • This file is a @(CopyUpToDateMarker)

  • The target _CopyFilesMarkedCopyLocal touches @(CopyUpToDateMarker), when:

    • "'@(ReferencesCopiedInThisBuild)' != '' and
    • '$(WroteAtLeastOneFile)' == 'true'"
  • In out build output:

6>Target _CopyFilesMarkedCopyLocal:
6>  Using "Copy" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
6>  Task "Copy"
6>    Did not copy from file "C:\Users\migrie\dev\public\terminal\bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll" to file "C:\Users\migrie\dev\public\terminal\bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll" because the "SkipUnchangedFiles" parameter was set to "true" in the project and the files' sizes and timestamps match.
6>  Done executing task "Copy".
6>  Task "Touch" skipped, due to false condition; ('@(ReferencesCopiedInThisBuild)' != '' and '$(WroteAtLeastOneFile)' == 'true') was evaluated as ('C:\Users\migrie\dev\public\terminal\bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll' != '' and 'False' == 'true').
  • So WroteAtLeastOneFile should be true, when it's currently false. That looks like it's set to true when the file does get copied, wheich did't happen because the copy was skipped.
  • WAIT LOOK AT THAT MESSAGE. "Did not copy from file "
    "C:\Users\migrie\dev\public\terminal\bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll" to file
    "C:\Users\migrie\dev\public\terminal\bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll"
    THESE ARE THE SAME FILE.
    @(ReferenceCopyLocalPaths) is filled with the file already?!
  • The Target AppLocalFromInstalled is the only other thing that references cpprest142_2_10d.dll.
  • Even if you delete the cpprest142_2_10d.dll, then _CopyFilesMarkedCopyLocal still evaluates the Touch condition as false, and doesn't touch it.
  • the deployBinary() function in packages\vcpkg-cpprestsdk.2.10.14\scripts\buildsystems\msbuild\applocal.ps1 does the actual job of copying the file. It copies it outside of MsBuild, which prevents MsBuild from copying it, and now MsBuild thinks it shouldn't write the .copycomplete file itself.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/11804 **Author:** [@zadjii-msft](https://github.com/zadjii-msft) **Created:** 11/22/2021 **Status:** ✅ Merged **Merged:** 11/23/2021 **Merged by:** [@undefined](undefined) **Base:** `main` ← **Head:** `dev/migrie/eim/copycomplete` --- ### 📝 Commits (3) - [`968014b`](https://github.com/microsoft/terminal/commit/968014b91e7f1907819dad4590af37567b1ca5c5) Maximum bodgy. Manually create the copycomplete file for TerminalConnection, because vcpkg never writes it. - [`23d235e`](https://github.com/microsoft/terminal/commit/23d235e7921c8c23fa20b564ba354ba20b73f354) comments too - [`08a3ceb`](https://github.com/microsoft/terminal/commit/08a3ceb7cd6e31b090c47dd11caad00416ab65ec) spe ### 📊 Changes **1 file changed** (+36 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalConnection/TerminalConnection.vcxproj` (+36 -1) </details> ### 📄 Description I'm working on making the FastUpToDate check in Vs work for the Terminal project. This is one of a few PRs in this area. FastUpToDate lets vs check quickly determine that it doesn't need to do anything for a given project. However, a few of our projects don't produce all the right artifacts, or check too many things, and this eventually causes the `wapproj` to rebuild, EVERY TIME YOU F5 in VS. This first PR deals with the `.copycomplete` file in `obj\x64\debug\terminalconnection\`. Below are my verbatim notes, which led to the solution in this PR. ### Problem 1 ✅ * There were missing `.copycomplete` files across the repo. ``` obj\x64\debug\microsoft.terminal.settings.model.lib\microsoft.terminal.settings.modellib.vcxproj.copycomplete obj\x64\debug\microsoft.terminal.settings.model\microsoft.terminal.settings.model.vcxproj.copycomplete obj\x64\debug\terminalapplib\terminalapplib.vcxproj.copycomplete obj\x64\debug\terminalapp\terminalapp.vcxproj.copycomplete obj\x64\debug\terminalconnection\terminalconnection.vcxproj.copycomplete ``` - just making empty files there seemed good enough. - Might be because the CopyLocal target was already there, but the task didn't ever run to create that file? Weird. * UPDATE: checking out main, and building again - the `.copycomplete`s are gone. So that's something that can be improved. * The only place I could find a reference was in `"obj\x64\Debug\TerminalConnection\TerminalConnection.vcxproj.FileListAbsolute.txt"`, which will get updated if you remove the line from that file (but no one seemingly writes it or mentiones it in the log) * Deleting `bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll` then building the project did copy the file, but it didn't touch the copycomplete. Weird. * Why does - `TerminalConnection` think it needs this - `Microsoft.Terminal.Settings.Model.Lib` have one - `Microsoft.Terminal.Control*` **NOT** have one * This file is a [`@(CopyUpToDateMarker)`](https://github.com/dotnet/msbuild/blob/main/src/Tasks/Microsoft.Common.CurrentVersion.targets#L392) * The target [`_CopyFilesMarkedCopyLocal`](https://github.com/dotnet/msbuild/blob/main/src/Tasks/Microsoft.Common.CurrentVersion.targets#L4795) touches `@(CopyUpToDateMarker)`, when: - `"'@(ReferencesCopiedInThisBuild)' != ''` and - `'$(WroteAtLeastOneFile)' == 'true'"` * In out build output: ``` 6>Target _CopyFilesMarkedCopyLocal: 6> Using "Copy" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a". 6> Task "Copy" 6> Did not copy from file "C:\Users\migrie\dev\public\terminal\bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll" to file "C:\Users\migrie\dev\public\terminal\bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll" because the "SkipUnchangedFiles" parameter was set to "true" in the project and the files' sizes and timestamps match. 6> Done executing task "Copy". 6> Task "Touch" skipped, due to false condition; ('@(ReferencesCopiedInThisBuild)' != '' and '$(WroteAtLeastOneFile)' == 'true') was evaluated as ('C:\Users\migrie\dev\public\terminal\bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll' != '' and 'False' == 'true'). ``` - So `WroteAtLeastOneFile` should be true, when it's currently false. That _looks_ like it's set to true when the file does get copied, wheich did't happen because the copy was skipped. - WAIT LOOK AT THAT MESSAGE. "Did not copy from file " `"C:\Users\migrie\dev\public\terminal\bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll"` to file `"C:\Users\migrie\dev\public\terminal\bin\x64\Debug\TerminalConnection\cpprest142_2_10d.dll"` THESE ARE THE SAME FILE. `@(ReferenceCopyLocalPaths)` is filled with the file already?! - The Target `AppLocalFromInstalled` is the only other thing that references `cpprest142_2_10d.dll`. - Even if you delete the `cpprest142_2_10d.dll`, then `_CopyFilesMarkedCopyLocal` still evaluates the Touch condition as false, and doesn't touch it. - the `deployBinary()` function in `packages\vcpkg-cpprestsdk.2.10.14\scripts\buildsystems\msbuild\applocal.ps1` does the actual job of copying the file. It copies it outside of MsBuild, which prevents MsBuild from copying it, and now MsBuild thinks it shouldn't write the `.copycomplete` file itself. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:30:27 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28737