Skip to content

Commit 9876244

Browse files
wtgodbedougbu
andauthored
[release/6.0] Build .rpm packages for linux arm64 (#40504)
* [release/6.0] Build .rpm packages for linux arm64 * Update Build.props * Update Directory.Build.props * Update Directory.Build.targets * Update Rpm.Runtime.rpmproj * Update Rpm.TargetingPack.rpmproj * Avoid duplicate targeting-pack RPM Build - if an RPM containing platform-neutral executables is platform-neutral, this should be enough * !fixup! Change Linux ARM64 job, not ARM one * Correct RPM arch name, include in targeting pack * Revert "Avoid duplicate targeting-pack RPM Build" This reverts commit 7bebff5 * Rename x64 RPM to "x64" Co-authored-by: Doug Bunting <[email protected]>
1 parent 7c2000d commit 9876244

File tree

6 files changed

+44
-33
lines changed

6 files changed

+44
-33
lines changed

.azure/pipelines/ci.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,6 @@ stages:
407407
--no-build-nodejs
408408
--no-build-java
409409
-p:OnlyPackPlatformSpecificPackages=true
410-
-p:AssetManifestFileName=aspnetcore-Linux_x64.xml
411410
$(_BuildArgs)
412411
$(_InternalRuntimeDownloadArgs)
413412
displayName: Run build.sh
@@ -496,17 +495,26 @@ stages:
496495
jobName: Linux_arm64_build
497496
jobDisplayName: "Build: Linux ARM64"
498497
agentOs: Linux
499-
buildArgs:
500-
--arch arm64
501-
--all
502-
--pack
503-
--no-build-nodejs
504-
--no-build-java
505-
-p:OnlyPackPlatformSpecificPackages=true
506-
-p:AssetManifestFileName=aspnetcore-Linux_arm64.xml
507-
$(_BuildArgs)
508-
$(_PublishArgs)
509-
$(_InternalRuntimeDownloadArgs)
498+
steps:
499+
- script: ./eng/build.sh
500+
--ci
501+
--arch arm64
502+
--pack
503+
--all
504+
--no-build-nodejs
505+
--no-build-java
506+
-p:OnlyPackPlatformSpecificPackages=true
507+
$(_BuildArgs)
508+
$(_InternalRuntimeDownloadArgs)
509+
displayName: Run build.sh
510+
- script: git clean -xfd src/**/obj/;
511+
./dockerbuild.sh rhel --ci --nobl --arch arm64 --build-installers --no-build-deps --no-build-nodejs
512+
-p:OnlyPackPlatformSpecificPackages=true -p:BuildRuntimeArchive=false -p:LinuxInstallerType=rpm
513+
-p:AssetManifestFileName=aspnetcore-Linux_arm64.xml
514+
$(_BuildArgs)
515+
$(_PublishArgs)
516+
$(_InternalRuntimeDownloadArgs)
517+
displayName: Build RPM installers
510518
installNodeJs: false
511519
installJdk: false
512520
artifacts:

eng/Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=arm64" />
9696
</ItemGroup>
9797

98-
<ItemGroup Condition="'$(BuildInstallers)' == 'true' AND '$(TargetRuntimeIdentifier)' == 'linux-x64'">
98+
<ItemGroup Condition="'$(BuildInstallers)' == 'true' AND ('$(TargetRuntimeIdentifier)' == 'linux-x64' OR '$(TargetRuntimeIdentifier)' == 'linux-arm64')">
9999
<ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'deb' "
100100
Include="$(RepoRoot)src\Installers\Debian\**\*.*proj" />
101101
<ProjectToBuild Condition=" '$(LinuxInstallerType)' == 'rpm' "

src/Installers/Rpm/Directory.Build.props

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@
99
<IntermediateOutputPath>$(IntermediateOutputPath)$(TargetRuntimeIdentifier)\</IntermediateOutputPath>
1010
<OutputPath>$(InstallersOutputPath)</OutputPath>
1111

12+
<CblMariner1VersionSuffix>-cm.1</CblMariner1VersionSuffix>
13+
<CblMariner2VersionSuffix>-cm.2</CblMariner2VersionSuffix>
14+
1215
<!-- All installers are shipping assets. -->
1316
<IsShipping>true</IsShipping>
1417
<IsPackable>true</IsPackable>
15-
</PropertyGroup>
1618

19+
<!-- RPM files are platform-specific and should be named appropriately. -->
20+
<RpmArch Condition=" '$(TargetArchitecture)' == 'x64' ">x64</RpmArch>
21+
<RpmArch Condition=" '$(TargetArchitecture)' == 'arm64' ">aarch64</RpmArch>
22+
</PropertyGroup>
1723
</Project>

src/Installers/Rpm/Directory.Build.targets

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<Target Name="PrepareForBuild">
1919
<MakeDir Directories="$(IntermediateOutputPath)" />
2020

21-
<Error Text="Currently only linux-x64 is supported by Rpm installers." Condition=" '$(TargetRuntimeIdentifier)' != 'linux-x64' " />
21+
<Error Text="Currently only linux-x64 and linux-arm64 are supported by Rpm installers." Condition=" '$(TargetRuntimeIdentifier)' != 'linux-x64' AND '$(TargetRuntimeIdentifier)' != 'linux-arm64'" />
2222

2323
<Error Text="Missing required property: RpmPackageInstallRoot" Condition=" '$(RpmPackageInstallRoot)' == '' " />
2424
<Error Text="Missing required property: PackageContentRoot" Condition=" '$(PackageContentRoot)' == '' " />
@@ -37,6 +37,11 @@
3737
<Target Name="Pack" />
3838

3939
<Target Name="RpmBuild" DependsOnTargets="$(RpmBuildDependsOn)">
40+
<PropertyGroup>
41+
<CblMariner1TargetPath>$(InstallersOutputPath)$(CblMarinerBaseName)$(CblMariner1VersionSuffix)$(CblMarinerExtension)</CblMariner1TargetPath>
42+
<CblMariner2TargetPath>$(InstallersOutputPath)$(CblMarinerBaseName)$(CblMariner2VersionSuffix)$(CblMarinerExtension)</CblMariner2TargetPath>
43+
</PropertyGroup>
44+
4045
<!-- Create layout: Create changelog -->
4146
<PropertyGroup>
4247
<ChangeLogProps>DATE=$([System.DateTime]::UtcNow.ToString(ddd MMM dd yyyy))</ChangeLogProps>
@@ -51,10 +56,6 @@
5156
<GenerateFileFromTemplate TemplateFile="$(MSBuildThisFileDirectory)changelog.in" OutputPath="$(GeneratedChangeLog)" Properties="$(ChangeLogProps)" />
5257

5358
<!-- Run fpm -->
54-
<PropertyGroup>
55-
<RpmArch Condition=" '$(TargetArchitecture)' == 'x64' ">amd64</RpmArch>
56-
</PropertyGroup>
57-
5859
<ItemGroup>
5960
<FpmArgs Include="--verbose" />
6061
<FpmArgs Include="--input-type=dir" />
@@ -79,12 +80,12 @@
7980
<Exec Command="fpm @(FpmArgs,' ')" />
8081

8182
<Copy SourceFiles="$(TargetPath)"
82-
DestinationFiles="$(CblMarinerTargetPath)"
83+
DestinationFiles="$(CblMariner1TargetPath)"
8384
OverwriteReadOnlyFiles="True"
8485
SkipUnchangedFiles="False"
8586
UseHardlinksIfPossible="False" />
8687

87-
<Message Text="$(TargetPath) -> $(CblMarinerTargetPath)" Importance="high" />
88+
<Message Text="$(TargetPath) -> $(CblMariner1TargetPath)" Importance="high" />
8889

8990
<Copy SourceFiles="$(TargetPath)"
9091
DestinationFiles="$(CblMariner2TargetPath)"
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
This project produces a generic RPM installer for Linux x64 platforms only.
2+
This project produces a generic RPM installer for Linux x64/arm64 platforms only.
33
-->
44
<Project DefaultTargets="Build">
55
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
@@ -12,11 +12,9 @@
1212
<Import Project="..\Rpm.Runtime.Common.targets" />
1313

1414
<PropertyGroup>
15-
<TargetFileName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)-x64.rpm</TargetFileName>
16-
<CblMarinerTargetFileName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)-cm.1-x64.rpm</CblMarinerTargetFileName>
17-
<CblMariner2TargetFileName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)-cm.2-x64.rpm</CblMariner2TargetFileName>
15+
<TargetFileName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)-$(RpmArch).rpm</TargetFileName>
1816
<TargetPath>$(InstallersOutputPath)$(TargetFileName)</TargetPath>
19-
<CblMarinerTargetPath>$(InstallersOutputPath)$(CblMarinerTargetFileName)</CblMarinerTargetPath>
20-
<CblMariner2TargetPath>$(InstallersOutputPath)$(CblMariner2TargetFileName)</CblMariner2TargetPath>
17+
<CblMarinerBaseName>$(RuntimeInstallerBaseName)-$(SharedFxVersion)</CblMarinerBaseName>
18+
<CblMarinerExtension>-$(RpmArch).rpm</CblMarinerExtension>
2119
</PropertyGroup>
2220
</Project>

src/Installers/Rpm/TargetingPack/Rpm.TargetingPack.rpmproj

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@
2929
<Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" />
3030

3131
<PropertyGroup>
32-
<TargetFileName>$(TargetingPackInstallerBaseName)-$(TargetingPackVersion).rpm</TargetFileName>
33-
<CblMarinerTargetFileName>$(TargetingPackInstallerBaseName)-$(TargetingPackVersion)-cm.1.rpm</CblMarinerTargetFileName>
34-
<CblMariner2TargetFileName>$(TargetingPackInstallerBaseName)-$(TargetingPackVersion)-cm.2.rpm</CblMariner2TargetFileName>
32+
<TargetFileName>$(TargetingPackInstallerBaseName)-$(TargetingPackVersion)-$(RpmArch).rpm</TargetFileName>
3533
<TargetPath>$(InstallersOutputPath)$(TargetFileName)</TargetPath>
36-
<CblMarinerTargetPath>$(InstallersOutputPath)$(CblMarinerTargetFileName)</CblMarinerTargetPath>
37-
<CblMariner2TargetPath>$(InstallersOutputPath)$(CblMariner2TargetFileName)</CblMariner2TargetPath>
38-
34+
<CblMarinerBaseName>$(TargetingPackInstallerBaseName)-$(TargetingPackVersion)</CblMarinerBaseName>
35+
<CblMarinerExtension>-$(RpmArch).rpm</CblMarinerExtension>
36+
3937
<PackageVersion>$(TargetingPackVersionPrefix)</PackageVersion>
4038

4139
<!-- Set package revision to '1' for RTM releases, but include the build number in pre-releases -->

0 commit comments

Comments
 (0)