-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Error out when NativeLib has EventPipe enabled #90811
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsEventPipe does not work correctly with native AOT library (#89346). We will generate an error when
|
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
Outdated
Show resolved
Hide resolved
…e.Publish.targets Co-authored-by: Andy Gocke <[email protected]>
@@ -50,6 +50,7 @@ | |||
Text="RuntimeIdentifier is required for native compilation. Try running dotnet publish with the -r option value specified." /> | |||
<Error Condition="'$(GeneratePackageOnBuild)' == 'true'" Text="GeneratePackageOnBuild is not supported for native compilation." /> | |||
<Error Condition="'$(OutputType)' != 'Library' and '$(NativeLib)' != '' and '$(CustomNativeMain)' != 'true'" Text="NativeLib requires OutputType=Library." /> | |||
<Error Condition="'$(NativeLib)' != '' and '$(EventSourceSupport)' == 'true'" Text="EventSource is not supported when compiling to a native library. Set EventSourceSupport to false." /> |
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.
Should we update the native AOT diagnostics doc you added to call out that it is not supported for native libraries?
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'm not sure on this one, as in this is too much of a corner case to call out on the official documentation and this error should be sufficient enough.
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
Show resolved
Hide resolved
…e.Publish.targets Co-authored-by: Jan Kotas <[email protected]>
/backport to release/8.0 |
Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/5941905358 |
This reverts commit e811599.
Works around #89346. We blocked event pipe completely in shared libraries in #90811 but: * Elinor found out the shutdown problem is actually Windows specific, so blocking Linux (our most important target) is unnecessary. * We can avoid the hang at the cost of corrupting the ongoing event pipe session by just not doing the shutdown. This can be worked around by simply stopping the event pipe session at dotnet-trace side manually. I validated the shared library scenario no longer hangs at shutdown with this. #89346 still tracks if we can do better here.
This reverts commit e811599.
EventPipe does not work correctly with native AOT library (#89346). We will generate an error when
EventSourceSupport
property is set for native aot library.