-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Fix a typo and address remaining service reference TODO items #13364
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
Conversation
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.
@rainersigwald please let us know if you have additional suggestions
@@ -9,7 +9,7 @@ namespace Microsoft.Extensions.ApiDescription.Client | |||
/// <summary> | |||
/// Restore <see cref="ITaskItem"/>s from given property value. | |||
/// </summary> | |||
public class GetCurrentItems : Task | |||
public class GetCurrentOpenApiReference : Task |
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.
This one's for you @rynowak 😺
.../Extensions.ApiDescription.Client/src/build/Microsoft.Extensions.ApiDescription.Client.props
Show resolved
Hide resolved
...xtensions.ApiDescription.Client/src/build/Microsoft.Extensions.ApiDescription.Client.targets
Show resolved
Hide resolved
@@ -65,7 +65,7 @@ | |||
<!-- Unless this is an inner build or default timing is disabled, tie document retrieval into the build. --> | |||
|
|||
<Target Name="_GenerateOpenApiDocuments" | |||
AfterTargets="Build" | |||
AfterTargets="CoreBuild" |
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.
@rainersigwald is it expected that <MSBuild/>
tasks calling the Build
target can return to the project (and continue) before the referenced project does AfterBuild="Build"
work?
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.
Kind of! The semantics of "what does it mean to hook onto a project's entry-point target with AfterBuild" are very muddy.
Were you seeing execution return, or was it just continuing past an error in AfterTargets="Build"? If so, that's dotnet/msbuild#3345, which also goes into some of why the meaning of this is muddy.
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.
The occasional failures looked like a race condition between referenced projects building (including document generation) and the client project starting on its BeforeTargets="BeforeCompile"
work (getting filenames of generated documents). To see the output I recall, the server project must have been running two targets simultaneously -- GenerateOpenApiDocuments
and OpenApiGetDocuments
. In particular, I saw a <Message/>
about tool execution just before or just after an <Error/>
about a missing file that the command writes.
Put another way, I was seeing the occasional "client" (project with an @(OpenApiProjectReference)
item) build continue before the "server" (referenced project using this code) build completed. No errors until the client called the GetOpenApiDocuments
target when the server had not finished running GenerateOpenApiDocuments
.
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.
Interesting. I think something deeper is wrong in this case. Any chance you have an MSBuild binlog of a build like this? Even a build that didn't fail due to the race would be instructive.
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.
I'll get something to you early next week
...xtensions.ApiDescription.Client/src/build/Microsoft.Extensions.ApiDescription.Client.targets
Show resolved
Hide resolved
...escription.Server/src/buildMultiTargeting/Microsoft.Extensions.ApiDescription.Server.targets
Outdated
Show resolved
Hide resolved
.../Extensions.ApiDescription.Client/src/build/Microsoft.Extensions.ApiDescription.Client.props
Show resolved
Hide resolved
...xtensions.ApiDescription.Client/src/build/Microsoft.Extensions.ApiDescription.Client.targets
Outdated
Show resolved
Hide resolved
- #4923 - typo caused problems when cleaning files - add `%(OpenApiProjectReference.GlobalPropertiesToRemove)` metadata - address timing issues cropping up occasionally in builds using service ref features - avoid `AfterTargets="Build"`; referencing projects sometimes continue while post-build work is done - run after `CoreBuild` in inner builds and after `DispatchToInnerBuilds` in outer builds - do same in GetDocumentInsider.csproj - set only properties in buildMultiTargeting\Microsoft.Extensions.ApiDescription.Server.targets - items not evaluated early enough to reference in all cases - rename Microsoft.Extensions.ApiDescription.Client tasks - remove net461 task assembly
- don't remove `$(Configuration)` or `$(Platform)` global properties - move completely away from `AfterTargets="[Core]Build"` in these .targets and projects
48f7a01
to
c76266f
Compare
Getting this in. Only failures in required checks were either flaky-but-still-running-in-main or completely unrelated to what's changing here. |
%(OpenApiProjectReference.GlobalPropertiesToRemove)
metadataAfterTargets="Build"
; referencing projects sometimes continue while post-build work is doneCoreBuild
in inner builds and afterDispatchToInnerBuilds
in outer builds