-
Notifications
You must be signed in to change notification settings - Fork 172
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
Fix WatchOS simulator not supporting thread_local #5341
Fix WatchOS simulator not supporting thread_local #5341
Conversation
14ef21a
to
2fdb31f
Compare
src/realm/impl/simulated_failure.cpp
Outdated
@@ -175,11 +175,11 @@ bool SimulatedFailure::do_check_trigger(FailureType failure_type) noexcept | |||
return false; | |||
} | |||
|
|||
#if (REALM_ARCHITECTURE_X86_32 && REALM_IOS) || (REALM_ARCHITECTURE_X86_64 && REALM_WATCHOS) | |||
#if (REALM_ARCHITECTURE_X86_32 && REALM_IOS) || (REALM_ARCHITECTURE_X86_32 && REALM_WATCHOS) || (REALM_ARCHITECTURE_X86_64 && REALM_WATCHOS) || (REALM_ARCHITECTURE_ARM_64 && REALM_WATCHOS) |
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.
This is a really confusing condition. Is it just (REALM_WATCHOS && !REALM_ARCHITECTURE_ARM64_32)
or is there something else going on?
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.
We previously added a condition to support old intel simulators REALM_ARCHITECTURE_X86_32 running on 32 bits.
On this PR I'm adding a condition for the REALM_WATCHOS and architecture REALM_ARCHITECTURE_ARM_64 for watchOS simulators on M1 machines and REALM_WATCHOS combined with REALM_ARCHITECTURE_X86_64 to support Intel simulators running on 64 bits, after some user reported the same error (thread_local not supported).
I tried to find a way to define a variable that let us know if thread_local is available which will make easier the condition here, but didn't find anything.
This branch is tested by several user having this problem, issues are linked on the description of the pull request.
I'm open to suggestion how we can make this easier.
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.
@tgoyne do you think we can review this, or you still having doubts about the added conditions?
Just bumping this PR to get it some attention again, my project won't build without this fix and it would be great to have it merged so I can update Realm. It seems like we just need to solidify how this condition should be written, otherwise it's a pretty straightforward issue and fix. |
2fdb31f
to
58e9827
Compare
58e9827
to
9c64f57
Compare
Thanks for the fix @tgoyne |
What, How & Why?
Fix an error when compiling a watchOS Simulator target on an M1 is not supporting Thread-local storage realm/realm-swift#7694
realm/realm-swift#7695
☑️ ToDos