Haiku: Native support#126805
Open
trungnt2910 wants to merge 1 commit intodotnet:mainfrom
Open
Conversation
This is the rest of the changes to the native code of .NET from the initial porting effort in 2023.
3944abc to
646589b
Compare
Member
|
Mono portion of this repo is only for mobile and browser/wasm platforms and it will eventually go away when CoreCLR replaces them, which is actively being worked on. For desktop platforms, CoreCLR and NativeAOT are the main focus going forward. |
This was referenced Apr 22, 2026
kotlarmilos
pushed a commit
that referenced
this pull request
Apr 27, 2026
#127274) Fixes System.Console.Tests failures on MacCatalyst discovered in runtime-extra-platforms build [#1388505](https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1388505). ## Failure **Build**: [#1388505](https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1388505) (2026-04-21) **Job**: `maccatalyst-arm64 Release AllSubsets_Mono` **Helix job**: `f4caa84e-1526-4c12-a872-6f24ac6f3ba1` **Work item**: System.Console.Tests **Platform**: MacCatalyst arm64 (also affects maccatalyst-x64) ### Failed tests Four tests failed with `PlatformNotSupportedException`: 1. `OpenStandardInputHandle_ReturnsValidHandle` 2. `OpenStandardOutputHandle_ReturnsValidHandle` 3. `OpenStandardErrorHandle_ReturnsValidHandle` 4. `OpenStandardHandles_DoNotOwnHandle` ````text [FAIL] System.Tests.ConsoleTests.OpenStandardInputHandle_ReturnsValidHandle System.PlatformNotSupportedException : Operation is not supported on this platform. at System.ConsolePal.OpenStandardInputHandle() at System.Console.OpenStandardInputHandle() ```` ### Root cause The `Console.OpenStandardXXXHandle()` methods throw `PlatformNotSupportedException` on mobile platforms (iOS, tvOS, Android, MacCatalyst) because these platforms do not expose the underlying file handles for standard streams. The existing tests already had `[PlatformSpecific]` attributes excluding iOS, tvOS, and Android, but **MacCatalyst was missing** from the exclusion list. This is an oversight because MacCatalyst has the same limitation as other Apple mobile platforms. ### Fix Add `TestPlatforms.MacCatalyst` to the exclusion list (using `& ~TestPlatforms.MacCatalyst`) on all five tests that attempt to use these APIs, and add it to the inclusion list on the three "ThrowsOnUnsupportedPlatforms" tests that validate the exception is thrown. This makes the skip coverage consistent across all mobile platforms: - Skip on: iOS, tvOS, MacCatalyst, Android, Browser (where applicable) - Run on: Windows, Linux, macOS desktop ## Testing After this fix, the four failing tests will be skipped on MacCatalyst in the `runtime-extra-platforms` pipeline, matching the behavior on iOS, tvOS, and Android. --- > [!NOTE] > This PR was created by GitHub Copilot after analyzing mobile platform CI failures in the runtime-extra-platforms pipeline (build 1388505). > [!NOTE] > <details> > <summary>🔒 Integrity filter blocked 1 item</summary> > > The following item were blocked because they don't meet the GitHub integrity level. > > - [#126805](#126805) `search_pull_requests`: has lower integrity than agent requires. The agent cannot read data with integrity below "approved". > > To allow these resources, lower `min-integrity` in your GitHub frontmatter: > > ```yaml > tools: > github: > min-integrity: approved # merged | approved | unapproved | none > ``` > > </details> > Generated by [Mobile Platform Failure Scanner](https://github.com/dotnet/runtime/actions/runs/24774805343/agentic_workflow) · ● 2.2M · [◷](https://github.com/search?q=repo%3Adotnet%2Fruntime+%22gh-aw-workflow-id%3A+mobile-scan%22&type=pullrequests) <!-- gh-aw-agentic-workflow: Mobile Platform Failure Scanner, engine: copilot, model: claude-sonnet-4.5, id: 24774805343, workflow_id: mobile-scan, run: https://github.com/dotnet/runtime/actions/runs/24774805343 --> <!-- gh-aw-workflow-id: mobile-scan --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
kotlarmilos
added a commit
that referenced
this pull request
Apr 28, 2026
> [!NOTE]
> This content was generated by GitHub Copilot.
## Summary
Fixes
`System.Net.NameResolution.Functional.Tests.GetHostEntryTest.DnsGetHostEntry_LocalHost_ReturnsFqdnAndLoopbackIPs`
test failure on Android by skipping the test on that platform.
## Background
The test assumes that resolving "localhost" returns only loopback IP
addresses (`127.0.0.1` and `::1`). However, on Android Helix machines
(emulators), the DNS resolution for "localhost" returns actual network
interfaces in addition to loopback addresses, causing the test to fail
with assertions like:
`````
Assert.All() Failure: 5 out of 6 items in the collection did not pass.
[1]: Item: fe80::e05a:f2ff:fee9:6ae6%47
Error: Not a loopback address: fe80::e05a:f2ff:fee9:6ae6%47
[2]: Item: 2001:4898:502:2:e05a:f2ff:fee9:6ae6
Error: Not a loopback address: 2001:4898:502:2:e05a:f2ff:fee9:6ae6
[5]: Item: 10.64.32.211
Error: Not a loopback address: 10.64.32.211
````
## Changes
Added `[SkipOnPlatform(TestPlatforms.Android, ...)]` attribute to the
failing test, consistent with existing skips for iOS, tvOS, and
MacCatalyst on the same test (which have similar issues).
## Failure Details
**Build:**
https://dev.azure.com/dnceng-public/public/_build/results?buildId=1396313
**Job:** `android-arm64 Release AllSubsets_Mono`
**Helix Work Item:** System.Net.NameResolution.Functional.Tests
- Job ID: `93091357-214b-436d-a5c4-a31ee456a876`
- Console log:
https://helix.dot.net/api/2019-06-17/jobs/93091357-214b-436d-a5c4-a31ee456a876/workitems/System.Net.NameResolution.Functional.Tests/console
**Log excerpt (sanitized):**
````
04-25 00:03:35.029 DOTNET : [FAIL] System.Net.NameResolution.Tests.GetHostEntryTest.DnsGetHostEntry_LocalHost_ReturnsFqdnAndLoopbackIPs(mode: 0)
04-25 00:03:35.029 DOTNET : Assert.All() Failure: 5 out of 6 items in the collection did not pass.
04-25 00:03:35.029 DOTNET : [5]: Item: 10.64.32.211
04-25 00:03:35.029 DOTNET : Error: Not a loopback address: 10.64.32.211
`````
## Related
- Existing skip on iOS/tvOS/MacCatalyst: #124079
- Similar Wasi skip: #107339
> [!NOTE]
> <details>
> <summary>🔒 Integrity filter blocked 1 item</summary>
>
> The following item were blocked because they don't meet the GitHub
integrity level.
>
> - [#126805](#126805)
`search_pull_requests`: has lower integrity than agent requires. The
agent cannot read data with integrity below "approved".
>
> To allow these resources, lower `min-integrity` in your GitHub
frontmatter:
>
> ```yaml
> tools:
> github:
> min-integrity: approved # merged | approved | unapproved | none
> ```
>
> </details>
> Generated by [Mobile Platform Failure
Scanner](https://github.com/dotnet/runtime/actions/runs/24929356562/agentic_workflow)
· ● 4.1M ·
[◷](https://github.com/search?q=repo%3Adotnet%2Fruntime+%22gh-aw-workflow-id%3A+mobile-scan%22&type=pullrequests)
<!-- gh-aw-agentic-workflow: Mobile Platform Failure Scanner, engine:
copilot, model: claude-sonnet-4.5, id: 24929356562, workflow_id:
mobile-scan, run:
https://github.com/dotnet/runtime/actions/runs/24929356562 -->
<!-- gh-aw-workflow-id: mobile-scan -->
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kotlarmilos <11523312+kotlarmilos@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the rest of the changes to the native code of .NET from the initial porting effort in 2023.
Part of #55803.