Bundle the entire CRT with our branded Release packages (#5661)
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. ## Validation The script does it!
This commit is contained in:
parent
17bd8b5750
commit
3246c4250a
|
@ -5,4 +5,5 @@ microsoftonline
|
|||
osgvsowi
|
||||
powershell
|
||||
tdbuildteamid
|
||||
vcruntime
|
||||
visualstudio
|
||||
|
|
|
@ -596,6 +596,7 @@ Delt
|
|||
demoable
|
||||
depersist
|
||||
deprioritized
|
||||
deps
|
||||
deque
|
||||
deref
|
||||
deserialization
|
||||
|
|
|
@ -68,6 +68,27 @@ 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 -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 -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)
|
||||
$resourceXpath = '/PriInfo/ResourceMap/ResourceMapSubtree[@name="Files"]/NamedResource[@name="App.xbf"]'
|
||||
$AppXbf = $PRIFile.SelectSingleNode($resourceXpath)
|
||||
|
|
|
@ -106,6 +106,30 @@
|
|||
<AppxUploadPackagePayload Remove="@(AppxUploadPackagePayload)" Condition="'%(Extension)' == '.pri' and '%(Filename)' != 'resources'" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- **BEGIN VC LIBS HACK** -->
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
<!-- This target removes the FrameworkSdkReferences from before the AppX package targets manifest generation happens.
|
||||
This is part of the generic machinery that applies to every AppX. -->
|
||||
<Target Name="_OpenConsoleStripAllDependenciesFromPackageFirstManifest" BeforeTargets="_GenerateCurrentProjectAppxManifest">
|
||||
<ItemGroup Condition="'$(WindowsTerminalReleaseBuild)'=='true'">
|
||||
<FrameworkSdkReference Remove="@(FrameworkSdkReference)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- This target removes the FrameworkSdkPackages from before the *desktop bridge* manifest generation happens. -->
|
||||
<Target Name="_OpenConsoleStripAllDependenciesFromPackageSecondManifest" BeforeTargets="_GenerateDesktopBridgeAppxManifest" DependsOnTargets="_ResolveVCLibDependencies">
|
||||
<ItemGroup Condition="'$(WindowsTerminalReleaseBuild)'=='true'">
|
||||
<FrameworkSdkPackage Remove="@(FrameworkSdkPackage)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
<!-- **END VC LIBS HACK** -->
|
||||
|
||||
<!-- This is required to get the package dependency in the AppXManifest. -->
|
||||
<Import Project="..\..\..\packages\Microsoft.UI.Xaml.2.3.191217003-prerelease\build\native\Microsoft.UI.Xaml.targets" Condition="Exists('..\..\..\packages\Microsoft.UI.Xaml.2.3.191217003-prerelease\build\native\Microsoft.UI.Xaml.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
|
|
|
@ -115,6 +115,21 @@
|
|||
<Error Condition="!Exists('..\..\..\packages\Terminal.ThemeHelpers.0.2.200324001\build\native\Terminal.ThemeHelpers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Terminal.ThemeHelpers.0.2.200324001\build\native\Terminal.ThemeHelpers.targets'))" />
|
||||
</Target>
|
||||
|
||||
<!-- **BEGIN VC LIBS HACK** -->
|
||||
<PropertyGroup>
|
||||
<ReasonablePlatform Condition="'$(Platform)'=='Win32'">x86</ReasonablePlatform>
|
||||
<ReasonablePlatform Condition="'$(ReasonablePlatform)'==''">$(Platform)</ReasonablePlatform>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition="'$(WindowsTerminalReleaseBuild)'=='true'">
|
||||
<!-- Add all the CRT libs as content -->
|
||||
<_OpenConsoleVCLibToCopy Include="$(VCToolsRedistInstallDir)\$(ReasonablePlatform)\Microsoft.VC142.CRT\*.dll">
|
||||
<TargetPath>%(Filename)%(Extension)</TargetPath>
|
||||
</_OpenConsoleVCLibToCopy>
|
||||
</ItemGroup>
|
||||
<!-- **END VC LIBS HACK** -->
|
||||
|
||||
|
||||
<!-- Override GetPackagingOutputs to roll up all our dependencies.
|
||||
This ensures that when the WAP packaging project asks what files go into
|
||||
the package, we tell it.
|
||||
|
@ -139,9 +154,15 @@
|
|||
|
||||
<ItemGroup>
|
||||
<PackagingOutputs Include="@(_PackagingOutputsFromOtherProjects)" />
|
||||
<!-- (part of the VC LIBS HACK above) -->
|
||||
<PackagingOutputs Include="@(_OpenConsoleVCLibToCopy)">
|
||||
<ProjectName>$(ProjectName)</ProjectName>
|
||||
<OutputGroup>BuiltProjectOutputGroup</OutputGroup>
|
||||
</PackagingOutputs>
|
||||
</ItemGroup>
|
||||
|
||||
</Target>
|
||||
|
||||
<Import Project="$(OpenConsoleDir)\build\rules\GenerateSxsManifestsFromWinmds.targets" />
|
||||
<Import Project="..\..\..\packages\Terminal.ThemeHelpers.0.2.200324001\build\native\Terminal.ThemeHelpers.targets" Condition="Exists('..\..\..\packages\Terminal.ThemeHelpers.0.2.200324001\build\native\Terminal.ThemeHelpers.targets')" />
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
Loading…
Reference in a new issue