-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Fix SystemNative_IsATty P/Invoke missing on iOS/tvOS/MacCatalyst #126302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+6
−0
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,13 @@ int32_t SystemNative_GetWindowSize(intptr_t fd, WinSize* windowSize) | |
|
|
||
| int32_t SystemNative_IsATty(intptr_t fd) | ||
| { | ||
| #if defined(TARGET_MACCATALYST) || defined(TARGET_IOS) || defined(TARGET_TVOS) | ||
| // there is no terminal on these platforms | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a terminal on Mac Catalyst (but none on iOS or tvOS). |
||
| (void)fd; | ||
| return 0; | ||
| #else | ||
| return isatty(ToFileDescriptor(fd)); | ||
| #endif | ||
| } | ||
|
|
||
| static char* g_keypadXmit = NULL; // string used to enable application mode, from terminfo | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rolfbjarne is this the correct fix? or is
pal_console.cnot compiled for iOS family because there is simply no terminal there?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It pulls in pal_log.m instead (the .c is only included on macOS):
runtime/src/native/libs/System.Native/CMakeLists.txt
Lines 68 to 94 in 7c91160
The ConsolePal.iOS.cs is pretty barebones, I would look why the p/invoke is even included instead of trying to stub out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
verify-entrypoints.sh was supposed to catch this, but we haven't turned it on for mobile. would be nice to fix that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also opened #126305 to ensure I don't break any mobile platforms again (I already added tests for Android to avoid that, but missed the catalyst vs ios difference)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh the reference is from Process? Out of curiosity I had a look and...
runtime/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs
Lines 363 to 392 in 36e6179
The
PlatformDoesNotSupportProcessStartAndKillat the beginning is exactly iDevices. So this should all be unreachable.System.Diagnostic.Process already multitargets, and it already did multitarget when people added the if check. Weird. This feels like something that should be a partial class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But
Processis supported on mac catalyst and not supported on iOS and tvOS:runtime/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Unix.cs
Line 993 in 508f440
FWIW we could support it on iOS with my most recent changes (I think: #126097 (comment))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say there is a place for improvement and I am trying really hard to make it happen right now ;P