Skip to content

Commit 91630b3

Browse files
authored
Don't produce CBL-Mariner 1/2-specific packages (#15488)
1 parent 7ae3923 commit 91630b3

File tree

3 files changed

+19
-29
lines changed

3 files changed

+19
-29
lines changed

src/Microsoft.DotNet.Arcade.Sdk/tools/Sign.props

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
<FileExtensionSignInfo Include=".tgz" CertificateName="None" />
6868
<FileExtensionSignInfo Include=".tar.gz" CertificateName="None" />
6969
<!-- Note, RPMs can only be unpack/repacked on Linux. They can be signed on non-Linux -->
70+
<FileExtensionSignInfo Include=".azl.rpm" CertificateName="LinuxSignMariner" />
7071
<FileExtensionSignInfo Include=".rpm" CertificateName="LinuxSign" />
7172
<!-- Note, these can only be unpack/repacked on Mac. They can be signed on a non-Mac -->
7273
<FileExtensionSignInfo Include=".pkg" CertificateName="MacDeveloper" />

src/Microsoft.DotNet.Build.Tasks.Installers/build/installer.build.targets

+17-29
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,21 @@
8686
<ExeBundleInstallerEngineFile>$(PackageOutputPath)$(InstallerFileNameWithoutExtension)-engine.exe</ExeBundleInstallerEngineFile>
8787
</PropertyGroup>
8888

89+
<!--
90+
Packages produced for Azure Linux must be signed with a special certificate.
91+
RPM v4 doesn't support multiple signatures, so we must have two separate copies of the RPM for us to sign.
92+
To solve this, we make a copy of the RPM for Azure Linux, with the .azl.rpm extension (which the Arcade SDK will sign with the correct certificate).
93+
If Azure Linux ever switches to RPM v6, we should be able to remove this workaround if our signing tooling adds support for multiple signatures
94+
(something RPM v6 supports but RPM v4 does not).
95+
-->
8996
<PropertyGroup Condition="'$(GenerateRpm)' == 'true'">
90-
<CreateRPMForCblMariner>true</CreateRPMForCblMariner>
91-
<!-- PackageTargetOS is a distro-specific version suffix, used for deps packages, including the one for CBL Mariner.
92-
We do not want to create additional CBL Mariner named RPMs of those packages. -->
93-
<CreateRPMForCblMariner Condition="'$(PackageTargetOS)' != ''">false</CreateRPMForCblMariner>
97+
<CreateRPMForAzureLinux>true</CreateRPMForAzureLinux>
98+
<!-- PackageTargetOS is a distro-specific version suffix, used for deps packages, including the one for Azure Linux. -->
99+
<CreateRPMForAzureLinux Condition="'$(PackageTargetOS)' != ''">false</CreateRPMForAzureLinux>
94100
</PropertyGroup>
95101

96-
<PropertyGroup Condition="'$(CreateRPMForCblMariner)' == 'true'">
97-
<!-- CBL-Mariner 1.0 -->
98-
<_CblMarinerVersionSuffix>cm.1</_CblMarinerVersionSuffix>
99-
<_InstallerBuildPartCblMariner>$(Version)-$(_CblMarinerVersionSuffix)-$(_InstallerArchSuffix)</_InstallerBuildPartCblMariner>
100-
<_InstallerFileNameWithoutExtensionCblMariner>$(InstallerName)-$(_InstallerBuildPartCblMariner)$(CrossArchContentsBuildPart)</_InstallerFileNameWithoutExtensionCblMariner>
101-
<_InstallerFileCblMariner>$(PackageOutputPath)$(_InstallerFileNameWithoutExtensionCblMariner)$(InstallerExtension)</_InstallerFileCblMariner>
102-
<!-- CBL-Mariner 2.0 -->
103-
<_CblMariner2VersionSuffix>cm.2</_CblMariner2VersionSuffix>
104-
<_InstallerBuildPartCblMariner2>$(Version)-$(_CblMariner2VersionSuffix)-$(_InstallerArchSuffix)</_InstallerBuildPartCblMariner2>
105-
<_InstallerFileNameWithoutExtensionCblMariner2>$(InstallerName)-$(_InstallerBuildPartCblMariner2)$(CrossArchContentsBuildPart)</_InstallerFileNameWithoutExtensionCblMariner2>
106-
<_InstallerFileCblMariner2>$(PackageOutputPath)$(_InstallerFileNameWithoutExtensionCblMariner2)$(InstallerExtension)</_InstallerFileCblMariner2>
102+
<PropertyGroup Condition="'$(CreateRPMForAzureLinux)' == 'true'">
103+
<_InstallerFileAzureLinux>$(PackageOutputPath)$(InstallerFileNameWithoutExtension).azl$(InstallerExtension)</_InstallerFileAzureLinux>
107104
</PropertyGroup>
108105
</Target>
109106

@@ -415,26 +412,17 @@
415412
<Message Text="$(MSBuildProjectName) -> $(_InstallerFile)" Importance="high" />
416413
</Target>
417414

418-
<Target Name="_BuildMarinerRpms"
415+
<Target Name="_BuildAzureLinuxRpm"
419416
AfterTargets="GenerateRpm"
420-
Condition="'$(CreateRPMForCblMariner)' == 'true'">
421-
<!-- CBL-Mariner 1.0 -->
422-
<Copy SourceFiles="$(_InstallerFile)"
423-
DestinationFiles="$(_InstallerFileCblMariner)"
424-
OverwriteReadOnlyFiles="True"
425-
SkipUnchangedFiles="False"
426-
UseHardlinksIfPossible="False" />
427-
428-
<Message Text="$(MSBuildProjectName) -> $(_InstallerFileCblMariner)" Importance="high" />
429-
430-
<!-- CBL-Mariner 2.0 -->
417+
Condition="'$(CreateRPMForAzureLinux)' == 'true'">
418+
<!-- AzureLinux -->
431419
<Copy SourceFiles="$(_InstallerFile)"
432-
DestinationFiles="$(_InstallerFileCblMariner2)"
420+
DestinationFiles="$(_InstallerFileAzureLinux)"
433421
OverwriteReadOnlyFiles="True"
434422
SkipUnchangedFiles="False"
435423
UseHardlinksIfPossible="False" />
436424

437-
<Message Text="$(MSBuildProjectName) -> $(_InstallerFileCblMariner2)" Importance="high" />
425+
<Message Text="$(MSBuildProjectName) -> $(_InstallerFileAzureLinux)" Importance="high" />
438426
</Target>
439427

440428
<Target Name="GetRpmInstallerJsonProperties"

src/Microsoft.DotNet.SignTool/src/SignToolTask.cs

+1
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ int getCommonPrefixLength(string[] dir1, string[] dir2)
396396

397397
private readonly HashSet<string> specialExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
398398
{
399+
".azl.rpm",
399400
".tar.gz"
400401
};
401402

0 commit comments

Comments
 (0)