Skip to content

Commit 7125c45

Browse files
authored
Generate the sdk msi bundles inside the VMR on windows BuildPass=2 verticals (#47397)
1 parent 472540a commit 7125c45

13 files changed

+523
-479
lines changed

eng/Build.props

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<Project>
22

3-
<!-- VMR bootstrap -->
4-
<ItemGroup Condition="'$(InitializeVMR)' == 'true'">
5-
<ProjectToBuild Include="$(RepoRoot)src/VirtualMonoRepo/Tasks/VirtualMonoRepo.Tasks.csproj" BuildInParallel="false" />
6-
<ProjectToBuild Include="$(RepoRoot)src/VirtualMonoRepo/InitializeVMR.proj" BuildInParallel="false" />
7-
</ItemGroup>
8-
9-
<!-- For product build, build MSBuildExtensions and VSTemplateLocator only in the second build pass on win-x64 as
3+
<!-- For product build, build MSBuildExtensions and VSTemplateLocator in the second build pass on win-x64 as
104
they depend on assets from other verticals that are built in the first build pass. -->
115
<ItemGroup Condition="'$(DotNetBuildPass)' == '2' and
126
'$(OS)' == 'Windows_NT' and
@@ -15,4 +9,11 @@
159
<ProjectToBuild Include="$(RepoRoot)src\VSTemplateLocator\VSTemplateLocator.proj" DotNetBuildPass="2" />
1610
</ItemGroup>
1711

12+
<!-- For product build, build the sdk bundle in the second build pass on windows as
13+
it depends on assets from other verticals that are built in the first build pass. -->
14+
<ItemGroup Condition="'$(DotNetBuildPass)' == '2' and
15+
'$(OS)' == 'Windows_NT'">
16+
<ProjectToBuild Include="$(RepoRoot)src\Installer\redist-installer\redist-installer.proj" DotNetBuildPass="2" />
17+
</ItemGroup>
18+
1819
</Project>

eng/Signing.props

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<Project>
22

33
<PropertyGroup>
4-
<!-- The FullNugetVersion.version file only gets produced in the initial build pass. -->
5-
<RelativeBlobPathParent Condition="'$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1'">Sdk/$([System.IO.File]::ReadAllText('$(ArtifactsTmpDir)FullNugetVersion.version').Trim())</RelativeBlobPathParent>
4+
<RelativeBlobPathParent>Sdk/$([System.IO.File]::ReadAllText('$(ArtifactsTmpDir)FullNugetVersion.version').Trim())</RelativeBlobPathParent>
65
<PublishBinariesAndBadge Condition="'$(PublishBinariesAndBadge)' == ''">true</PublishBinariesAndBadge>
76
</PropertyGroup>
87

@@ -89,7 +88,13 @@
8988
PublishFlatContainer="false" />
9089
</ItemGroup>
9190

92-
<ItemGroup Condition="'$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1'">
91+
<!-- Only publish this file from win-x64 so that we don't end up with duplicates. -->
92+
<ItemGroup Condition="'$(PublishBinariesAndBadge)' == 'true' and '$(OS)' == 'Windows_NT' and '$(Architecture)' == 'x64' and '$(PgoInstrument)' != 'true' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1')">
93+
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)productVersion.txt" IsShipping="true" />
94+
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)sdk-productVersion.txt" IsShipping="true" />
95+
</ItemGroup>
96+
97+
<ItemGroup>
9398
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.zip" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
9499
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.tar.gz" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
95100
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.pkg" IsShipping="true" />
@@ -99,9 +104,6 @@
99104
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.msi" IsShipping="true" />
100105
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.cab" IsShipping="true" />
101106
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.svg" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
102-
<!-- Only publish this file from windows x64 so that we don't end up with duplicates -->
103-
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)productVersion.txt" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true' and '$(OS)' == 'Windows_NT' and '$(Architecture)' == 'x64' and '$(PgoInstrument)' != 'true'" />
104-
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)sdk-productVersion.txt" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true' and '$(OS)' == 'Windows_NT' and '$(Architecture)' == 'x64' and '$(PgoInstrument)' != 'true'" />
105107
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)productCommit-*.json" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
106108
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)productCommit-*.txt" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
107109

@@ -110,7 +112,9 @@
110112
<SdkArtifact Include="$(ArtifactsNonShippingPackagesDir)*.tar.gz" IsShipping="false" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
111113
<SdkArtifact Include="$(ArtifactsNonShippingPackagesDir)*.zip" IsShipping="false" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
112114
<SdkArtifact Include="$(ArtifactsNonShippingPackagesDir)*.pkg" IsShipping="false" />
115+
</ItemGroup>
113116

117+
<ItemGroup>
114118
<Artifact Include="@(SdkArtifact)"
115119
RelativeBlobPath="$(RelativeBlobPathParent)/%(Filename)%(Extension)">
116120
<ChecksumPath Condition="$([System.String]::Copy('%(Filename)%(Extension)').EndsWith('.wixpack.zip')) != 'true'">%(FullPath).sha512</ChecksumPath>

eng/pipelines/templates/stages/vmr-build.yml

