Skip to content

Haiku: Initial managed libraries support#121880

Merged
jkotas merged 2 commits intodotnet:mainfrom
trungnt2910:dev/trungnt2910/haiku-lib-corelib
Apr 11, 2026
Merged

Haiku: Initial managed libraries support#121880
jkotas merged 2 commits intodotnet:mainfrom
trungnt2910:dev/trungnt2910/haiku-lib-corelib

Conversation

@trungnt2910
Copy link
Copy Markdown
Contributor

This contains the code required to build the first managed runtime libraries for Haiku, namely System.Private.CoreLib.

Part of #55803.

Copilot AI review requested due to automatic review settings November 21, 2025 14:26
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Nov 21, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Nov 21, 2025
@trungnt2910 trungnt2910 force-pushed the dev/trungnt2910/haiku-lib-corelib branch from 540d8bb to f20b31c Compare November 21, 2025 14:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 initial managed libraries support for Haiku OS by implementing the necessary interop and environment code for System.Private.CoreLib. The changes enable basic Haiku platform detection and working set memory queries.

  • Adds Haiku OS platform detection with TARGET_HAIKU constant
  • Implements WorkingSet property for Haiku using native area_info API
  • Provides comprehensive Haiku OS interop definitions (teams, threads, areas, system info)

Reviewed changes

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

Show a summary per file
File Description
src/libraries/System.Private.CoreLib/src/System/OperatingSystem.cs Adds TARGET_HAIKU constant to platform name detection
src/libraries/System.Private.CoreLib/src/System/Environment.Haiku.cs Implements WorkingSet property for Haiku by iterating process memory areas
src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems Configures conditional compilation for Haiku and includes required interop files
src/libraries/Common/src/Interop/Haiku/Interop.OS.cs Defines comprehensive Haiku OS interop structures, enums, and P/Invoke methods for process/thread/memory management
src/libraries/Common/src/Interop/Haiku/Interop.Libraries.cs Defines libroot library constant for Haiku interop
Comments suppressed due to low confidence (3)

src/libraries/Common/src/Interop/Haiku/Interop.OS.cs:209

  • The parameter documentation is incorrect. The who parameter is of type BTeamUsage (an enum specifying self or children), not "The thread ID". It should describe that this parameter specifies whether to get usage information for the team itself or its children.
    src/libraries/Common/src/Interop/Haiku/Interop.OS.cs:252
  • The parameter documentation should use <see cref="system_info"/> instead of just "system_info" for consistency with other parameter documentation in this file (e.g., lines 159, 170, 181, 210, 230, 242).
    src/libraries/Common/src/Interop/Haiku/Interop.OS.cs:86
  • The enum name thread_state uses snake_case which is inconsistent with C# naming conventions and the pattern used by other enums in this file (BTeamUsage, BPriority). It should be renamed to ThreadState to follow PascalCase naming convention.

@am11 am11 added area-System.Runtime os-haiku and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Nov 21, 2025
@trungnt2910
Copy link
Copy Markdown
Contributor Author

C/c @am11

Haiku's System.Diagnostics.Process depends on this so I will open that one later.

@am11
Copy link
Copy Markdown
Member

am11 commented Nov 21, 2025

Haiku's System.Diagnostics.Process depends on this so I will open that one later.

Each library has its own review team, and they’ll use your tests as a measure of correctness while providing feedback mainly on efficiency and code style. The individual PRs don’t need to build (there’s no Haiku CI here).

You could open two or three PRs in parallel if you want to speed up the upstream process (since you already have these patches in your fork tested for a while).

@trungnt2910
Copy link
Copy Markdown
Contributor Author

Haiku's System.Diagnostics.Process depends on this so I will open that one later.

What I meant was the two share a common file, Interop.OS.cs, so it will be hard to have both open concurrently.

@jeffhandley jeffhandley added the needs-author-action An issue or pull request that requires more info or actions from the author. label Feb 1, 2026
@trungnt2910
Copy link
Copy Markdown
Contributor Author

Still tracking, will take action soon.

@dotnet-policy-service dotnet-policy-service bot removed needs-author-action An issue or pull request that requires more info or actions from the author. no-recent-activity labels Feb 17, 2026
@jeffhandley jeffhandley added the needs-author-action An issue or pull request that requires more info or actions from the author. label Mar 23, 2026
@trungnt2910
Copy link
Copy Markdown
Contributor Author

Thanks for the reminder, and sorry for the delay. I will take action as soon as I can.

@dotnet-policy-service dotnet-policy-service bot removed needs-author-action An issue or pull request that requires more info or actions from the author. no-recent-activity labels Apr 6, 2026
@jkotas jkotas marked this pull request as draft April 6, 2026 15:26
@trungnt2910 trungnt2910 force-pushed the dev/trungnt2910/haiku-lib-corelib branch from f20b31c to 265e06b Compare April 9, 2026 09:57
Copilot AI review requested due to automatic review settings April 9, 2026 10:25
@trungnt2910 trungnt2910 force-pushed the dev/trungnt2910/haiku-lib-corelib branch from 265e06b to acf2867 Compare April 9, 2026 10:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

@trungnt2910
Copy link
Copy Markdown
Contributor Author

Local Haiku bootstrap builds are succeeding (after also applying #126701 and making some llvm-libunwind blocks compatible with downstream .NET patches - not sure the right way to do the latter).

The CI failures seem like unrelated WASM/Android targets. Most targets are passing.

Therefore, I am marking this PR for review again.

@trungnt2910 trungnt2910 marked this pull request as ready for review April 9, 2026 12:02
@trungnt2910 trungnt2910 force-pushed the dev/trungnt2910/haiku-lib-corelib branch from acf2867 to eef1222 Compare April 9, 2026 13:51
@trungnt2910 trungnt2910 requested a review from jkotas April 9, 2026 13:53
This contains the code required to build the first managed runtime
libraries for Haiku, namely `System.Private.CoreLib`.

Co-authored-by: Jessica Hamilton <jessica.l.hamilton@gmail.com>
Copilot AI review requested due to automatic review settings April 9, 2026 14:04
@trungnt2910 trungnt2910 force-pushed the dev/trungnt2910/haiku-lib-corelib branch from eef1222 to 54ada29 Compare April 9, 2026 14:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

@jkotas jkotas merged commit d38d8f7 into dotnet:main Apr 11, 2026
173 of 177 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Runtime community-contribution Indicates that the PR has been added by a community member os-haiku

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants