Skip to content
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

Use macos-12 runner and Xcode 13.1 when building iOS targets #55

Merged
merged 3 commits into from
Sep 25, 2024

Conversation

eymar
Copy link
Collaborator

@eymar eymar commented Sep 24, 2024

Why:
It fixes https://youtrack.jetbrains.com/issue/CMP-6721

Previous skia-ios binaries (m116) were built using macos-11 agent, and they are not available anymore.

Since we ingtegrated m126, we switched to macos-13. macos version determines the default Xcode version used to build.
Downgrading the Xcode version is not a perfect solution, since it's not future-proof. But for the purpose of CM 1.7 release we better use this option.

Xcode 13.1 is not available in macos-13, so we downgrade to macos-12 for ios builds

How to reproduce in skiko:

  • run xcodegen skiko/samples/SkiaMultiplatformSample
  • open the generated project in Xcode
  • try to run on ios15 simulator, the app crashes:
Thread 1 Queue : com.apple.main-thread (serial)
#0	0x0000000101287118 in __abort_with_payload ()
#1	0x0000000101292d7c in abort_with_payload_wrapper_internal ()
#2	0x0000000101292db0 in abort_with_payload ()
#3	0x000000010113c11c in 0x10113c11c ()
#4	0x000000010110d4f4 in 0x10110d4f4 ()
#5	0x0000000101125460 in 0x101125460 ()
#6	0x00000001003ee2e4 in GrMtlGpu::GrMtlGpu(GrDirectContext*, GrContextOptions const&, id<MTLDevice>, id<MTLCommandQueue>) ()
#7	0x00000001003ee25c in GrMtlGpu::Make(GrMtlBackendContext const&, GrContextOptions const&, GrDirectContext*) ()
#8	0x00000001003edf3c in GrDirectContexts::MakeMetal(GrMtlBackendContext const&, GrContextOptions const&) ()
#9	0x00000001003ede58 in GrDirectContexts::MakeMetal(GrMtlBackendContext const&) ()
#10	0x00000001006273fc in org_jetbrains_skia_DirectContext__1nMakeMetal ()

Then change the skia version to dependencies.skia=m126-d2aaacc35d-3 (it's a test-only skia build, which used Xcode 13 for skia-iosSim build), clean the project, rerun the tasks. The apps works now.

Investigation:
The sample also works when we build skia (using Xcode 15) with all optimizations disabled - -O0 instead of '-O3' (O1 and O2 don't help). Therefore we concluded that newer Xcode version (and thus clang) makes some optimizations incompatible with ios15 simulator (real devices were not affected).

Future considerations:

In the future, GitHub actions will drop Xcode 13 support (it depends on the MacOs version). And we won't be able to use the older version. In that case we might consider building skia-iosSim binaries with optimizations disabled (-O0).

UPD: we have a report that a real device was affected too: https://youtrack.jetbrains.com/issue/CMP-6721/Compose-MP-crash-on-iOS-15-simulator#focus=Comments-27-10740045.0-0
So some of the above considerations (about disabling optimizations just for simulatoes) can't be applied.

@eymar eymar changed the title Use Xcode 13.1 when building iOS targets Use macos-12 runner and Xcode 13.1 when building iOS targets Sep 24, 2024
@eymar eymar merged commit e287d4c into main Sep 25, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants