Skip to content

Commit 10d457d

Browse files
Use arcade infra for DEB and RPM build (#45047)
1 parent 033eead commit 10d457d

13 files changed

+171
-1230
lines changed

.vsts-ci.yml

+2-7
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ extends:
6565
containers:
6666
alpine319WithNode:
6767
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode
68-
cblMariner20Fpm:
69-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-fpm
7068
centosStream9:
7169
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9
7270
debian12Amd64:
@@ -75,8 +73,6 @@ extends:
7573
image: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39
7674
mariner20CrossArm:
7775
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm
78-
ubuntu2204DebPkg:
79-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-debpkg
8076
sdl:
8177
sourceAnalysisPool:
8278
name: $(DncEngInternalBuildPool)
@@ -200,21 +196,20 @@ extends:
200196
runTests: false
201197
### PORTABLE ###
202198
- categoryName: Portable
203-
container: ubuntu2204DebPkg
204199
# Do not publish zips and tarballs. The linux-x64 binaries are already published by Official.
205200
publishArgument: $(_publishArgument) /p:PublishBinariesAndBadge=false
206201
officialBuildProperties: $(_officialBuildProperties)
207202
osProperties: $(linuxOsPortableProperties) /p:BuildSdkDeb=true
208203
runTests: false
209204
- categoryName: Portable
210-
container: cblMariner20Fpm
205+
container: centosStream9
211206
# Do not publish zips and tarballs. The linux-x64 binaries are already published by Official.
212207
publishArgument: $(_publishArgument) /p:PublishBinariesAndBadge=false
213208
officialBuildProperties: $(_officialBuildProperties)
214209
osProperties: $(linuxOsPortableProperties) /p:IsRPMBasedDistro=true
215210
runTests: false
216211
- categoryName: Portable
217-
container: cblMariner20Fpm
212+
container: centosStream9
218213
buildArchitecture: arm64
219214
runtimeIdentifier: linux-arm64
220215
# Do not publish zips and tarballs. The linux-arm64 binaries are already published by Official.

eng/Versions.props

-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@
268268
</PropertyGroup>
269269
<PropertyGroup Label="Infrastructure and test only dependencies">
270270
<VersionToolsVersion>2.2.0-beta.19072.10</VersionToolsVersion>
271-
<DotnetDebToolVersion>2.0.0</DotnetDebToolVersion>
272271
<MicrosoftDotNetScenarioTestsSdkTemplateTestsVersion>10.0.0-preview.24602.1</MicrosoftDotNetScenarioTestsSdkTemplateTestsVersion>
273272
</PropertyGroup>
274273
<PropertyGroup Label="Manually updated">

sdk.sln

+7
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "finalizer-build", "src\Inst
497497
EndProject
498498
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "redist-installer", "src\Installer\redist-installer\redist-installer.csproj", "{FAADC193-BA41-449D-97CE-0EF82836046A}"
499499
EndProject
500+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "dotnet-sdk", "src\Installer\pkg\dotnet-sdk.proj", "{8D6A9984-118D-4415-A8FA-AB1F26CF5C44}"
501+
EndProject
500502
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VSTemplateLocator", "src\VSTemplateLocator\VSTemplateLocator.proj", "{0CBA5FB8-71A3-457A-89F3-E52B9602164A}"
501503
EndProject
502504
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "sdk-tasks.Tests", "test\sdk-tasks.Tests\sdk-tasks.Tests.csproj", "{21C21975-84C1-4A24-8E21-F7EC790A4584}"
@@ -965,6 +967,10 @@ Global
965967
{D9617F63-15F4-4CA2-8ECF-728A94B45D82}.Debug|Any CPU.Build.0 = Debug|Any CPU
966968
{D9617F63-15F4-4CA2-8ECF-728A94B45D82}.Release|Any CPU.ActiveCfg = Release|Any CPU
967969
{D9617F63-15F4-4CA2-8ECF-728A94B45D82}.Release|Any CPU.Build.0 = Release|Any CPU
970+
{8D6A9984-118D-4415-A8FA-AB1F26CF5C44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
971+
{8D6A9984-118D-4415-A8FA-AB1F26CF5C44}.Debug|Any CPU.Build.0 = Debug|Any CPU
972+
{8D6A9984-118D-4415-A8FA-AB1F26CF5C44}.Release|Any CPU.ActiveCfg = Release|Any CPU
973+
{8D6A9984-118D-4415-A8FA-AB1F26CF5C44}.Release|Any CPU.Build.0 = Release|Any CPU
968974
EndGlobalSection
969975
GlobalSection(SolutionProperties) = preSolution
970976
HideSolutionNode = FALSE
@@ -1142,6 +1148,7 @@ Global
11421148
{FA579C03-2EB4-4D47-88EE-BFF339E96FAF} = {22AB674F-ED91-4FBC-BFEE-8A1E82F9F05E}
11431149
{1F0B4B3C-DC88-4740-B04F-1707102E9930} = {580D1AE7-AA8F-4912-8B76-105594E00B3B}
11441150
{D9617F63-15F4-4CA2-8ECF-728A94B45D82} = {3FA6F1CB-295B-4414-B18F-93845917A8CD}
1151+
{8D6A9984-118D-4415-A8FA-AB1F26CF5C44} = {3FA6F1CB-295B-4414-B18F-93845917A8CD}
11451152
EndGlobalSection
11461153
GlobalSection(ExtensibilityGlobals) = postSolution
11471154
SolutionGuid = {FB8F26CE-4DE6-433F-B32A-79183020BBD6}

source-build.slnf

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"src\\Containers\\Microsoft.NET.Build.Containers\\Microsoft.NET.Build.Containers.csproj",
2323
"src\\Containers\\packaging\\package.csproj",
2424
"src\\Installer\\redist-installer\\redist-installer.csproj",
25+
"src\\Installer\\pkg\\dotnet-sdk.proj",
2526
"src\\Layout\\redist\\redist.csproj",
2627
"src\\Layout\\tool_fsharp\\tool_fsc.csproj",
2728
"src\\Layout\\tool_msbuild\\tool_msbuild.csproj",

src/Installer/pkg/dotnet-sdk.proj

+160
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
<Project Sdk="Microsoft.Build.NoTargets">
2+
3+
<PropertyGroup>
4+
<SkipBuild Condition="'$(BuildSdkDeb)' != 'true' and '$(IsRPMBasedDistro)' != 'true'">true</SkipBuild>
5+
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
6+
<RuntimeIdentifier>$(NETCoreSdkRuntimeIdentifier)</RuntimeIdentifier>
7+
<GenerateInstallers>true</GenerateInstallers>
8+
<BuildDebPackage Condition="'$(BuildSdkDeb)' == 'true'">true</BuildDebPackage>
9+
<BuildRpmPackage Condition="'$(IsRPMBasedDistro)' == 'true'">true</BuildRpmPackage>
10+
<UseArcadeRpmTooling>true</UseArcadeRpmTooling>
11+
<ProductBrandPrefix>Microsoft .NET</ProductBrandPrefix>
12+
<LicenseFile>$(RepoRoot)LICENSE.TXT</LicenseFile>
13+
<InstallerName>dotnet-sdk</InstallerName>
14+
<PackageBrandNameSuffix>SDK</PackageBrandNameSuffix>
15+
<!--
16+
Installer infra requires MajorVersion and MinorVersion, which triggers reevaluation of Arcade's
17+
VersionPrefix property. This requires PatchVersion to be set in order to produce the correct SDK version.
18+
-->
19+
<MajorVersion>$(VersionMajor)</MajorVersion>
20+
<MinorVersion>$(VersionMinor)</MinorVersion>
21+
<PatchVersion>$(VersionPrefix.Split('.')[2])</PatchVersion>
22+
<!--
23+
All supported installer runtime identifiers should be specified here.
24+
New arcade infra is only used for Linux installers, at the moment.
25+
-->
26+
<InstallerRuntimeIdentifiers>linux-$(Architecture)</InstallerRuntimeIdentifiers>
27+
<IsShippingPackage>true</IsShippingPackage>
28+
</PropertyGroup>
29+
30+
<ItemGroup>
31+
<ProjectReference Include="..\redist-installer\redist-installer.csproj" ReferenceOutputAssembly="false" />
32+
</ItemGroup>
33+
34+
<ItemGroup>
35+
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" />
36+
</ItemGroup>
37+
38+
<Import Project="$(RepoRoot)src\Tasks\sdk-tasks\sdk-tasks.InTree.targets" />
39+
40+
<PropertyGroup>
41+
<RedistLayoutPath>$(ArtifactsBinDir)redist-installer\$(Configuration)\dotnet\</RedistLayoutPath>
42+
<ManpagesDirectory>$(RepoRoot)documentation/manpages/sdk</ManpagesDirectory>
43+
<CLISdkRoot>$(RedistLayoutPath)sdk/</CLISdkRoot>
44+
<TemplatesRoot>$(RedistLayoutPath)templates/</TemplatesRoot>
45+
</PropertyGroup>
46+
47+
<Target Name="PublishToDisk">
48+
<Error Condition="'$(OutputPath)' == ''" Text="Publishing to disk requires the OutputPath to be set to the root of the path to write to." />
49+
50+
<ItemGroup>
51+
<CLISdkFiles Include="$(CLISdkRoot)**/*" />
52+
<TemplatesFiles Include="$(TemplatesRoot)**/*" />
53+
<ManifestFiles Include="$(RedistLayoutPath)sdk-manifests/**/*" />
54+
</ItemGroup>
55+
56+
<!-- Create layout: Binaries -->
57+
<Copy
58+
DestinationFiles="@(CLISdkFiles->'$(OutputPath)/sdk/%(RecursiveDir)%(Filename)%(Extension)')"
59+
SourceFiles="@(CLISdkFiles)"
60+
OverwriteReadOnlyFiles="True"
61+
SkipUnchangedFiles="False"
62+
UseHardlinksIfPossible="False" />
63+
64+
<!-- Create layout: Templates -->
65+
<Copy
66+
DestinationFiles="@(TemplatesFiles->'$(OutputPath)/templates/%(RecursiveDir)%(Filename)%(Extension)')"
67+
SourceFiles="@(TemplatesFiles)"
68+
OverwriteReadOnlyFiles="True"
69+
SkipUnchangedFiles="False"
70+
UseHardlinksIfPossible="False" />
71+
72+
<!-- Create layout: Workload Manifests -->
73+
<Copy
74+
DestinationFiles="@(ManifestFiles->'$(OutputPath)/sdk-manifests/%(RecursiveDir)%(Filename)%(Extension)')"
75+
SourceFiles="@(ManifestFiles)"
76+
OverwriteReadOnlyFiles="True"
77+
SkipUnchangedFiles="False"
78+
UseHardlinksIfPossible="False" />
79+
</Target>
80+
81+
<Target Name="SetCustomPackagingProperties" AfterTargets="_GetInstallerProperties">
82+
<PropertyGroup>
83+
<PackageSummary>Microsoft .NET SDK $(PackageVersion)</PackageSummary>
84+
<!-- Clear PackageDescription to have it correctly set by Arcade. -->
85+
<PackageDescription></PackageDescription>
86+
</PropertyGroup>
87+
88+
<!--
89+
Manpages are not installed atm, tracked with https://github.com/dotnet/sdk/issues/44833
90+
Arcade infra expects the following items, but the installation path is TBD.
91+
Tracked in https://github.com/dotnet/arcade/issues/15243
92+
93+
<ItemGroup>
94+
<Manpage Include="$(ManpagesDirectory)**/*" />
95+
</ItemGroup>
96+
-->
97+
98+
</Target>
99+
100+
<Target Name="AddLinuxPackageInformation"
101+
BeforeTargets="GetDebInstallerJsonProperties;GetRpmInstallerJsonProperties"
102+
DependsOnTargets="CalculateLinuxNativeInstallerDependencyVersions">
103+
104+
<PropertyGroup>
105+
<DebianPostinstTemplateFile>$(MSBuildThisFileDirectory)../redist-installer/packaging/deb/postinst</DebianPostinstTemplateFile>
106+
<DebianPostinstFile>$(BaseIntermediateOutputPath)debian/postinst</DebianPostinstFile>
107+
</PropertyGroup>
108+
109+
<!-- Generate postinst file -->
110+
<ReplaceFileContents
111+
InputFiles="$(DebianPostinstTemplateFile)"
112+
DestinationFiles="$(DebianPostinstFile)"
113+
ReplacementPatterns="%SDK_VERSION%"
114+
ReplacementStrings="$(Version)"
115+
Condition="'$(BuildDebPackage)' == 'true'" />
116+
117+
<ItemGroup>
118+
<LinuxPackageDependency Include="dotnet-runtime-$(MicrosoftNETCoreAppMajorMinorVersion)" Version="$(MicrosoftNETCoreAppRuntimePackageVersionWithTilde)" />
119+
<LinuxPackageDependency Include="dotnet-targeting-pack-$(MicrosoftNETCoreAppMajorMinorVersion)" Version="$(MicrosoftNETCoreAppRefPackageVersionWithTilde)" />
120+
<LinuxPackageDependency Include="dotnet-apphost-pack-$(MicrosoftNETCoreAppMajorMinorVersion)" Version="$(MicrosoftNETCoreAppRuntimePackageVersionWithTilde)" />
121+
<LinuxPackageDependency Include="netstandard-targeting-pack-$(NetStandardTargetingPackMajorMinorVersion)" Version="$(NetStandardTargetingPackPackageVersionWithTilde)" />
122+
<LinuxPackageDependency Include="aspnetcore-runtime-$(AspNetCoreMajorMinorVersion)" Version="$(AspNetCoreRuntimeVersionWithTilde)" />
123+
<LinuxPackageDependency Include="aspnetcore-targeting-pack-$(AspNetCoreMajorMinorVersion)" Version="$(AspNetCoreRefVersionWithTilde)" />
124+
<LinuxPostInstallScript Include="$(DebianPostinstFile)" Condition="'$(BuildDebPackage)' == 'true'" />
125+
</ItemGroup>
126+
</Target>
127+
128+
<Target Name="CalculateLinuxNativeInstallerDependencyVersions">
129+
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftNETCoreAppRuntimePackageVersion)">
130+
<Output TaskParameter="VersionWithTilde" PropertyName="MicrosoftNETCoreAppRuntimePackageVersionWithTilde" />
131+
<Output TaskParameter="MajorMinorVersion" PropertyName="MicrosoftNETCoreAppMajorMinorVersion" />
132+
<Output TaskParameter="MajorMinorPatchVersion" PropertyName="MicrosoftNETCoreAppMajorMinorPatchVersion" />
133+
</GetLinuxNativeInstallerDependencyVersions>
134+
135+
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftNETCoreAppRefPackageVersion)">
136+
<Output TaskParameter="VersionWithTilde" PropertyName="MicrosoftNETCoreAppRefPackageVersionWithTilde" />
137+
</GetLinuxNativeInstallerDependencyVersions>
138+
139+
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftAspNetCoreAppRuntimePackageVersion)">
140+
<Output TaskParameter="VersionWithTilde" PropertyName="AspNetCoreRuntimeVersionWithTilde" />
141+
<Output TaskParameter="MajorMinorVersion" PropertyName="AspNetCoreMajorMinorVersion" />
142+
<Output TaskParameter="MajorMinorVersion" PropertyName="AspNetCoreMajorMinorPatchVersion" />
143+
</GetLinuxNativeInstallerDependencyVersions>
144+
145+
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(MicrosoftAspNetCoreAppRefPackageVersion)">
146+
<Output TaskParameter="VersionWithTilde" PropertyName="AspNetCoreRefVersionWithTilde" />
147+
</GetLinuxNativeInstallerDependencyVersions>
148+
149+
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(HostFxrVersion)">
150+
<Output TaskParameter="MajorMinorVersion" PropertyName="HostFxrMajorMinorVersion" />
151+
</GetLinuxNativeInstallerDependencyVersions>
152+
153+
<GetLinuxNativeInstallerDependencyVersions PackageVersion="$(NETStandardLibraryRefPackageVersion)">
154+
<Output TaskParameter="VersionWithTilde" PropertyName="NetStandardTargetingPackPackageVersionWithTilde" />
155+
<Output TaskParameter="MajorMinorVersion" PropertyName="NetStandardTargetingPackMajorMinorVersion" />
156+
<Output TaskParameter="MajorMinorPatchVersion" PropertyName="NetStandardTargetingPackMajorMinorPatchVersion" />
157+
</GetLinuxNativeInstallerDependencyVersions>
158+
</Target>
159+
160+
</Project>

src/Installer/redist-installer/redist-installer.csproj

-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@
3939
<Import Project="targets\FileExtensions.targets" />
4040
<Import Project="targets\GenerateArchives.targets" Condition="'$(PackInstaller)' != 'false'"/>
4141
<Import Project="targets\GenerateMSIs.targets" />
42-
<Import Project="targets\LinuxNativeInstallerDependencyVersions.targets" Condition="'$(PackInstaller)' != 'false'"/>
43-
<Import Project="targets\GenerateDebs.targets" Condition="'$(PackInstaller)' != 'false'"/>
44-
<Import Project="targets\GenerateRPMs.targets" Condition="'$(PackInstaller)' != 'false'"/>
4542
<Import Project="targets\GeneratePKG.targets" Condition="'$(PackInstaller)' != 'false'"/>
4643
<Import Project="targets\GenerateInstallers.targets" Condition="'$(PackInstaller)' != 'false'"/>
4744
<Import Project="targets\Badge.targets" />

0 commit comments

Comments
 (0)