Skip to content
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

[mono] Fix c&p error in MarshalingPInvokeScanner. #112983

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rolfbjarne
Copy link
Member

No description provided.

@Copilot Copilot bot review requested due to automatic review settings February 27, 2025 10:20

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR fixes a copy-and-paste error in the Enum type check within the marshaling type compatibility provider.

  • Changed the namespace check from typeDef.Namespace to baseType.Namespace to correctly validate the base type.

Reviewed Changes

File Description
src/tasks/MonoTargetsTasks/MarshalingPInvokeScanner/MinimalMarshalingTypeCompatibilityProvider.cs Fixed the comparison to properly use baseType for checking if the type is System.Enum

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/tasks/MonoTargetsTasks/MarshalingPInvokeScanner/MinimalMarshalingTypeCompatibilityProvider.cs:111

  • The check now correctly uses baseType.Namespace instead of typeDef.Namespace. Please ensure that this fix aligns with similar type checks throughout the code for consistency.
if (reader.GetString(baseType.Namespace) == "System" &&
@rolfbjarne
Copy link
Member Author

This fixes a problem where numerous BCL assemblies are flagged as requiring the marshal-ilgen component:

Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.Diagnostics.Process.dll requires marshal-ilgen for method .Sys:ConvertErrorPlatformToPal (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.Formats.Tar.dll requires marshal-ilgen for method .Sys:ConvertErrorPlatformToPal (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.IO.Compression.Brotli.dll requires marshal-ilgen for method .Brotli:BrotliDecoderDecompress (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.IO.Compression.dll requires marshal-ilgen for method .ZLib:DeflateInit2_ (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.IO.Compression.ZipFile.dll requires marshal-ilgen for method .Sys:ConvertErrorPlatformToPal (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.IO.FileSystem.DriveInfo.dll requires marshal-ilgen for method .Sys:ConvertErrorPlatformToPal (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.IO.FileSystem.Watcher.dll requires marshal-ilgen for method .Sys:ConvertErrorPlatformToPal (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.IO.MemoryMappedFiles.dll requires marshal-ilgen for method .Sys:ConvertErrorPlatformToPal (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.IO.Pipes.dll requires marshal-ilgen for method .Sys:ConvertErrorPlatformToPal (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.Net.Http.dll requires marshal-ilgen for method .CoreFoundation:CFNumberGetValue (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.Net.NameResolution.dll requires marshal-ilgen for method .Sys:GetNameInfo (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.Net.NetworkInformation.dll requires marshal-ilgen for method .CoreFoundation:<CFStringCreateWithCString>g____PInvoke|2_0 (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.Net.Ping.dll requires marshal-ilgen for method .Sys:Socket (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.Net.Primitives.dll requires marshal-ilgen for method .Sys:ConvertErrorPlatformToPal (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.Net.Security.dll requires marshal-ilgen for method .NetSecurityNative:<DisplayMinorStatus>g____PInvoke|7_0 (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.Net.Sockets.dll requires marshal-ilgen for method .Sys:ConvertErrorPlatformToPal (first pass).
Assembly /Users/rolf/test/dotnet/marshalling-scanner/tmp/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64/runtimes/maccatalyst-arm64/lib/net9.0/System.Net.WebSockets.dll requires marshal-ilgen for method .ZLib:DeflateInit2_ (first pass).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants