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

Unable to compile Realm when targetting watchOS #7623

Closed
mwoollard opened this issue Jan 20, 2022 · 15 comments
Closed

Unable to compile Realm when targetting watchOS #7623

mwoollard opened this issue Jan 20, 2022 · 15 comments
Assignees

Comments

@mwoollard
Copy link

mwoollard commented Jan 20, 2022

How frequently does the bug occur?

All the time

Description

Am using Realm integrated in a pure SPM library project that targets iOS, tvOS macOS and watchOS. With latest update of packages can no longer build for watchOS. The error is:

.../simulated_failure.cpp:174:1: error: thread-local storage is not supported for the current target
thread_local bool (*s_mmap_predicate)(size_t);
^
1 error generated.

Stacktrace & log output

No response

Can you reproduce the bug?

Yes, always

Reproduction Steps

Sample project is available here

clone project
from project root directory

$ open Package.swift

In xcode select watchOS as run target

Build

Version

10.21.1

What SDK flavour are you using?

Local Database only

Are you using encryption?

Yes, using encryption

Platform OS and version(s)

watchOS 7.4. up

Build environment

Xcode version: 13.2.1
Dependency manager and version: Xcode SPM (swift 5.5.2)

@leemaguire
Copy link
Contributor

Hi @mwoollard. I still cannot reproduce your issue even with the sample project. Are you using macOS Monterey?

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Jan 21, 2022
@mwoollard
Copy link
Author

Yes, using Monterey, am also seeing this both on my dev laptop (M1) within Xcode and CI scripted builds (Intel).

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Jan 21, 2022
@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention Reporter has responded. Review comment. labels Jan 21, 2022
@mwoollard
Copy link
Author

Additional, FWIW, if I change the compile time condition @ line 171 to

#if (REALM_ARCHITECTURE_X86_32 && REALM_IOS) || REALM_WATCHOS

Code compiles

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Jan 21, 2022
dianaafanador3 added a commit to realm/realm-core that referenced this issue Jan 24, 2022
@dianaafanador3
Copy link
Contributor

Thanks for the suggestion, I created a PR for it on core. You can keep track of the issue here and on the PR realm/realm-core#5188.

@sync-by-unito sync-by-unito bot removed the Needs-Attention Reporter has responded. Review comment. label Jan 24, 2022
@dianaafanador3
Copy link
Contributor

This has been fixed on core and will be available shortly.

@stremblayiOS
Copy link

This is still happening using SPM and Realm 10.24.0. Can we reopen this please?

@dianaafanador3
Copy link
Contributor

dianaafanador3 commented Mar 8, 2022

@streamblayiOS Are you still getting the same error?

@stremblayiOS
Copy link

yes

@mwoollard
Copy link
Author

I think this is now only issue when targeting M1 simulator. I created new issue in realm-core here. Could you confirm you are using M1 Mac?

@stremblayiOS
Copy link

stremblayiOS commented Mar 8, 2022

I am not using a M1 Mac.

Screen Shot 2022-03-08 at 12 00 42 PM

@mwoollard
Copy link
Author

I'm able to build on our Intel CI system with the latest release where I wasn't before, but still can't on my M1 laptop, so must be something more subtle.

@stremblayiOS
Copy link

This is what I get when I try to add Realm to an watch extension using SPM

Screen Shot 2022-03-08 at 12 44 04 PM

@ding-stephen
Copy link

The same issue for my project with the latest Realm 10.24.2 on my Intel Mac.
But the problem is only happened on the simulators, not when testing on actual device.

截屏2022-03-27 21 08 31

@dianaafanador3
Copy link
Contributor

I have a core PR for this, where I'm trying to cover all issues where thread_local is not supported, this is the branch, if you want to test out. @ding-stephen

@philipengberg
Copy link

@dianaafanador3 Facing the same issue, I can confirm that your branch fixed the issue for me (on WatchOS). Any plans to merge these changes?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants