From fb373bbf066b6f987baa274249badc3613a26cfe Mon Sep 17 00:00:00 2001 From: Dustin Howett Date: Wed, 29 Apr 2020 16:25:54 -0700 Subject: [PATCH 1/9] Bundle the entire CRT with our branded Release packages For our release builds, we're just going to integrate the UWPDesktop CRT into our package and delete the package dependencies. It's very difficult for users who do not have access to the store to get our dependency packages, and we want to be robust and deployable everywhere. Since these libraries can be redistributed, it's easiest if we simply redistribute them. Our package grows by ~550kb per architecture (compressed) because of this. I've added validation that we don't have both the libs _and_ the dependencies in the same package. Fixes #3097. --- build/scripts/Test-WindowsTerminalPackage.ps1 | 15 ++++++++ .../CascadiaPackage/CascadiaPackage.wapproj | 36 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/build/scripts/Test-WindowsTerminalPackage.ps1 b/build/scripts/Test-WindowsTerminalPackage.ps1 index 23da009c63f..8d33f1a2769 100644 --- a/build/scripts/Test-WindowsTerminalPackage.ps1 +++ b/build/scripts/Test-WindowsTerminalPackage.ps1 @@ -68,6 +68,21 @@ Try { } } + $dependencies = $Manifest.Package.Dependencies.PackageDependency.Name + $depsHasVclibsDesktop = ("Microsoft.VCLibs.140.00.UWPDesktop" -in $dependencies) -or ("Microsoft.VCLibs.140.00.Debug.UWPDesktop" -in $dependencies) + $depsHasVcLibsAppX = ("Microsoft.VCLibs.140.00" -in $dependencies) -or ("Microsoft.VCLibs.140.00.Debug" -in $dependencies) + $filesHasVclibsDesktop = ($null -ne (Get-Item "$AppxPackageRootPath\vcruntime140.dll" -EA:Ignore)) -or ($null -ne (Get-Item "$AppxPackageRootPath\vcruntime140d.dll" -EA:Ignore)) + $filesHasVclibsAppX = ($null -ne (Get-Item "$AppxPackageRootPath\vcruntime140_app.dll" -EA:Ignore)) -or ($null -ne (Get-Item "$AppxPackageRootPath\vcruntime140d_app.dll" -EA:Ignore)) + + If ($depsHasVclibsDesktop -and $filesHasVclibsDesktop) { + Throw "Package has Dependency *and* integrated Desktop VCLibs" + } + + If ($depsHasVclibsAppx -and $filesHasVclibsAppx) { + # We've shipped like this forever, so downgrade to warning. + Write-Warning "Package has Dependency *and* integrated AppX VCLibs" + } + ### Check that we have an App.xbf (which is a proxy for our resources having been merged) $resourceXpath = '/PriInfo/ResourceMap/ResourceMapSubtree[@name="Files"]/NamedResource[@name="App.xbf"]' $AppXbf = $PRIFile.SelectSingleNode($resourceXpath) diff --git a/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj b/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj index 97a6d26fb2a..6e8bbffa413 100644 --- a/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj +++ b/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj @@ -106,6 +106,42 @@ + + + + + x86 + $(Platform) + + + + + + true + %(Filename)%(Extension) + + + + + + + + + + + + + + + + + + From 851391f581905922d643cfc960014ac79297e8f7 Mon Sep 17 00:00:00 2001 From: Dustin Howett Date: Wed, 29 Apr 2020 16:29:33 -0700 Subject: [PATCH 2/9] and spacing --- build/scripts/Test-WindowsTerminalPackage.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/scripts/Test-WindowsTerminalPackage.ps1 b/build/scripts/Test-WindowsTerminalPackage.ps1 index 8d33f1a2769..a8677f42fc5 100644 --- a/build/scripts/Test-WindowsTerminalPackage.ps1 +++ b/build/scripts/Test-WindowsTerminalPackage.ps1 @@ -75,12 +75,12 @@ Try { $filesHasVclibsAppX = ($null -ne (Get-Item "$AppxPackageRootPath\vcruntime140_app.dll" -EA:Ignore)) -or ($null -ne (Get-Item "$AppxPackageRootPath\vcruntime140d_app.dll" -EA:Ignore)) If ($depsHasVclibsDesktop -and $filesHasVclibsDesktop) { - Throw "Package has Dependency *and* integrated Desktop VCLibs" + Throw "Package has Dependency *and* integrated Desktop VCLibs" } If ($depsHasVclibsAppx -and $filesHasVclibsAppx) { - # We've shipped like this forever, so downgrade to warning. - Write-Warning "Package has Dependency *and* integrated AppX VCLibs" + # We've shipped like this forever, so downgrade to warning. + Write-Warning "Package has Dependency *and* integrated AppX VCLibs" } ### Check that we have an App.xbf (which is a proxy for our resources having been merged) From 44a700dd474ea41b53ddaf36c11e1900ea44f318 Mon Sep 17 00:00:00 2001 From: Dustin Howett Date: Wed, 29 Apr 2020 16:32:16 -0700 Subject: [PATCH 3/9] speeling --- .github/actions/spell-check/dictionary/microsoft.txt | 1 + .github/actions/spell-check/whitelist/whitelist.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/actions/spell-check/dictionary/microsoft.txt b/.github/actions/spell-check/dictionary/microsoft.txt index 6421c6bb666..50831af918c 100644 --- a/.github/actions/spell-check/dictionary/microsoft.txt +++ b/.github/actions/spell-check/dictionary/microsoft.txt @@ -5,4 +5,5 @@ microsoftonline osgvsowi powershell tdbuildteamid +vcruntime visualstudio diff --git a/.github/actions/spell-check/whitelist/whitelist.txt b/.github/actions/spell-check/whitelist/whitelist.txt index f71dde01479..58da42f6e46 100644 --- a/.github/actions/spell-check/whitelist/whitelist.txt +++ b/.github/actions/spell-check/whitelist/whitelist.txt @@ -596,6 +596,7 @@ Delt demoable depersist deprioritized +deps deque deref deserialization From d656226a27d2a707deec57aa0f9b3204324fa9f3 Mon Sep 17 00:00:00 2001 From: Dustin Howett Date: Wed, 29 Apr 2020 17:33:36 -0700 Subject: [PATCH 4/9] important: make sure we actually have one of the libs too --- build/scripts/Test-WindowsTerminalPackage.ps1 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/scripts/Test-WindowsTerminalPackage.ps1 b/build/scripts/Test-WindowsTerminalPackage.ps1 index a8677f42fc5..ad1ef8bc50a 100644 --- a/build/scripts/Test-WindowsTerminalPackage.ps1 +++ b/build/scripts/Test-WindowsTerminalPackage.ps1 @@ -83,6 +83,14 @@ Try { Write-Warning "Package has Dependency *and* integrated AppX VCLibs" } + If (-not $depsHasVclibsDesktop -and -not $filesHasVclibsDesktop) { + Throw "Package doesn't contain a dependency or integrated Desktop VCLibs" + } + + If (-not $depsHasVclibsAppx -and -not $filesHasVclibsAppx) { + Throw "Package doesn't contain a dependency or integrated AppX VCLibs" + } + ### Check that we have an App.xbf (which is a proxy for our resources having been merged) $resourceXpath = '/PriInfo/ResourceMap/ResourceMapSubtree[@name="Files"]/NamedResource[@name="App.xbf"]' $AppXbf = $PRIFile.SelectSingleNode($resourceXpath) From 612a348b0f643ee6588415520278b6517e5fbd19 Mon Sep 17 00:00:00 2001 From: Dustin Howett Date: Wed, 29 Apr 2020 17:45:09 -0700 Subject: [PATCH 5/9] Move the lib aggregation down to WindowsTerminal.vcxproj --- .../CascadiaPackage/CascadiaPackage.wapproj | 14 +----------- .../WindowsTerminal/WindowsTerminal.vcxproj | 22 ++++++++++++++++++- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj b/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj index 6e8bbffa413..69cb812cf3e 100644 --- a/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj +++ b/src/cascadia/CascadiaPackage/CascadiaPackage.wapproj @@ -112,20 +112,8 @@ For our release builds, we're just going to integrate the UWPDesktop CRT into our package and delete the package dependencies. It's very difficult for users who do not have access to the store to get our dependency packages, and we want to be robust and deployable everywhere. Since these libraries can be redistributed, it's easiest if we simply redistribute them. + See also the "VC LIBS HACK" section in WindowsTerminal.vcxproj. --> - - x86 - $(Platform) - - - - - - true - %(Filename)%(Extension) - - - diff --git a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj index 475e19cabe9..24ed225a257 100644 --- a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj +++ b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj @@ -115,6 +115,21 @@ + + + x86 + $(Platform) + + + + + <_OpenConsoleVCLibToCopy Include="$(VCToolsRedistInstallDir)\$(ReasonablePlatform)\Microsoft.VC142.CRT\*.dll"> + %(Filename)%(Extension) + + + + + + + BuiltProjectOutputGroup + + - \ No newline at end of file + From c0f0d4b5cebe15322315d1b62694eb18d67c0664 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Wed, 29 Apr 2020 18:04:17 -0700 Subject: [PATCH 6/9] ffs --- src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj index 24ed225a257..dd24b6c3738 100644 --- a/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj +++ b/src/cascadia/WindowsTerminal/WindowsTerminal.vcxproj @@ -156,6 +156,7 @@ + $(ProjectName) BuiltProjectOutputGroup From b42d184dfec0ee7701004fee947a3ff73239af8b Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Wed, 29 Apr 2020 18:05:38 -0700 Subject: [PATCH 7/9] CI HAX: force this on, revert later --- build/pipelines/ci.yml | 4 ++-- build/pipelines/templates/build-console-ci.yml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/pipelines/ci.yml b/build/pipelines/ci.yml index 503f78c20fb..72a3dbbb030 100644 --- a/build/pipelines/ci.yml +++ b/build/pipelines/ci.yml @@ -47,7 +47,7 @@ stages: - stage: Build_x86 displayName: Build x86 dependsOn: [] - condition: not(eq(variables['Build.Reason'], 'PullRequest')) + condition: succeeded() jobs: - template: ./templates/build-console-ci.yml parameters: @@ -55,7 +55,7 @@ stages: - stage: Build_ARM64 displayName: Build ARM64 dependsOn: [] - condition: not(eq(variables['Build.Reason'], 'PullRequest')) + condition: succeeded() jobs: - template: ./templates/build-console-ci.yml parameters: diff --git a/build/pipelines/templates/build-console-ci.yml b/build/pipelines/templates/build-console-ci.yml index 34c8d09add7..e09c15c8b1e 100644 --- a/build/pipelines/templates/build-console-ci.yml +++ b/build/pipelines/templates/build-console-ci.yml @@ -9,6 +9,7 @@ jobs: variables: BuildConfiguration: ${{ parameters.configuration }} BuildPlatform: ${{ parameters.platform }} + WindowsTerminalReleaseBuild: true pool: { vmImage: windows-2019 } steps: From 92b773cca72c9a281ccb9e09282fe9967326ad68 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Wed, 29 Apr 2020 18:15:32 -0700 Subject: [PATCH 8/9] make the dep file check more clever --- build/scripts/Test-WindowsTerminalPackage.ps1 | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/build/scripts/Test-WindowsTerminalPackage.ps1 b/build/scripts/Test-WindowsTerminalPackage.ps1 index ad1ef8bc50a..5958a69f8b5 100644 --- a/build/scripts/Test-WindowsTerminalPackage.ps1 +++ b/build/scripts/Test-WindowsTerminalPackage.ps1 @@ -74,21 +74,19 @@ Try { $filesHasVclibsDesktop = ($null -ne (Get-Item "$AppxPackageRootPath\vcruntime140.dll" -EA:Ignore)) -or ($null -ne (Get-Item "$AppxPackageRootPath\vcruntime140d.dll" -EA:Ignore)) $filesHasVclibsAppX = ($null -ne (Get-Item "$AppxPackageRootPath\vcruntime140_app.dll" -EA:Ignore)) -or ($null -ne (Get-Item "$AppxPackageRootPath\vcruntime140d_app.dll" -EA:Ignore)) - If ($depsHasVclibsDesktop -and $filesHasVclibsDesktop) { - Throw "Package has Dependency *and* integrated Desktop VCLibs" + If ($depsHasVclibsDesktop -Eq $filesHasVclibsDesktop) { + $eitherBoth = if ($depsHasVclibsDesktop) { "both" } else { "neither" } + $neitherNor = if ($depsHasVclibsDesktop) { "and" } else { "nor" } + Throw "Package has $eitherBoth Dependency $neitherNor Integrated Desktop VCLibs" } - If ($depsHasVclibsAppx -and $filesHasVclibsAppx) { - # We've shipped like this forever, so downgrade to warning. - Write-Warning "Package has Dependency *and* integrated AppX VCLibs" - } - - If (-not $depsHasVclibsDesktop -and -not $filesHasVclibsDesktop) { - Throw "Package doesn't contain a dependency or integrated Desktop VCLibs" - } - - If (-not $depsHasVclibsAppx -and -not $filesHasVclibsAppx) { - Throw "Package doesn't contain a dependency or integrated AppX VCLibs" + If ($depsHasVclibsAppx -Eq $filesHasVclibsAppx) { + if ($depsHasVclibsAppx) { + # We've shipped like this forever, so downgrade to warning. + Write-Warning "Package has both Dependency and Integrated AppX VCLibs" + } else { + Throw "Package has neither Dependency nor Integrated AppX VCLibs" + } } ### Check that we have an App.xbf (which is a proxy for our resources having been merged) From b5a91acf5ed019ac133280343be36d640a0d1320 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Wed, 29 Apr 2020 18:22:09 -0700 Subject: [PATCH 9/9] Revert "CI HAX: force this on, revert later" This reverts commit b42d184dfec0ee7701004fee947a3ff73239af8b. --- build/pipelines/ci.yml | 4 ++-- build/pipelines/templates/build-console-ci.yml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/build/pipelines/ci.yml b/build/pipelines/ci.yml index 72a3dbbb030..503f78c20fb 100644 --- a/build/pipelines/ci.yml +++ b/build/pipelines/ci.yml @@ -47,7 +47,7 @@ stages: - stage: Build_x86 displayName: Build x86 dependsOn: [] - condition: succeeded() + condition: not(eq(variables['Build.Reason'], 'PullRequest')) jobs: - template: ./templates/build-console-ci.yml parameters: @@ -55,7 +55,7 @@ stages: - stage: Build_ARM64 displayName: Build ARM64 dependsOn: [] - condition: succeeded() + condition: not(eq(variables['Build.Reason'], 'PullRequest')) jobs: - template: ./templates/build-console-ci.yml parameters: diff --git a/build/pipelines/templates/build-console-ci.yml b/build/pipelines/templates/build-console-ci.yml index e09c15c8b1e..34c8d09add7 100644 --- a/build/pipelines/templates/build-console-ci.yml +++ b/build/pipelines/templates/build-console-ci.yml @@ -9,7 +9,6 @@ jobs: variables: BuildConfiguration: ${{ parameters.configuration }} BuildPlatform: ${{ parameters.platform }} - WindowsTerminalReleaseBuild: true pool: { vmImage: windows-2019 } steps: