Skip to content

Haiku: Mark unsupported advanced network functions - #121882

Merged
MihaZupan merged 3 commits into
dotnet:mainfrom
trungnt2910:dev/trungnt2910/haiku-lib-networkinformation
Dec 15, 2025
Merged

Haiku: Mark unsupported advanced network functions#121882
MihaZupan merged 3 commits into
dotnet:mainfrom
trungnt2910:dev/trungnt2910/haiku-lib-networkinformation

Conversation

@trungnt2910

Copy link
Copy Markdown
Contributor

Add the UnsupportedOSPlatformAttribute for Haiku to managed network functions in System.Net.NetworkInformation to provide a consistent API on Haiku.

Part of #55803.

CopilotAI review requested due to automatic review settings November 21, 2025 14:46
@dotnet-policy-servicedotnet-policy-serviceBot added the community-contribution Indicates that the PR has been added by a community member label Nov 21, 2025
@trungnt2910

Copy link
Copy Markdown
ContributorAuthor

C/c @am11

This one should be quite simple.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

@huoyaoyuan

Copy link
Copy Markdown
Member

We should also want the attributes in ref source https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.NetworkInformation/ref/System.Net.NetworkInformation.cs , which matches illumos and solaris.

CopilotAI 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.

Pull request overview

This PR adds UnsupportedOSPlatform("haiku") attributes to network functions in System.Net.NetworkInformation that are not supported on the Haiku operating system, providing compile-time warnings to developers using these APIs on Haiku.

  • Adds Haiku platform annotations to match existing illumos/solaris unsupported APIs
  • Ensures consistent platform API surface across Unix-like operating systems
  • Part of broader effort to properly support Haiku platform (issue #55803)

Reviewed changes

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

Show a summary per file
FileDescription
UnixUnicastIPAddressInformation.csAdded Haiku unsupported attributes to 8 properties related to DNS eligibility, address lifetimes, DHCP, and address detection
UnixMulticastIPAddressInformation.csAdded Haiku unsupported attributes to 8 properties mirroring unicast address information properties
UnixIPGlobalProperties.csAdded Haiku unsupported attributes to DhcpScopeName and IsWinsProxy properties
NetworkInterfacePal.UnknownUnix.csAdded Haiku unsupported attributes to 4 PAL methods for network interface operations
NetworkInterface.csAdded Haiku unsupported attributes to 4 public static methods/properties for network interface access
NetworkAddressChange.Windows.csAdded Haiku unsupported attributes to 2 network change event handlers
NetworkAddressChange.UnknownUnix.csAdded Haiku unsupported attributes to 2 network change event handlers
NetworkAddressChange.Unix.csAdded Haiku unsupported attributes to 2 network change event handlers
NetworkAddressChange.OSX.csAdded Haiku unsupported attributes to 2 network change event handlers
NetworkAddressChange.Android.csAdded Haiku unsupported attributes to 2 network change event handlers
IPGlobalPropertiesPal.UnknownUnix.csAdded Haiku unsupported attribute to GetIPGlobalProperties PAL method
IPGlobalProperties.csAdded Haiku unsupported attribute to GetIPGlobalProperties public method

@am11

am11 commented Nov 21, 2025

Copy link
Copy Markdown
Member

@trungnt2910, I think it is ok to bypass the network info API for the time being, but please note that illumos has two/three arch-dependent libs left to port and NetworkInformation is one of them. Generally, it's better to follow FreeBSD's lead as it's more complete surface area when deciding what's ok to "skip" in the built SDK/shared framework.

@trungnt2910

Copy link
Copy Markdown
ContributorAuthor

@trungnt2910, I think it is ok to bypass the network info API for the time being, but please note that illumos has two/three arch-dependent libs left to port and NetworkInformation is one of them. Generally, it's better to follow FreeBSD's lead as it's more complete surface area when deciding what's ok to "skip" in the built SDK/shared framework.

@am11 I am not blindly following illumos, at least in 2023 when I was porting the managed libraries. I tried to implement as many APIs relevant to Haiku as possible.

Haiku does not have the same kind of magic socket/socket options that Linux and FreeBSD have to fit into the current implementations in System.Native.

I made an attempt to squish what Haiku offers into the current codebase for NetworkInformation a while ago, but it didn't go quite well. To support this we will need some significant Haiku-specific implementations across System.Native and the managed libraries.

Add the `UnsupportedOSPlatformAttribute` for Haiku to managed network
functions in `System.Net.NetworkInformation` to provide a consistent
API on Haiku.
@trungnt2910
trungnt2910force-pushed the dev/trungnt2910/haiku-lib-networkinformation branch from a3eb741 to 23addbbCompareNovember 21, 2025 15:39
@trungnt2910

Copy link
Copy Markdown
ContributorAuthor

Added the attributes in the reference source file.

Guard some advanced network APIs that are marked "unsupported" by Haiku
with compile time macros.
@MihaZupan
MihaZupan enabled auto-merge (squash) December 15, 2025 17:42
@MihaZupanMihaZupan added this to the 11.0.0 milestone Dec 15, 2025
@MihaZupan
MihaZupan merged commit 2080516 into dotnet:mainDec 15, 2025
85 checks passed
@github-actionsgithub-actionsBot locked and limited conversation to collaborators Jan 15, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Netcommunity-contributionIndicates that the PR has been added by a community memberos-haiku

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@trungnt2910@huoyaoyuan@am11@MihaZupan@liveans