Realm-cocoa: Semantic Issue

Created on 19 Oct 2020  路  8Comments  路  Source: realm/realm-cocoa

!!! MANDATORY TO FILL OUT !!!

Goals


Compile Realm version 10.0.0 in Xcode version 12.0.1

Expected Results


Realm library threw a compile error, a semantic issue. I am using Xcode's Swift Package Manager.
Aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer

Actual Results


Following are some of the logs reported by Xcode.

SourcePackages/checkouts/realm-core/src/realm/alloc.hpp:546:19: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer inline Allocator::~Allocator() noexcept
SourcePackages/checkouts/realm-core/src/realm/alloc.hpp:328:5: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer ~WrappedAllocator()

Steps for others to Reproduce


Compile using Xcode 12.0.1 and integrating Realm library through Xcode's Swift Package Manager.

Code Sample

Version of Realm and Tooling


ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H2

/Applications/Xcode.app/Contents/Developer
Xcode 12.0.1
Build version 12A7300

/usr/local/bin/pod
1.9.3
(not in use here)

/bin/bash
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)

carthage not found
(not in use here)

/usr/local/bin/git
git version 2.28.0

O-Community

Most helpful comment

I have the same issue when compile target is "Any iOS Device (arm64)". If I change target to simulator or real device then there is no errors. Using Xcode 12.0.1 and Realm 10.0.0.

All 8 comments

With a fresh project importing RealmSwift through SPM on the same version of Xcode with an iOS 9.0 deployment target, I'm unable to reproduce this issue.

Do you have a sample/sandboxed project that reproduces this?

I have the same issue when compile target is "Any iOS Device (arm64)". If I change target to simulator or real device then there is no errors. Using Xcode 12.0.1 and Realm 10.0.0.

The SPM package has a minimum deployment target of iOS 11. This is due to that compiling for 32-bit iOS requires passing -fno-aligned-new to the compiler, which SPM does not allow.

For the meantime, I should go back installing through Cocoapods?

I am getting this also. Only happens on archiving to "Any iOS Device (arm64)"

Going back to v5.5.0 it is archiving fine.

Im also having the problem.
I just migrated from Carthage to SPM and XCode 12 (DeploymentTarget iOS 13) and running into this problem >.<. Does anyone has an idea how to fix this?

Ok i found a solution, by setting the iOS platform in realm-core explicitly to iOS 11 fix the archive problem.

https://github.com/piggeldi/realm-core/commit/7f4277169e1b77648bceb3e87aabecde1055e174

Was this page helpful?
0 / 5 - 0 ratings