Skip to content

Commit 502b6a2

Browse files
jpnurmiclaude
andcommitted
ci: run iOS device tests on arm64
System.Reflection.Emit is blocked on arm64 simulators due to W^X — this is what NSubstitute/Castle.DynamicProxy needs: https://learn.microsoft.com/en-us/dotnet/maui/macios/interpreter The Mono interpreter bypasses this by interpreting emitted IL instead of generating native code. Sentry.Maui.Device.TestApp.csproj already has <UseInterpreter>true</UseInterpreter> for Release, and the build already passes EnableAot=false. So the two workarounds are redundant — either x64 via Rosetta OR the interpreter alone should suffice. Switching to iossimulator-arm64 should work with the current build settings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1753b23 commit 502b6a2

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

scripts/device-test.ps1

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ try
5252
{
5353
$Tfm += '-ios'
5454
$group = 'apple'
55-
# Always use x64 on iOS, since arm64 doesn't support JIT, which is required for tests using NSubstitute
56-
$arch = 'x64'
5755
$buildDir = "test/Sentry.Maui.Device.TestApp/bin/Release/$Tfm/iossimulator-$arch"
5856
$envValue = $CI ? 'true' : 'false'
5957
$arguments = @(

test/Sentry.Extensions.Logging.Tests/SentryHttpMessageHandlerBuilderFilterTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ public class SentryHttpMessageHandlerBuilderFilterTests
77
[SkippableFact]
88
public void Configure_HandlerEnabled_ShouldAddSentryHttpMessageHandler()
99
{
10-
#if __ANDROID__
11-
Skip.If(true, "Can't create proxies for classes without parameterless constructors on Android");
10+
#if __MOBILE__
11+
Skip.If(true, "Can't create proxies for classes without parameterless constructors on mobile");
1212
#endif
1313

1414
// Arrange
@@ -31,8 +31,8 @@ public void Configure_HandlerEnabled_ShouldAddSentryHttpMessageHandler()
3131
[SkippableFact]
3232
public void Configure_HandlerDisabled_ShouldNotAddSentryHttpMessageHandler()
3333
{
34-
#if __ANDROID__
35-
Skip.If(true, "Can't create proxies for classes without parameterless constructors on Android");
34+
#if __MOBILE__
35+
Skip.If(true, "Can't create proxies for classes without parameterless constructors on mobile");
3636
#endif
3737

3838
// Arrange

test/Sentry.Maui.Device.TestApp/Sentry.Maui.Device.TestApp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
<RuntimeIdentifier Condition="'$(TargetPlatformIdentifier)' == 'android' And '$(OSArchitecture)' == 'Arm64'">android-arm64</RuntimeIdentifier>
6666
<RuntimeIdentifier Condition="'$(TargetPlatformIdentifier)' == 'android' And '$(OSArchitecture)' == 'x64'">android-x64</RuntimeIdentifier>
6767

68-
<!-- On iOS we always target x64 since Arm64 doesn't support JIT, which is required by tests using NSubstitute -->
69-
<RuntimeIdentifier Condition="'$(TargetPlatformIdentifier)' == 'ios'">iossimulator-x64</RuntimeIdentifier>
68+
<RuntimeIdentifier Condition="'$(TargetPlatformIdentifier)' == 'ios' And '$(OSArchitecture)' == 'Arm64'">iossimulator-arm64</RuntimeIdentifier>
69+
<RuntimeIdentifier Condition="'$(TargetPlatformIdentifier)' == 'ios' And '$(OSArchitecture)' == 'x64'">iossimulator-x64</RuntimeIdentifier>
7070

7171
<RuntimeIdentifier Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst' And '$(OSArchitecture)' == 'Arm64'">maccatalyst-arm64</RuntimeIdentifier>
7272
<RuntimeIdentifier Condition="'$(TargetPlatformIdentifier)' == 'maccatalyst' And '$(OSArchitecture)' == 'x64'">maccatalyst-x64</RuntimeIdentifier>

0 commit comments

Comments
 (0)