Open airbreather opened 3 years ago
cc @joperezr @safern @ericstj
If you agree that this is perfectly non-breaking, do you think that this might merit a change to ApiCompat to have the tool include that wisdom as one or more special-cases?
I completely agree that API Compat should be smarter for the way it handles attributes. Currently it is a pretty "simple" implementation of comparing left vs right value of the attribute and its constructor arguments.
It also, doesn't filter compiler generated attributes, however we don't want to filter all of them, i.e ReadOnlyAttribute
is the way the readonly
keyword is expressed on metadata.
Anyway, we started rewriting API Compat as part of the 6.0 release and it is part of the SDK. However it is not complete and is lacking some rules (this one included), but when we add this rule we plan on doing it in a smarter way to consider these kind of scenarios. You can follow our progress on that here: https://github.com/dotnet/sdk/issues/18678
In the meantime as a workaround, you can use a file to exclude certain attributes you don't care on your API Compat runs. i.e: https://github.com/dotnet/runtime/blob/main/eng/DefaultGenApiDocIds.txt
Then you can set an MSBuild property <ApiCompatExcludeAttributeList>
pointing to the path of the file containing the attributes to ignore, and API Compat should no longer consider those attributes as part of your compatibility run.
This issue is blocking(we can re-baseline)This issue is causing unreasonable pain(package is still a prerelease, so pain is reasonable)The PR validation build for NetTopologySuite/NetTopologySuite#548 initially failed (https://github.com/NetTopologySuite/NetTopologySuite/runs/3599391887) with the following error:
I understand and appreciate that this rule is going to be a bit on the sensitive side, and I know that we can baseline issues like these that do not, in my judgment, signal that there are actual compatibility issues.
Two questions: