Uh oh!
There was an error while loading. Please reload this page.
Add Process tests for MacCatalyst and fix MacCatalyst support - #126306
Conversation
- Add $(NetCoreAppCurrent)-maccatalyst to TargetFrameworks - Include Unix interop files for maccatalyst target - Create ProcessTests.MacCatalyst.cs with tests for Process.Start, I/O redirection, process killing, exit codes, and process names modeled on ProcessTests.Android.cs Fixes: tests cannot run on MacCatalyst because RemoteExecutor is not supported Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/6cbdf5a5-19f7-46b1-acab-3a4a9f5a6dde Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com>
adamsitnik
commented
Mar 30, 2026
/azp list |
This comment was marked as resolved.
This comment was marked as resolved.
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process |
adamsitnik
commented
Mar 30, 2026
/azp run runtime-maccatalyst |
|
Azure Pipelines successfully started running 1 pipeline(s). |
@rolfbjarne@akoeplinger@vitek-karas I am going to need some help, as this failure does not tell me anything: [08:54:54]info:Preparingrun for maccatalyst
[08:54:54]info:Gettingapp bundle information from '/tmp/helix/working/B5070A06/w/A65C0914/e/System.Diagnostics.Process.Tests.app'..
[08:54:54] dbug: Property UIRequiredDeviceCapabilities not present in Info.plist, assuming 32-bitis not supported.Error: Failed to get bundle information: Print: Entry,"UIRequiredDeviceCapabilities",Does Not Exist[08:54:54]dbug:***Executing 'System.Diagnostics.Process.Tests' on MacCatalyst *** |
jkotas
commented
Mar 30, 2026
Why is RemoteExecutor not unsupported on MacCatalyst? If we are able to start child processes on MacCatalyst, RemoteExecutor should work just fine. |
adamsitnik
commented
Mar 30, 2026
I don't know, but I agree it would be the best long-term solution. |
rolfbjarne
commented
Mar 31, 2026
This comes from here, and just looks diagnostic. The problem is that there were test failures: which can be seen in the Tests tab here: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1357894&view=ms.vss-test-web.build-test-results-tab&runId=37954004&resultId=157642&paneView=debug |
…cess-tests-maccatalyst
…y one `[PlatformSpecific]` annotation
adamsitnik
commented
Mar 31, 2026
/azp run runtime-maccatalyst |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
adamsitnik
commented
Apr 2, 2026
/azp run runtime-maccatalyst |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
…rocessStartAndKill Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/634abc6a-3308-4bf9-8cbc-0ee291fe1533 Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
adamsitnik
commented
Apr 2, 2026
/azp run runtime-maccatalyst |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
🤖 Copilot Code Review — PR #126306Note This review was generated by Copilot. Holistic AssessmentMotivation: This PR adds MacCatalyst platform support to the Approach: The approach is clean and well-structured. It centralizes platform-specific logic into named properties ( Summary: ✅ LGTM. The code changes are correct and improve the codebase. The renamed property uses positive naming conventions, all callers are properly updated with no orphaned references, the Detailed Findings✅ Platform check refactoring is correct and complete
✅ Console guard centralization is correct
✅ PlatformNotSupportedException guard coverage is completeThe guard was removed from the internal ✅ IsTerminal extraction is well-designedThe
The iOS version uses discard parameter ✅ Test consolidation is appropriateRenaming ✅ csproj configuration is correct
💡 ProcessTests.Unix.cs UseShellExecute tests — low-risk gapTwo UseShellExecute tests in 💡 ProcessHandlesTests skip messageThe previous version had two
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…#126306) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: adamsitnik <6011991+adamsitnik@users.noreply.github.com> Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com> Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com>
All existing
Processtests rely onRemoteExecutor, which is unsupported on MacCatalyst. This adds mobile-platformProcesstests using simple Unix tools (ls,sleep) available in both the Android and MacCatalyst environments, and fixes MacCatalyst-specific bugs in theProcessimplementation.Changes
ProcessTests.Mobile.cs(new, replaces separateProcessTests.Android.csandProcessTests.MacCatalyst.cs): Six mobileProcesstests shared between Android and MacCatalyst via[PlatformSpecific(TestPlatforms.Android | TestPlatforms.MacCatalyst)], covering:Process.Kill()terminationProcessNameavailability for a running processStandardInputHandle/StandardOutputHandle/StandardErrorHandlevia anonymous pipesSafeProcessHandle.Unix.cs:private static bool UsesTerminal(SafeFileHandle?, SafeFileHandle?, SafeFileHandle?)helper method (with explanatory comments preserved) called from bothStartCoreandStartWithShellExecute, eliminating the previous inconsistency between the two call sites.UsesTerminalnow delegates toProcessUtils.IsTerminal(see below), removing the inlineInterop.Sys.IsATtycalls and thePlatformSupportsConsoleguard from this site.Console.Open*methodsProcessUtils.ConfigureTerminalForChildProcesses.iOS.cs: Addedinternal static bool IsTerminal(SafeFileHandle? _) => false;— on iOS/tvOS/MacCatalyst there is no terminal, so this always returnsfalsewithout any P/Invoke reference toInterop.Sys.IsATty.ProcessUtils.ConfigureTerminalForChildProcesses.Unix.cs: Addedinternal static bool IsTerminal(SafeFileHandle? standardHandle) => standardHandle is not null && Interop.Sys.IsATty(standardHandle);— on other Unix platforms, delegates to the nativeIsATtycheck.ProcessUtils.cs:PlatformSupportsConsole(!(IsAndroid() || IsMacCatalyst())) to gateConsole.OpenStandard*Handle()callsPlatformSupportsProcessStartAndKill(replaces the previous double-negativePlatformDoesNotSupportProcessStartAndKill) with a positive sense consistent withPlatformSupportsConsole; all call sites updated toif (!ProcessUtils.PlatformSupportsProcessStartAndKill)ProcessUtils.Unix.cs) and added early checks inProcess.Start()andSafeProcessHandle.Start()ProcessTests.cs: AddedTestPlatforms.MacCatalystto the[SkipOnPlatform]attributes onProcessStart_UseShellExecute_ExecutesandProcessStart_UseShellExecute_WorkingDirectory, alongside the existing iOS and tvOS skips, since MacCatalyst shares the same shell script execution restrictionsProcessHandlesTests.cs: Extended[SkipOnPlatform]to includeiOS,tvOS, andMacCatalyst(in addition to Android); updated skip reason to"sh is not available in the mobile platform sandbox"for greater precisionSystem.Diagnostics.Process.Tests.csproj:$(NetCoreAppCurrent)-maccatalysttoTargetFrameworksmaccatalystin the Unix compile condition (picks upProcessTests.Unix.cs,ProcessThreadTests.Unix.cs, and related interop)ItemGroupentries into a single group forProcessTests.Mobile.cs