Skip to content

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

Merged
akoeplinger merged 1 commit into
dotnet:mainfrom
rolfbjarne:marshaling-scanner-typo
Mar 2, 2025
Merged

akoeplinger merged 1 commit into
dotnet:mainfrom
rolfbjarne:marshaling-scanner-typo

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings February 27, 2025 10:20
@ghost ghost added the area-Build-mono label Feb 27, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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).

@akoeplinger
akoeplinger merged commit 240ef65 into dotnet:main Mar 2, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants