[release/8.0] Error out when NativeLib has EventPipe enabled (#90934)
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 22 Aug 2023 21:45:25 +0000 (15:45 -0600)
committerGitHub <noreply@github.com>
Tue, 22 Aug 2023 21:45:25 +0000 (15:45 -0600)
* Error out when NativeLib has EventPipe enabled

* Update src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets

Co-authored-by: Andy Gocke <andy@commentout.net>
* Update src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
---------

Co-authored-by: Lakshan Fernando <lakshanf@hotmail.com>
Co-authored-by: Andy Gocke <andy@commentout.net>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets

index 647aee4..32eefb3 100644 (file)
@@ -50,6 +50,8 @@
       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." />
+    <!-- See https://github.com/dotnet/runtime/issues/89346 for details -->
+    <Error Condition="'$(NativeLib)' != '' and '$(EventSourceSupport)' == 'true'" Text="EventSource is not supported when compiling to a native library. Set EventSourceSupport to false." />
 
     <Error Condition="'$(PublishTrimmed)' == 'false'" Text="PublishTrimmed is implied by native compilation and cannot be disabled." />