Skip to content

Conversation

@ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer commented Jul 11, 2023

Fixes #42961

Enable strict mode comparison during servicing when ApiCompatNetCoreAppBaselineVersion is the current .NET version. When the GA targeting pack is released, that property should be updated which will turn on strict mode comparison and prohibits the addition of new API.

Suppressing one error in the baseline file that showed-up because out-of-band assemblies now being passed in as assembly references.

While at it I also cleaned-up how private assemblies are handled during the build.

Enable strict mode comparison during servicing when
`ApiCompatNetCoreAppBaselineVersion` is the current .NET version. When
the GA targeting pack is released, that property should be updated which
will turn on strict mode comparison and prohibits the addition of new
API.

Suppressing one error in the baseline file that showed-up because
out-of-band assemblies now being passed in as assembly references.

While at it I also cleaned-up how private assemblies are handled during
the build.
@ViktorHofer ViktorHofer requested a review from a team July 11, 2023 22:58
@ghost ghost assigned ViktorHofer Jul 11, 2023
@ghost
Copy link

ghost commented Jul 11, 2023

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Issue Details

Enable strict mode comparison during servicing when ApiCompatNetCoreAppBaselineVersion is the current .NET version. When the GA targeting pack is released, that property should be updated which will turn on strict mode comparison and prohibits the addition of new API.

Suppressing one error in the baseline file that showed-up because out-of-band assemblies now being passed in as assembly references.

While at it I also cleaned-up how private assemblies are handled during the build.

Author: ViktorHofer
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

@ViktorHofer ViktorHofer changed the title Fixes https://github.com/dotnet/runtime/issues/42961 Enable the option to invoke APICompat in strict mode for ref-pack servicing Jul 11, 2023
Comment on lines 15 to 19
<!-- In servicing, the live targeting pack is compared against the GA version in strict mode, without a suppression file. -->
<PropertyGroup Condition="'$(DotNetFinalVersionKind)' == 'servicing' and '$(ApiCompatNetCoreAppBaselineVersion)' == '$(NetCoreAppCurrentVersion)'">
<ApiCompatEnableStrictMode>true</ApiCompatEnableStrictMode>
<ApiCompatNetCoreAppLatestStableBaselineFile />
</PropertyGroup>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be useful to change the condition here to be Condition="'$(DotNetFinalVersionKind)' == 'servicing'" and use that as the forcing function to make sure we update ApiCompatNetCoreAppBaselineVersion? Or do we have a doc somewhere that has all of the steps to do to make sure that the version gets updated?

Copy link
Member Author

@ViktorHofer ViktorHofer Jul 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Pushed a commit that changes the condition. I also just noticed that with dotnet/sdk@a3303b6, unnecessary suppressions will be flagged which is another good forcing function to update the baseline.

@carlossanlop has a servicing doc. We need to add the following to it:

When changing the repository into servicing mode, the following needs to happen for APICompat:

  1. Update the ApiCompatNetCoreAppBaselineVersion property and point it to the latest available targeting pack version (the closest one to the GA version). Adjust the ApiCompatNetCoreAppBaselineTFM property as well (i.e. when switching from 7.0.0 to 8.0.0-rc2...., the TFM changes from net7.0 to net8.0).
  2. APICompat will then complain about unnecessary suppressions in the baseline files. Remove all unnecessary files / entries from the suppression files.

With that, introducing a new API or breaking change in servicing is now guarded against.

@ViktorHofer ViktorHofer merged commit b9c9964 into main Jul 13, 2023
@ViktorHofer ViktorHofer deleted the ApiCompatRefPackServicing branch July 13, 2023 07:10
@ghost ghost locked as resolved and limited conversation to collaborators Aug 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

APICompat for ref-pack servicing

3 participants