Repository navigation
API Compat fixes - #9254
Merged
Merged
API Compat fixes#9254
Conversation
We should never hit this, but the behavior before was to iterate forever. Now it will break and assume the default behavior.
Member
Author
|
I have tested this change in dotnet/runtime. |
bartonjs
approved these changes
May 3, 2022
ViktorHofer
approved these changes
May 4, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses two problems with API compat. Fixes dotnet/runtime#68699
The first issue is that the task would never fail the build, even when it had errors. This happened due to the task refactoring where it lost functionality provided by the exec task which would change the error code to -1 if the task logged errors but otherwise returned 0. I just copied that from ToolTask:
https://github.com/dotnet/msbuild/blob/10dbde3bf1986251a5e958af8c7391ad0d9e7f11/src/Utilities/ToolTask.cs#L761-L765
The second issue is that the task failed when consuming the System.Runtime facade and running on .NETFramework. Details are in the linked issue. I considered actually looking for the System.Object typeforward and following that but resolving TypeForwards in CCI actually requires this same code-path, which caused this to be re-entrant. I was able to workaround that by capturing state to determine when the method was re-entrant but that complicated the solution. Instead I chose to go with a simpler heuristic -> just push down into the references of the assembly. This will eventually find an assembly that defines System.Object.
There is the chance that this hits a cycle. For example if someone had a
System.Runtimefacade with all typeforwards tomscorliband anmscorlibwith all typeforwards toSystem.Runtime. Previously we'd just bail from this loop and fallback to corelib used by CCI (since CCI didn't understand full facades). I didn't hit this in my testing but I can't abide leaving it since anyone hitting it would see a hang, so I also added a check for this and preserved the old behavior.