-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Try to re-enable APICompat in aspnetcore #45872
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
base: main
Are you sure you want to change the base?
Conversation
/azp run sdk-unified-build |
Azure Pipelines successfully started running 1 pipeline(s). |
This should fix it, assuming we use live SDK (or task). If not, we need to wait for the SDK used by unified build to be updated. |
We don't use live. AspNetCore builds before sdk. We need a toolset update. |
How do we update the toolset used by the unified build? Is that just the toolset used in SDK, some other place specific to UB, or do we need to update every repo? |
638f4f1 shows a re-bootstrap change. Such a PR will get opened through a special pipeline: https://github.com/dotnet/source-build/blob/main/Documentation/VMR-re-bootstrapping.md#steps-to-re-bootstrap I only got another APICompat change merged earlier today and the dotnet-source-build pipeline that is used for re-bootstrapping runs once per day. I think we should wait until Monday with re-boostrapping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (1)
- src/SourceBuild/content/repo-projects/aspnetcore.proj: Language not supported
Looks like the APICompat issue or another variant of it still exists in the product. @ericstj would you mind taking another look? |
Is the build of this SDK "special" in any way? Where can I get the binaries?
Update -- found in logs -- https://ci.dot.net/public/Sdk/10.0.100-preview.2.25112.53/dotnet-sdk-10.0.100-preview.2.25112.53-win-x64.zip |
It could be that Roslyn is now using a newer version of one of these dependencies than is redirected by MSBuild. |
In the same binlog there are successful runs and failures. It seems to be about 50/50 I'm also seeing this in the same log -- compiler toolset package So two different versions of roslyn loaded depending on the project built. I wonder if this has something to do with it? Perhaps the task binds to a different roslyn version and future runs of that task fail if using a different version? The types involved with this method signature come from Microsoft.CodeAnalysis and System.Collections.Immutable. I think with the changes from #46019 both task and Roslyn should be referencing a version of SCI <= MSBuild's bindingRedirects - so both should get the same version. The mismatch of MCS should have been solved with #22277 - but given we have a toolset package involved here it seems fishy enough that it could be related. |
I found what's happening here. In this situation the SDK was built with a newer MSBuild than the VS it is running on that triggers this: sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets Lines 223 to 236 in bacea4e
But only in inner-builds since these targets are only imported in inner builds. The result is that any multi-targeted project in aspnetcore will run ApiCompat with MSBuild's roslyn (version A), where non-multi-targeted projects run with the toolset package's Roslyn (version B). Add to this that non-multi-targeted projects create zero work for ApiCompat since Baseline checking is disabled. This causes APICompat to only load There are a number of ways to fix this. To workaround we can either disable the toolset compiler, or lift the same logic that was in the inner-build to outerbuild for selecting a toolset roslyn package. To fix this in APICompat we can do one of two things:
|
Now all of the failures are
So it would seem we must go the other way and force the toolset compiler to be used in outer build. I will see about the best way to do that. |
Tracking issue: #45004
AspNetCore builds with desktop msbuild