terminal/src/cascadia/TerminalConnection
Mike Griese ea456cf121
Fix for missing CopyComplete files in TerminalConnection.vcxproj (#11804)
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.
2021-11-23 11:51:45 +00:00
..
Resources/en-US Change exit code to hex; Fix format spec (#11123) 2021-09-21 15:47:17 +00:00
AzureClient.h
AzureClientID.h
AzureConnection.cpp Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
AzureConnection.h Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
AzureConnection.idl Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
ConnectionInformation.cpp Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
ConnectionInformation.h Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
ConnectionInformation.idl Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
ConnectionStateHolder.h
ConptyConnection.cpp Make sure to format the error message with an UNSIGNED int (#11667) 2021-11-03 22:27:41 +00:00
ConptyConnection.h Implement basic profile matching (#11390) 2021-10-08 00:40:10 +00:00
ConptyConnection.idl Implement basic profile matching (#11390) 2021-10-08 00:40:10 +00:00
CTerminalHandoff.cpp Add logging for default terminal (#11458) 2021-10-12 15:56:17 +00:00
CTerminalHandoff.h [DefApp] Move from Monarch multi instance servers to Peasant single instance servers (#10823) 2021-08-05 17:05:21 +00:00
EchoConnection.cpp From orbit, nuke the Telnet connection and all supporting infra. (#7840) 2020-10-09 18:59:58 +00:00
EchoConnection.h Switch Connections to use ValueSets to initialize them (#10184) 2021-07-20 15:02:17 +00:00
EchoConnection.idl
init.cpp Hook up the WIL fallback error tracer in Terminal (#7864) 2020-10-09 22:20:12 +00:00
ITerminalConnection.idl Implement basic profile matching (#11390) 2021-10-08 00:40:10 +00:00
packages.config Upgrade to C++/WinRT 2.0.210825.3 (#11188) 2021-09-10 21:33:13 +00:00
pch.cpp
pch.h Exclude more rarely-used stuff from Windows headers (#8513) 2020-12-11 19:35:23 +00:00
TerminalConnection.def
TerminalConnection.vcxproj Fix for missing CopyComplete files in TerminalConnection.vcxproj (#11804) 2021-11-23 11:51:45 +00:00
TerminalConnection.vcxproj.filters Change exit code to hex; Fix format spec (#11123) 2021-09-21 15:47:17 +00:00