Skip to content

Commit 26fd6d1

Browse files
authored
Enable Hosting Bundle build in VMR (#45939)
1 parent 21bdb8f commit 26fd6d1

File tree

3 files changed

+136
-0
lines changed

3 files changed

+136
-0
lines changed

src/SourceBuild/content/repo-projects/aspnetcore.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<BuildArgs>$(BuildArgs) $(FlagParameterPrefix)arch $(TargetArchitecture)</BuildArgs>
2424
<BuildArgs>$(BuildArgs) /p:TargetRuntimeIdentifier=$(TargetRid)</BuildArgs>
2525
<BuildArgs>$(BuildArgs) /p:PublicBaseURL=file:%2F%2F$(ArtifactsAssetsDir)</BuildArgs>
26+
<BuildArgs>$(BuildArgs) /p:CrossArchitectureInstallerBasePath=$(ArtifactsAssetsDir)</BuildArgs>
2627
<BuildArgs Condition="'$(PgoInstrument)' == 'true'">$(BuildArgs) /p:PgoInstrument=true</BuildArgs>
2728

2829
<!-- PackageValidation fails with desktop msbuild: https://github.com/dotnet/sdk/issues/45004. -->

src/SourceBuild/content/repo-projects/sdk.proj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@
7070
<RepositoryReference Include="source-build-reference-packages" />
7171
</ItemGroup>
7272

73+
<ItemGroup Condition="'$(DotNetBuildPass)' == '2'">
74+
<RepositoryReference Remove="@(RepositoryReference)" />
75+
<RepositoryReference Include="aspnetcore" DotNetBuildPass="2" />
76+
</ItemGroup>
77+
7378
<!--
7479
If we have authentication, keep the templating internal feed (if one exists) to acquire the
7580
text-only prebuilt. The source-build repo as a whole should depend on the same internal feed as
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
From 6afaf38a1744e313bb6c10f7691bc55ced4dc3f1 Mon Sep 17 00:00:00 2001
2+
From: wtgodbe <[email protected]>
3+
Date: Mon, 13 Jan 2025 15:00:54 -0800
4+
Subject: [PATCH] Enable building Hosting Bundle in VMR
5+
6+
Backport: https://github.com/dotnet/aspnetcore/pull/59857
7+
8+
---
9+
Directory.Build.props | 1 +
10+
eng/Build.props | 14 +++++++++-----
11+
eng/Publishing.props | 5 +++--
12+
.../WindowsHostingBundle.wixproj | 17 +++++++++++++----
13+
4 files changed, 26 insertions(+), 11 deletions(-)
14+
15+
diff --git a/Directory.Build.props b/Directory.Build.props
16+
index 0321c8b193..b195586ed5 100644
17+
--- a/Directory.Build.props
18+
+++ b/Directory.Build.props
19+
@@ -239,6 +239,7 @@
20+
<PublicBaseURL Condition="'$(PublicBaseURL)' == ''">https://dotnetbuilds.blob.core.windows.net/public/</PublicBaseURL>
21+
<InternalBaseURL>https://dotnetbuilds.blob.core.windows.net/internal/</InternalBaseURL>
22+
<!-- Allow overriding where installers are pulled in from previously completed jobs in Unified Build scenarios. -->
23+
+ <AddVersionToCrossArchitectureInstallerBasePath Condition="'$(CrossArchitectureInstallerBasePath)' != ''">true</AddVersionToCrossArchitectureInstallerBasePath>
24+
<CrossArchitectureInstallerBasePath Condition="'$(CrossArchitectureInstallerBasePath)' == ''">$(ArtifactsShippingPackagesDir)</CrossArchitectureInstallerBasePath>
25+
</PropertyGroup>
26+
27+
diff --git a/eng/Build.props b/eng/Build.props
28+
index 697c3d9ba0..87e19ef337 100644
29+
--- a/eng/Build.props
30+
+++ b/eng/Build.props
31+
@@ -59,7 +59,7 @@
32+
33+
<Choose>
34+
<!-- Project selection can be overridden on the command line by passing in -projects. -->
35+
- <When Condition="'$(ProjectToBuild)' != ''">
36+
+ <When Condition="'$(ProjectToBuild)' != '' and '$(DotNetBuildPass)' != '2'">
37+
<ItemGroup>
38+
<ProjectToBuild Include="$(ProjectToBuild)"
39+
Exclude="@(ProjectToExclude);$(RepoRoot)**\bin\**\*;$(RepoRoot)**\obj\**\*">
40+
@@ -70,6 +70,14 @@
41+
</ProjectToBuild>
42+
</ItemGroup>
43+
</When>
44+
+ <When Condition="'$(DotNetBuildPass)' == '2'">
45+
+ <ItemGroup Condition=" '$(DotNetBuild)' == 'true' AND '$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'x64' ">
46+
+ <ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj">
47+
+ <AdditionalProperties>Platform=x86</AdditionalProperties>
48+
+ <DotNetBuildPass>$(DotNetBuildPass)</DotNetBuildPass>
49+
+ </ProjectToBuild>
50+
+ </ItemGroup>
51+
+ </When>
52+
<Otherwise>
53+
<!-- BuildNative -->
54+
<ItemGroup Condition=" '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64' OR '$(TargetArchitecture)' == 'arm64') ">
55+
@@ -255,10 +263,6 @@
56+
<InstallerProject Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=$(TargetArchitecture)" />
57+
</ItemGroup>
58+
59+
- <ItemGroup Condition="'$(DotNetBuild)' == 'true' and ('$(DotNetBuildPass)' == '2') and '$(TargetOsName)' == 'win' and '$(TargetArchitecture)' == 'x64'">
60+
- <InstallerProject Include="$(RepoRoot)src\Installers\Windows\WindowsHostingBundle\WindowsHostingBundle.wixproj" AdditionalProperties="Platform=x86" />
61+
- </ItemGroup>
62+
-
63+
<ItemGroup>
64+
<ProjectToBuild Condition=" '$(BuildInstallers)' == 'true'" Include="@(InstallerProject)" BuildStep="installer" />
65+
</ItemGroup>
66+
diff --git a/eng/Publishing.props b/eng/Publishing.props
67+
index 201e167159..a6a89bd0e9 100644
68+
--- a/eng/Publishing.props
69+
+++ b/eng/Publishing.props
70+
@@ -96,12 +96,13 @@
71+
</ItemGroup>
72+
73+
<!-- Generate productVersion.txt file containing the product version. -->
74+
- <WriteLinesToFile File="%(ProductVersionFile.Identity)"
75+
+ <WriteLinesToFile Condition="'$(DotNetBuildPass)' != '2'"
76+
+ File="%(ProductVersionFile.Identity)"
77+
Lines="$(ProductVersion)"
78+
Overwrite="true"
79+
Encoding="ASCII" />
80+
81+
- <ItemGroup>
82+
+ <ItemGroup Condition="'$(DotNetBuildPass)' != '2'">
83+
<Artifact Include="@(ProductVersionFile)"
84+
RelativeBlobPath="aspnetcore/Runtime/$(NonStableProductVersion)/%(Filename)%(Extension)" />
85+
</ItemGroup>
86+
diff --git a/src/Installers/Windows/WindowsHostingBundle/WindowsHostingBundle.wixproj b/src/Installers/Windows/WindowsHostingBundle/WindowsHostingBundle.wixproj
87+
index 3389f389a7..5ef4167757 100644
88+
--- a/src/Installers/Windows/WindowsHostingBundle/WindowsHostingBundle.wixproj
89+
+++ b/src/Installers/Windows/WindowsHostingBundle/WindowsHostingBundle.wixproj
90+
@@ -99,18 +99,27 @@
91+
<BundleRegName>$(BundleNameFull)</BundleRegName>
92+
</PropertyGroup>
93+
94+
+ <!-- CrossArchitectureInstallerBasePath is a global property, so use a new property instead of modifying it -->
95+
+ <PropertyGroup Condition="'$(AddVersionToCrossArchitectureInstallerBasePath)' == 'true'">
96+
+ <CrossArchitectureInstallerBasePathNormalized>$([MSBuild]::NormalizeDirectory('$(CrossArchitectureInstallerBasePath)', 'aspnetcore', 'Runtime', '$(SharedFxMsiVersion)'))</CrossArchitectureInstallerBasePathNormalized>
97+
+ </PropertyGroup>
98+
+
99+
+ <PropertyGroup Condition="'$(AddVersionToCrossArchitectureInstallerBasePath)' != 'true'">
100+
+ <CrossArchitectureInstallerBasePathNormalized>$(CrossArchitectureInstallerBasePath)</CrossArchitectureInstallerBasePathNormalized>
101+
+ </PropertyGroup>
102+
+
103+
<ItemGroup>
104+
- <SharedFxInstallers Include="$(CrossArchitectureInstallerBasePath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x64.msi">
105+
+ <SharedFxInstallers Include="$(CrossArchitectureInstallerBasePathNormalized)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x64.msi">
106+
<TargetPlatform>x64</TargetPlatform>
107+
<BundleNameProperty>SharedFxRedistInstallerx64</BundleNameProperty>
108+
<Version>$(SharedFxPackageVersion)</Version>
109+
</SharedFxInstallers>
110+
- <SharedFxInstallers Include="$(CrossArchitectureInstallerBasePath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x86.msi">
111+
+ <SharedFxInstallers Include="$(CrossArchitectureInstallerBasePathNormalized)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-x86.msi">
112+
<TargetPlatform>x86</TargetPlatform>
113+
<BundleNameProperty>SharedFxRedistInstallerx86</BundleNameProperty>
114+
<Version>$(SharedFxPackageVersion)</Version>
115+
</SharedFxInstallers>
116+
- <SharedFxInstallers Include="$(CrossArchitectureInstallerBasePath)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-arm64.msi">
117+
+ <SharedFxInstallers Include="$(CrossArchitectureInstallerBasePathNormalized)$(RuntimeInstallerBaseName)-$(SharedFxMsiVersion)-win-arm64.msi">
118+
<TargetPlatform>arm64</TargetPlatform>
119+
<BundleNameProperty>SharedFxRedistInstallerarm64</BundleNameProperty>
120+
<Version>$(SharedFxPackageVersion)</Version>
121+
@@ -127,7 +136,7 @@
122+
<DefineConstants>$(DefineConstants);BundleRegManufacturer=$(BundleRegManufacturer)</DefineConstants>
123+
<DefineConstants>$(DefineConstants);BundleRegFamily=$(BundleRegFamily)</DefineConstants>
124+
<DefineConstants>$(DefineConstants);BundleRegName=$(BundleRegName)</DefineConstants>
125+
- <DefineConstants>$(DefineConstants);CrossArchitectureInstallerBasePath=$(CrossArchitectureInstallerBasePath)</DefineConstants>
126+
+ <DefineConstants>$(DefineConstants);CrossArchitectureInstallerBasePath=$(CrossArchitectureInstallerBasePathNormalized)</DefineConstants>
127+
</PropertyGroup>
128+
129+
<Target Name="ExtractPropertiesFromSharedFxMsi" DependsOnTargets="FetchDependencies" AfterTargets="ResolveProjectReferences">
130+

0 commit comments

Comments
 (0)