+18
Original file line numberDiff line numberDiff line change
@@ -892,12 +892,30 @@ stages:
892892
targetArchitecture: x86
893893
buildPass: 2
894894
reuseBuildArtifactsFrom:
895+
- Windows_x64
896+
- Windows_x86
897+
- Windows_arm64
895898
- AzureLinux_x64_Cross_x64
896899
- AzureLinux_x64_Cross_Alpine_x64
897900
- AzureLinux_x64_Cross_arm64
898901
- AzureLinux_x64_Cross_Alpine_arm64
899902
- AzureLinux_x64_Cross_arm
900903
- AzureLinux_x64_Cross_Alpine_arm
904+
905+
- template: ../jobs/vmr-build.yml
906+
parameters:
907+
buildName: Windows
908+
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
909+
vmrBranch: ${{ variables.VmrBranch }}
910+
sign: ${{ variables.signEnabled }}
911+
pool: ${{ parameters.pool_Windows }}
912+
targetOS: windows
913+
targetArchitecture: arm64
914+
buildPass: 2
915+
reuseBuildArtifactsFrom:
916+
- Windows_x64
917+
- Windows_x86
918+
- Windows_arm64
901919

902920
### FINAL JOIN ###
903921
- ${{ if and(parameters.isBuiltFromVmr, not(parameters.isSourceOnlyBuild), eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:

src/Installer/redist-installer/Directory.Build.targets

+19-9
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,28 @@
2929
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>dotnet-sdk$(PgoTerm)-$(Version)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
3030
</PropertyGroup>
3131

32+
<!-- This is a hack to make the full nuget version available during the publishing step -->
33+
<Target Name="GenerateFullNugetVersionFile"
34+
BeforeTargets="Build">
35+
<WriteLinesToFile File="$(ArtifactsTmpDir)FullNugetVersion.version"
36+
Lines="$(FullNugetVersion)"
37+
Overwrite="true" />
38+
</Target>
39+
3240
<Import Project="$(RepoRoot)src\Tasks\sdk-tasks\sdk-tasks.InTree.targets" />
3341

34-
<!-- Layout -->
35-
<Import Project="targets\BundledTemplates.targets" />
42+
<Import Project="targets\RestoreLayout.targets" />
3643
<Import Project="targets\BundledManifests.targets" />
37-
<Import Project="targets\BundledDotnetTools.targets" />
38-
<Import Project="targets\GenerateBundledVersions.targets" />
39-
<Import Project="targets\Crossgen.targets" />
40-
<Import Project="targets\GenerateLayout.targets" />
41-
<Import Project="targets\GenerateRuntimeAnalyzers.targets" />
42-
<Import Project="targets\Badge.targets" Condition="'$(PgoInstrument)' != 'true'" />
43-
<Import Project="targets\GenerateArchives.targets" />
44+
45+
<ImportGroup Condition="'$(GenerateSdkBundleOnly)' != 'true'">
46+
<Import Project="targets\BundledTemplates.targets" />
47+
<Import Project="targets\BundledDotnetTools.targets" />
48+
<Import Project="targets\GenerateBundledVersions.targets" />
49+
<Import Project="targets\Crossgen.targets" />
50+
<Import Project="targets\GenerateLayout.targets" />
51+
<Import Project="targets\Badge.targets" Condition="'$(PgoInstrument)' != 'true'" />
52+
<Import Project="targets\GenerateArchives.targets" />
53+
</ImportGroup>
4454

4555
<!-- Installers -->
4656
<Import Project="targets\GenerateMSIs.targets" Condition="'$(OS)' == 'Windows_NT' and '$(SkipBuildingInstallers)' != 'true'" />

src/Installer/redist-installer/redist-installer.proj

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
55
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
66
<IsShippingPackage>true</IsShippingPackage>
7+
<GenerateSdkBundleOnly Condition="'$(DotNetBuildPass)' == '2' and '$(OS)' == 'Windows_NT'">true</GenerateSdkBundleOnly>
78
</PropertyGroup>
89

9-
<ItemGroup>
10-
<ProjectReference Include="..\..\Layout\redist\redist.csproj" />
10+
<ItemGroup Condition="'$(GenerateSdkBundleOnly)' != 'true'">
11+
<ProjectReference Include="$(RepoRoot)src\Layout\redist\redist.csproj" />
1112
<ProjectReference Include="$(RepoRoot)template_feed\*\*.csproj" />
1213
</ItemGroup>
1314

15+
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
16+
<ProjectReference Include="$(RepoRoot)src\Installer\finalizer\finalizer-build.csproj" />
17+
</ItemGroup>
18+
1419
<ItemGroup>
1520
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" />
1621
</ItemGroup>

src/Installer/redist-installer/targets/BundledManifests.targets

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
</ItemGroup>
5353

5454
<Target Name="ValidateBundledManifestSigning"
55-
Condition=" '$(OS)' == 'Windows_NT' and '$(Architecture)' != 'arm' ">
55+
Condition="'$(OS)' == 'Windows_NT' and '$(Architecture)' != 'arm'"
56+
BeforeTargets="GenerateWorkloadManifestsWxs">
5657
<PropertyGroup>
5758
<SignCheckExe>$(PkgMicrosoft_DotNet_SignCheck)\tools\Microsoft.DotNet.SignCheck.exe</SignCheckExe>
5859
<SignCheckLog Condition="'$(SignCheckLog)' == ''">$(ArtifactsLogDir)\workloadmanifestsigncheck.log</SignCheckLog>

0 commit comments

Comments
 (0)