-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
We now permit servicing of our ref-packs. We should make sure that any change made to the ref-packs in servicing is API compatible with an un-serviced ref-pack.
This ensures that a library compiled against the serviced ref-pack will work with a GA runtime, or another un-serviced consuming compile (eg: in case of nuget packages).
The purpose of this would be to block API additions in servicing.
I think we can accomplish this in a similar way we do API compat with past release, restoring the GA-refpack.
runtime/src/libraries/shims/ApiCompat.proj
Lines 107 to 121 in b87e335
| <PropertyGroup> | |
| <PreviousNetCoreAppRefPath>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', '$(PreviousNetCoreAppPackageId)', '$(PreviousNetCoreAppPackageVersion)', 'ref', '$(PreviousNetCoreApp)'))</PreviousNetCoreAppRefPath> | |
| <_previousNetCoreAppBaselineFile>$(MSBuildThisFileDirectory)ApiCompatBaseline.PreviousNetCoreApp.txt</_previousNetCoreAppBaselineFile> | |
| <_previousNetCoreAppBaselineParam>--baseline "$(_previousNetCoreAppBaselineFile)"</_previousNetCoreAppBaselineParam> | |
| <_previousNetCoreAppBaselineParam Condition="'$(UpdatePreviousNetCoreAppBaseline)' == 'true'">> "$(_previousNetCoreAppBaselineFile)"</_previousNetCoreAppBaselineParam> | |
| </PropertyGroup> | |
| <Error Condition="'$(NetCoreAppCurrent)' != 'net5.0'" Text="Update value of PreviousNetCoreApp" /> | |
| <Error Condition="!Exists($(PreviousNetCoreAppRefPath))" Text="Missing reference assemblies for '$(PreviousNetCoreApp)'" /> | |
| <Exec Command="$(_ApiCompatCommand) "$(PreviousNetCoreAppRefPath.TrimEnd('\/'))" @"$(ApiCompatResponseFile)" $(_previousNetCoreAppBaselineParam)" | |
| CustomErrorRegularExpression="^[a-zA-Z]+ :" | |
| StandardOutputImportance="Low" | |
| IgnoreExitCode="true"> | |
| <Output TaskParameter="ExitCode" PropertyName="ApiCompatExitCode" /> | |
| </Exec> |
We should treat current ref-pack as "contract" and GA ref-pack as implementation. That will catch any case where a current reference couldn't be satisfied by GA ref-pack.
CC @dougbu since this sort of check would be interesting for AspNET as well.