terminal/src/cascadia
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
..
CascadiaPackage Fixes the wapproj fast-up-to-date check (#11806) 2021-11-23 11:22:56 +00:00
inc Only access ControlInteractivity through the projection (#10051) 2021-07-19 11:59:30 -05:00
LocalTests_SettingsModel Standardize the color table order (#11602) 2021-11-04 22:13:22 +00:00
LocalTests_TerminalApp Upgrade to Windows SDK 22000 (#11728) 2021-11-18 18:08:26 +00:00
PublicTerminalCore Introduce AtlasEngine - A new text rendering prototype (#11623) 2021-11-13 00:10:06 +00:00
Remoting Persist window layout cont. save multiple windows (#11083) 2021-09-27 21:18:39 +00:00
ShellExtension Properly escape constructed wt command-lines (#11314) 2021-09-24 16:17:16 +00:00
TerminalApp Add a file for storing elevated-only state (#11222) 2021-11-13 01:58:43 +01:00
TerminalAzBridge Fixes the wapproj fast-up-to-date check (#11806) 2021-11-23 11:22:56 +00:00
TerminalConnection Fix for missing CopyComplete files in TerminalConnection.vcxproj (#11804) 2021-11-23 11:51:45 +00:00
TerminalControl Introduce AtlasEngine - A new text rendering prototype (#11623) 2021-11-13 00:10:06 +00:00
TerminalCore Disable the acceptance of C1 control codes by default (#11690) 2021-11-17 23:40:31 +00:00
TerminalSettingsEditor Use nearby fonts for font fallback (#11764) 2021-11-16 23:22:02 +00:00
TerminalSettingsModel Add a file for storing elevated-only state (#11222) 2021-11-13 01:58:43 +01:00
UnitTests_Control Introduce AtlasEngine - A new text rendering prototype (#11623) 2021-11-13 00:10:06 +00:00
UnitTests_Remoting Persist window layout cont. save multiple windows (#11083) 2021-09-27 21:18:39 +00:00
UnitTests_TerminalCore Disable the acceptance of C1 control codes by default (#11690) 2021-11-17 23:40:31 +00:00
ut_app Upgrade to Windows SDK 22000 (#11728) 2021-11-18 18:08:26 +00:00
WindowsTerminal Fixes the wapproj fast-up-to-date check (#11806) 2021-11-23 11:22:56 +00:00
WindowsTerminal_UIATests Enable /Zc:preprocessor (#10593) 2021-07-13 23:00:11 +00:00
WindowsTerminalUniversal Upgrade to Windows SDK 22000 (#11728) 2021-11-18 18:08:26 +00:00
WinRTUtils Replace the UWP file export with the shell32 one (#11365) 2021-10-01 18:33:22 +00:00
WpfTerminalControl wpf: make sure to pack api-ms-win-core-synch-l1-2-0 (#10587) 2021-07-08 10:31:59 -05:00
WpfTerminalTestNetCore wpf: make sure to pack api-ms-win-core-synch-l1-2-0 (#10587) 2021-07-08 10:31:59 -05:00
wt Upgrade Windows SDK to 19041 (#10118) 2021-05-20 16:04:25 +00:00
CascadiaResources.build.items Update Cascadia Code to 2106.17 (#10455) 2021-06-18 20:47:19 +00:00