Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/9.0-staging] Switch to non-incremental servicing #109316

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ main PR <!-- Link to PR if any that fixed this in the main branch. -->

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

# Package authoring signed off?
# Package authoring no longer needed in .NET 9

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.
carlossanlop marked this conversation as resolved.
Show resolved Hide resolved
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.
5 changes: 4 additions & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ jobs:

- The PR target branch is `release/X.0-staging`, not `release/X.0`.

- 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.
carlossanlop marked this conversation as resolved.
Show resolved Hide resolved
## Package authoring no longer needed in .NET 9

**IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
<NetFrameworkCurrent Condition="'$(DotNetBuildSourceOnly)' == 'true'" />

<!-- Important: Set this to the GA version (or a close approximation) during servicing and adjust the TFM property below. -->
<ApiCompatNetCoreAppBaselineVersion>8.0.0</ApiCompatNetCoreAppBaselineVersion>
<ApiCompatNetCoreAppBaselineTFM>net8.0</ApiCompatNetCoreAppBaselineTFM>
<ApiCompatNetCoreAppBaselineVersion>9.0.0-rtm.24516.5</ApiCompatNetCoreAppBaselineVersion>
carlossanlop marked this conversation as resolved.
Show resolved Hide resolved
<ApiCompatNetCoreAppBaselineTFM>net9.0</ApiCompatNetCoreAppBaselineTFM>
</PropertyGroup>

<PropertyGroup Label="CalculateConfiguration">
Expand Down
11 changes: 3 additions & 8 deletions docs/project/library-servicing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ Servicing branches represent shipped versions of .NET, and their name is in the
- `release/7.0-staging`
- `release/6.0-staging`

## Check if a package is generated

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.

## Determine ServiceVersion

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.
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

## Test your changes

All that's left is to ensure that your changes have worked as expected. To do so, execute the following steps:
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:

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

Expand Down
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project>
<PropertyGroup>
<!-- The .NET product branding version -->
<ProductVersion>9.0.0</ProductVersion>
<ProductVersion>9.0.1</ProductVersion>
<!-- File version numbers -->
<MajorVersion>9</MajorVersion>
<MinorVersion>0</MinorVersion>
<PatchVersion>0</PatchVersion>
<PatchVersion>1</PatchVersion>
<SdkBandVersion>9.0.100</SdkBandVersion>
<PackageVersionNet8>8.0.11</PackageVersionNet8>
<PackageVersionNet7>7.0.20</PackageVersionNet7>
<PackageVersionNet6>6.0.36</PackageVersionNet6>
<PreReleaseVersionLabel>rtm</PreReleaseVersionLabel>
<PreReleaseVersionLabel>servicing</PreReleaseVersionLabel>
<PreReleaseVersionIteration>
</PreReleaseVersionIteration>
<!-- Enable to remove prerelease label. -->
Expand Down
30 changes: 0 additions & 30 deletions eng/packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
<PackageReadmeFilePath Condition="'$(PackageReadmeFilePath)' == '' and '$(EnableDefaultPackageReadmeFile)' == 'true'">PACKAGE.md</PackageReadmeFilePath>
<BeforePack>$(BeforePack);ValidatePackageReadmeExists</BeforePack>

<!-- Non-shipping packages shouldn't incrementally serviced. -->
<PackageUseIncrementalServicingVersion Condition="'$(IsShipping)' != 'true'">false</PackageUseIncrementalServicingVersion>
<!-- Generate packages for rid specific projects or for allconfigurations during build. -->
<!-- A package isn't generated if in servicing or in runtimelab. Intended to be overridden at project level. -->
<IsRIDSpecificProject Condition="$(MSBuildProjectName.StartsWith('runtime.')) and
Expand All @@ -37,15 +35,7 @@
'$(BuildAllConfigurations)' == 'true' or
'$(IsRIDSpecificProject)' == 'true'
) and
(
'$(PreReleaseVersionLabel)' != 'servicing' or
'$(PackageUseIncrementalServicingVersion)' != 'true'
) and
'$(GitHubRepositoryName)' != 'runtimelab'">true</GeneratePackageOnBuild>
<!-- When in source-build we need to generate all packages when building for all configurations even in servicing. -->
<GeneratePackageOnBuild Condition="'$(GeneratePackageOnBuild)' != 'true' and
'$(BuildAllConfigurations)' == 'true' and
'$(DotNetBuildSourceOnly)' == 'true'">true</GeneratePackageOnBuild>

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

<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing' and
'$(PackageUseIncrementalServicingVersion)' == 'true'">
<!-- If no servicing version is set we need to default to 0 in order for dependency versions to
be calculated properly, if we don't set it to 0, we would get the dependency version using the
product Patch Version -->
<ServicingVersion Condition="'$(ServicingVersion)' == ''">0</ServicingVersion>

<!-- Always update the package version in servicing. -->
<Version>$(MajorVersion).$(MinorVersion).$(ServicingVersion)</Version>
<Version Condition="'$(VersionSuffix)' != ''">$(Version)-$(VersionSuffix)</Version>
</PropertyGroup>

<!-- Main packages intentionally don't include assets for net6.0 and net7.0 anymore. -->
<ItemGroup>
<PackageValidationBaselineFrameworkToIgnore Include="net6.0" />
Expand Down Expand Up @@ -325,14 +303,6 @@
</ItemGroup>
</Target>

<Target Name="ValidateServicingVersionIsProperlySet"
Condition="'$(PreReleaseVersionLabel)' == 'servicing' and
'$(PackageUseIncrementalServicingVersion)' == 'true' and
'$(DotNetBuildSourceOnly)' != 'true'"
AfterTargets="GenerateNuspec">
<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." />
</Target>

<Target Name="ValidatePackageReadmeExists"
Condition="'$(PackageReadmeFilePath)' != '' and
!Exists('$(PackageReadmeFilePath)')">
Expand Down
2 changes: 0 additions & 2 deletions src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
<!-- We can't generate an apphost without restoring the targeting pack. -->
<UseAppHost>false</UseAppHost>
<EnableDefaultItems>false</EnableDefaultItems>
<!-- Libraries packages use the incremental servicing infrastructure. -->
<PackageUseIncrementalServicingVersion>true</PackageUseIncrementalServicingVersion>
</PropertyGroup>

<!-- Language configuration -->
Expand Down
5 changes: 2 additions & 3 deletions src/libraries/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@

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

<Import Project="$(RepositoryEngineeringDir)versioning.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<ItemGroup>
<Compile Include="$(CoreLibSharedDir)System\Runtime\CompilerServices\IsExternalInit.cs" Link="Common\System\Runtime\CompilerServices\IsExternalInit.cs" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Console\src\Microsoft.Extensions.Logging.Console.csproj" SkipUseReferenceAssembly="true" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\ref\System.Diagnostics.DiagnosticSource.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\src\System.Diagnostics.DiagnosticSource.csproj" />
</ItemGroup>
</Project>

This file was deleted.

Loading
Loading