Skip to content

Commit e846322

Browse files
authored
[clr-ios] Enable CoreCLR tests for tvOS in extra-platforms (#122606)
## Description This PR enables CoreCLR tests for tvOS in the extra-platforms pipelines. Contributes to #120055
1 parent b2969ed commit e846322

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ jobs:
179179
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
180180
isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }}
181181
platforms:
182-
- ios_arm64
183-
# - tvos_arm64 TODO: https://github.com/dotnet/runtime/issues/120055
182+
# - ios_arm64 TODO: Enable when Helix queue upgrade is finished https://github.com/dotnet/runtime/issues/122452
183+
- tvos_arm64
184184
variables:
185185
- ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
186186
- name: _HelixSource
@@ -222,8 +222,8 @@ jobs:
222222
isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }}
223223
isiOSLikeOnlyBuild: ${{ parameters.isiOSLikeOnlyBuild }}
224224
platforms:
225-
- ios_arm64
226-
# - tvos_arm64 TODO: https://github.com/dotnet/runtime/issues/120055
225+
# - ios_arm64 TODO: Enable when Helix queue upgrade is finished https://github.com/dotnet/runtime/issues/122452
226+
- tvos_arm64
227227
variables:
228228
# map dependencies variables to local variables
229229
- name: librariesContainsChange

eng/pipelines/extra-platforms/runtime-extra-platforms-ioslikesimulator.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
platforms:
149149
- iossimulator_x64
150150
- iossimulator_arm64
151-
# - tvossimulator_arm64 TODO: https://github.com/dotnet/runtime/issues/120055
151+
- tvossimulator_arm64
152152
variables:
153153
- ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
154154
- name: _HelixSource
@@ -192,7 +192,7 @@ jobs:
192192
platforms:
193193
- iossimulator_x64
194194
- iossimulator_arm64
195-
# - tvossimulator_arm64 TODO: https://github.com/dotnet/runtime/issues/120055
195+
- tvossimulator_arm64
196196
variables:
197197
# map dependencies variables to local variables
198198
- name: librariesContainsChange

src/coreclr/clrfeatures.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ if (CLR_CMAKE_TARGET_WIN32)
8686
set(FEATURE_TYPEEQUIVALENCE 1)
8787
endif(CLR_CMAKE_TARGET_WIN32)
8888

89-
if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS)
89+
if (CLR_CMAKE_TARGET_MACCATALYST OR CLR_CMAKE_TARGET_IOS OR CLR_CMAKE_TARGET_TVOS)
9090
set(FEATURE_STUBPRECODE_DYNAMIC_HELPERS 1)
9191
endif()
9292

src/coreclr/pal/src/include/pal/threadsusp.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ Module Name:
4848
#include <semaphore.h>
4949
#endif // HAVE_SYS_SEMAPHORE_H
5050

51-
#elif HAS_PTHREAD_MUTEXES && HAVE_MACH_EXCEPTIONS
51+
#elif HAS_PTHREAD_MUTEXES && (HAVE_MACH_EXCEPTIONS || defined(TARGET_TVOS))
5252

5353
// Can only use the pthread solution if we're not using signals since pthread mutexes are not signal safe.
54+
55+
// On tvOS, HAVE_MACH_EXCEPTIONS is 0 because thread_set_exception_ports is not available in the SDK.
56+
// However, System V IPC (semget) is also not available due to sandbox restrictions so we use pthread instead.
5457
#define USE_PTHREAD_CONDVARS 1
5558

5659
#include <pthread.h>

src/coreclr/pal/src/thread/process.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2475,7 +2475,7 @@ PROCCreateCrashDump(
24752475
int bytesRead;
24762476
while((bytesRead = read(child_read_pipe, &buffer, 1)) < 0 && errno == EINTR);
24772477
close(child_read_pipe);
2478-
2478+
24792479
if (bytesRead != 1)
24802480
{
24812481
fprintf(stderr, "Problem reading from createdump child_read_pipe: %s (%d)\n", strerror(errno), errno);

0 commit comments

Comments
 (0)