Skip to content

Commit 5c218ab

Browse files
Switch to non-incremental servicing and update ApiCompatNetCoreAppBaselineVersion to 9.0.0 (#109790)
* Update ApiCompatNetCoreAppBaselineVersion to 9.0.0 * Switch to non-incremental servicing by manually backporting 824bdd2 from release/9.0 --------- Co-authored-by: Eric StJohn <[email protected]> * Result of running: dotnet build src/libraries/apicompat/ApiCompat.proj /p:ApiCompatGenerateSuppresionFile=true * Update suppression files * Update NetCoreAppLatestStabel suppression file --------- Co-authored-by: Viktor Hofer <[email protected]>
1 parent 0b8addb commit 5c218ab

File tree

10 files changed

+18
-337
lines changed

10 files changed

+18
-337
lines changed

.github/PULL_REQUEST_TEMPLATE/servicing_pull_request_template.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ main PR <!-- Link to PR if any that fixed this in the main branch. -->
2222

2323
<!-- Please assess the risk of taking this fix. Provide details backing up your assessment. -->
2424

25-
# Package authoring signed off?
25+
# Package authoring no longer needed in .NET 9
2626

27-
IMPORTANT: If this change touches code that ships in a NuGet package, please make certain that you have added any necessary [package authoring](../../docs/project/library-servicing.md) and gotten it explicitly reviewed.
27+
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
28+
Keep in mind that we still need package authoring in .NET 8 and older versions.

.github/workflows/backport.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@ jobs:
4848
4949
- The PR target branch is `release/X.0-staging`, not `release/X.0`.
5050
51-
- If the change touches code that ships in a NuGet package, you have added the necessary [package authoring](https://github.com/dotnet/runtime/blob/main/docs/project/library-servicing.md) and gotten it explicitly reviewed.
51+
## Package authoring no longer needed in .NET 9
52+
53+
**IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
54+
Keep in mind that we still need package authoring in .NET 8 and older versions.

Directory.Build.props

+1-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@
120120
<NetFrameworkToolCurrent Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
121121
<NetFrameworkCurrent Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
122122

123-
<!-- Important: Set this to the GA version (or a close approximation) during servicing and adjust the TFM property below. -->
124-
<!-- TODO: Update to 9.0.0 when .NET 9 is generally available. https://github.com/dotnet/runtime/issues/106598 -->
125-
<ApiCompatNetCoreAppBaselineVersion>9.0.0-preview.7.24405.7</ApiCompatNetCoreAppBaselineVersion>
123+
<ApiCompatNetCoreAppBaselineVersion>9.0.0</ApiCompatNetCoreAppBaselineVersion>
126124
<ApiCompatNetCoreAppBaselineTFM>net9.0</ApiCompatNetCoreAppBaselineTFM>
127125
</PropertyGroup>
128126

docs/project/library-servicing.md

+6-13
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,15 @@ This document provides the steps that need to be followed after modifying a libr
44

55
Servicing branches represent shipped versions of .NET, and their name is in the format `release/X.0-staging`. Examples:
66

7+
- `release/9.0-staging`
78
- `release/8.0-staging`
8-
- `release/7.0-staging`
9-
- `release/6.0-staging`
109

11-
## Check if a package is generated
12-
13-
If a library is packable (check for the `<IsPackable>true</IsPackable>` property) you'll need to set `<GeneratePackageOnBuild>true</GeneratePackageOnBuild>` in the source project. That is necessary as packages aren't generated by default in servicing releases.
14-
15-
## Determine ServiceVersion
16-
17-
When you make a change to a library & ship it during the servicing release, the `ServicingVersion` must be bumped. This property is found in the library's source project. It's also possible that the property is not in that file, in which case you'll need to add it to the library's source project and set it to 1. If the property is already present in your library's source project, just increment the servicing version by 1.
10+
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
11+
Keep in mind that we still need package authoring in .NET 8 and older versions.
1812

1913
## Test your changes
2014

21-
All that's left is to ensure that your changes have worked as expected. To do so, execute the following steps:
15+
Develop and test your change as normal. For packages, you may want to test them outside the repo infrastructure. To do so, execute the following steps:
2216

2317
1. From a clean copy of your branch, run `build.cmd/sh libs -allconfigurations`
2418

@@ -34,9 +28,8 @@ All the servicing change must go through an approval process. You have two ways
3428
- By manually creating your PR using [this template](https://raw.githubusercontent.com/dotnet/runtime/main/.github/PULL_REQUEST_TEMPLATE/servicing_pull_request_template.md).
3529
- Or by asking the bot to automatically create the servicing PR for you using a merged `main` PR as source. This method requires typing an AzDO backport command as a comment of your merged PR using the format `/backport to release/X.0-staging`. Examples:
3630

31+
- `/backport to release/9.0-staging`
3732
- `/backport to release/8.0-staging`
38-
- `/backport to release/7.0-staging`
39-
- `/backport to release/6.0-staging`
4033

4134
For all cases, you must:
4235

@@ -52,4 +45,4 @@ For all cases, you must:
5245

5346
The area owner can then merge the PR once the CI looks good (it's either green or the failures are investigated and determined to be unrelated to the PR).
5447

55-
**Note**: Applying the `Servicing-approved` label ensures the `check-service-labels` CI job passes, which is a mandatory requirement for merging a PR in a servicing branch.
48+
**Note**: Applying the `Servicing-approved` label ensures the `check-service-labels` CI job passes, which is a mandatory requirement for merging a PR in a servicing branch.

eng/packaging.targets

-30
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
<PackageReadmeFilePath Condition="'$(PackageReadmeFilePath)' == '' and '$(EnableDefaultPackageReadmeFile)' == 'true'">PACKAGE.md</PackageReadmeFilePath>
2828
<BeforePack>$(BeforePack);ValidatePackageReadmeExists</BeforePack>
2929

30-
<!-- Non-shipping packages shouldn't incrementally serviced. -->
31-
<PackageUseIncrementalServicingVersion Condition="'$(IsShipping)' != 'true'">false</PackageUseIncrementalServicingVersion>
3230
<!-- Generate packages for rid specific projects or for allconfigurations during build. -->
3331
<!-- A package isn't generated if in servicing or in runtimelab. Intended to be overridden at project level. -->
3432
<IsRIDSpecificProject Condition="$(MSBuildProjectName.StartsWith('runtime.')) and
@@ -37,15 +35,7 @@
3735
'$(BuildAllConfigurations)' == 'true' or
3836
'$(IsRIDSpecificProject)' == 'true'
3937
) and
40-
(
41-
'$(PreReleaseVersionLabel)' != 'servicing' or
42-
'$(PackageUseIncrementalServicingVersion)' != 'true'
43-
) and
4438
'$(GitHubRepositoryName)' != 'runtimelab'">true</GeneratePackageOnBuild>
45-
<!-- When in source-build we need to generate all packages when building for all configurations even in servicing. -->
46-
<GeneratePackageOnBuild Condition="'$(GeneratePackageOnBuild)' != 'true' and
47-
'$(BuildAllConfigurations)' == 'true' and
48-
'$(DotNetBuildSourceOnly)' == 'true'">true</GeneratePackageOnBuild>
4939

5040
<!-- During NoBuild pack invocations, skip project reference build. Necessary for the IncludeProjectReferencesWithPackAttributeInPackage target. -->
5141
<BuildProjectReferences Condition="'$(NoBuild)' == 'true'">false</BuildProjectReferences>
@@ -58,18 +48,6 @@
5848
<NoWarn>$(NoWarn);CP0003</NoWarn>
5949
</PropertyGroup>
6050

61-
<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing' and
62-
'$(PackageUseIncrementalServicingVersion)' == 'true'">
63-
<!-- If no servicing version is set we need to default to 0 in order for dependency versions to
64-
be calculated properly, if we don't set it to 0, we would get the dependency version using the
65-
product Patch Version -->
66-
<ServicingVersion Condition="'$(ServicingVersion)' == ''">0</ServicingVersion>
67-
68-
<!-- Always update the package version in servicing. -->
69-
<Version>$(MajorVersion).$(MinorVersion).$(ServicingVersion)</Version>
70-
<Version Condition="'$(VersionSuffix)' != ''">$(Version)-$(VersionSuffix)</Version>
71-
</PropertyGroup>
72-
7351
<ItemGroup>
7452
<!-- Add a marker to help the designer optimize & share .NET Core packages -->
7553
<None Include="$(PackageDesignerMarkerFile)"
@@ -327,14 +305,6 @@
327305
</ItemGroup>
328306
</Target>
329307

330-
<Target Name="ValidateServicingVersionIsProperlySet"
331-
Condition="'$(PreReleaseVersionLabel)' == 'servicing' and
332-
'$(PackageUseIncrementalServicingVersion)' == 'true' and
333-
'$(DotNetBuildSourceOnly)' != 'true'"
334-
AfterTargets="GenerateNuspec">
335-
<Error Condition="'$(ServicingVersion)' == '0'" Text="ServicingVersion is set to 0 and it should be an increment of the patch version from the last released package." />
336-
</Target>
337-
338308
<Target Name="ValidatePackageReadmeExists"
339309
Condition="'$(PackageReadmeFilePath)' != '' and
340310
!Exists('$(PackageReadmeFilePath)')">

src/libraries/Directory.Build.props

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
<!-- We can't generate an apphost without restoring the targeting pack. -->
3636
<UseAppHost>false</UseAppHost>
3737
<EnableDefaultItems>false</EnableDefaultItems>
38-
<!-- Libraries packages use the incremental servicing infrastructure. -->
39-
<PackageUseIncrementalServicingVersion>true</PackageUseIncrementalServicingVersion>
4038
</PropertyGroup>
4139

4240
<!-- Language configuration -->

src/libraries/Directory.Build.targets

+2-3
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,11 @@
7272

7373
<!-- The assembly version gets updated during servicing when the assembly isn't part of a targeting pack. -->
7474
<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing' and
75-
'$(IsPackable)' == 'true' and
76-
'$(PackageUseIncrementalServicingVersion)' == 'true'">
75+
'$(IsPackable)' == 'true'">
7776
<_IsWindowsDesktopApp Condition="$(WindowsDesktopCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsWindowsDesktopApp>
7877
<_IsAspNetCoreApp Condition="$(AspNetCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsAspNetCoreApp>
7978
<_AssemblyInTargetingPack Condition="('$(IsNETCoreAppSrc)' == 'true' or '$(IsNetCoreAppRef)' == 'true' or '$(_IsAspNetCoreApp)' == 'true' or '$(_IsWindowsDesktopApp)' == 'true') and '$(TargetFrameworkIdentifier)' != '.NETFramework'">true</_AssemblyInTargetingPack>
80-
<AssemblyVersion Condition="'$(_AssemblyInTargetingPack)' != 'true'">$(MajorVersion).$(MinorVersion).0.$(ServicingVersion)</AssemblyVersion>
79+
<AssemblyVersion Condition="'$(_AssemblyInTargetingPack)' != 'true'">$(MajorVersion).$(MinorVersion).0.$(PatchVersion)</AssemblyVersion>
8180
</PropertyGroup>
8281

8382
<Import Project="$(RepositoryEngineeringDir)versioning.targets" />

src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/Microsoft.Extensions.Logging.Console.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
<ItemGroup>
1111
<Compile Include="$(CoreLibSharedDir)System\Runtime\CompilerServices\IsExternalInit.cs" Link="Common\System\Runtime\CompilerServices\IsExternalInit.cs" />
1212
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Console\src\Microsoft.Extensions.Logging.Console.csproj" SkipUseReferenceAssembly="true" />
13-
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\ref\System.Diagnostics.DiagnosticSource.csproj" />
13+
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\src\System.Diagnostics.DiagnosticSource.csproj" />
1414
</ItemGroup>
1515
</Project>

src/libraries/System.Collections.Specialized/src/CompatibilitySuppressions.xml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- https://learn.microsoft.com/dotnet/fundamentals/package-validation/diagnostic-ids -->
23
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
34
<!-- Type exposed publicly in implementation only for serialization purposes. -->
45
<Suppression>

0 commit comments

Comments
 (0)