Skip to content

Commit 27549a2

Browse files
authored
Bump minimum deployment targets to the minimums supported by Xcode 15 (#7648)
Submitting apps built with Xcode 14 to the app store is no longer allowed, so we no longer support building with Xcode 14.
1 parent a8df133 commit 27549a2

File tree

9 files changed

+32
-70
lines changed

9 files changed

+32
-70
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
* Follow on to ([PR #7300](https://github.com/realm/realm-core/pull/7300)) to allow SDKs to construct a fake user for testing SyncManager::get_user -> App::create_fake_user_for_testing ([PR #7632](https://github.com/realm/realm-core/pull/7632))
2222
* Fix build-apple-device.sh, broken in [#7603](https://github.com/realm/realm-core/pull/7603) ([PR #7640](https://github.com/realm/realm-core/pull/7640)).
2323
* Added a CAPI interface for SDKs to bring their own managed users with core's app services turned off. ([PR #7615](https://github.com/realm/realm-core/pull/7615)).
24+
* Bump the minimum deployment targets on Apple platforms to the minimums supported by Xcode 15 and clean up now unused availability checks. ([PR #7648](https://github.com/realm/realm-core/pull/7648)).
25+
2426
----------------------------------------------
2527

2628
# 14.6.0 Release notes

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ let bidExcludes: [String] = [
354354

355355
let platforms: [SupportedPlatform] = [
356356
.macOS(.v10_13),
357-
.iOS(.v11),
358-
.tvOS(.v11),
357+
.iOS(.v12),
358+
.tvOS(.v12),
359359
.watchOS(.v4)
360360
]
361361

src/realm/object-store/impl/apple/keychain_helper.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,17 @@ REALM_NORETURN
3636
REALM_COLD
3737
void keychain_access_exception(int32_t error_code)
3838
{
39-
if (__builtin_available(iOS 11.3, macOS 10.3, tvOS 11.3, watchOS 4.3, *)) {
40-
if (auto message = adoptCF(SecCopyErrorMessageString(error_code, nullptr))) {
41-
if (auto msg = CFStringGetCStringPtr(message.get(), kCFStringEncodingUTF8)) {
42-
throw RuntimeError(
43-
ErrorCodes::RuntimeError,
44-
util::format("Keychain returned unexpected status code: %1 (%2)", msg, error_code));
45-
}
46-
auto length =
47-
CFStringGetMaximumSizeForEncoding(CFStringGetLength(message.get()), kCFStringEncodingUTF8) + 1;
48-
auto buffer = std::make_unique<char[]>(length);
49-
if (CFStringGetCString(message.get(), buffer.get(), length, kCFStringEncodingUTF8)) {
50-
throw RuntimeError(
51-
ErrorCodes::RuntimeError,
52-
util::format("Keychain returned unexpected status code: %1 (%2)", buffer.get(), error_code));
53-
}
39+
if (auto message = adoptCF(SecCopyErrorMessageString(error_code, nullptr))) {
40+
if (auto msg = CFStringGetCStringPtr(message.get(), kCFStringEncodingUTF8)) {
41+
throw RuntimeError(ErrorCodes::RuntimeError,
42+
util::format("Keychain returned unexpected status code: %1 (%2)", msg, error_code));
43+
}
44+
auto length = CFStringGetMaximumSizeForEncoding(CFStringGetLength(message.get()), kCFStringEncodingUTF8) + 1;
45+
auto buffer = std::make_unique<char[]>(length);
46+
if (CFStringGetCString(message.get(), buffer.get(), length, kCFStringEncodingUTF8)) {
47+
throw RuntimeError(
48+
ErrorCodes::RuntimeError,
49+
util::format("Keychain returned unexpected status code: %1 (%2)", buffer.get(), error_code));
5450
}
5551
}
5652
throw RuntimeError(ErrorCodes::RuntimeError,

src/realm/sync/network/network_ssl.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,10 @@ std::string SecureTransportErrorCategory::message(int value) const
207207
const char* message = "Unknown error";
208208
#if REALM_HAVE_SECURE_TRANSPORT
209209
std::unique_ptr<char[]> buffer;
210-
if (__builtin_available(iOS 11.3, macOS 10.3, tvOS 11.3, watchOS 4.3, *)) {
211-
auto status = OSStatus(value);
212-
void* reserved = nullptr;
213-
if (auto cf_message = adoptCF(SecCopyErrorMessageString(status, reserved)))
214-
message = cfstring_to_cstring(cf_message.get(), buffer);
215-
}
216-
else {
217-
static_cast<void>(buffer);
218-
}
210+
auto status = OSStatus(value);
211+
void* reserved = nullptr;
212+
if (auto cf_message = adoptCF(SecCopyErrorMessageString(status, reserved)))
213+
message = cfstring_to_cstring(cf_message.get(), buffer);
219214
#endif // REALM_HAVE_SECURE_TRANSPORT
220215

221216
return util::format("SecureTransport error: %1 (%2)", message, value); // Throws

src/realm/util/compression.cpp

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -593,12 +593,8 @@ std::error_code decompress(InputStream& compressed, Span<const char> compressed_
593593
}
594594

595595
#if REALM_USE_LIBCOMPRESSION
596-
// All of our non-macOS deployment targets are high enough to have libcompression,
597-
// but we support some older macOS versions
598-
if (__builtin_available(macOS 10.11, *)) {
599-
if (algorithm != Algorithm::None)
600-
return decompress_libcompression(compressed, compressed_buf, decompressed_buf, algorithm, has_header);
601-
}
596+
if (algorithm != Algorithm::None)
597+
return decompress_libcompression(compressed, compressed_buf, decompressed_buf, algorithm, has_header);
602598
#endif
603599

604600
switch (algorithm) {
@@ -689,7 +685,7 @@ std::error_code compress_lzfse_or_zlib(Span<const char> uncompressed_buf, Span<c
689685
{
690686
using namespace compression;
691687
#if REALM_USE_LIBCOMPRESSION
692-
if (__builtin_available(macOS 10.11, *)) {
688+
{
693689
size_t len = write_header({Algorithm::Lzfse, uncompressed_buf.size()}, compressed_buf);
694690
auto ec = compress_lzfse(uncompressed_buf, compressed_buf.sub_span(len), compressed_size, custom_allocator);
695691
if (ec != error::compress_input_too_long)
@@ -936,10 +932,8 @@ std::unique_ptr<InputStream> compression::decompress_nonportable_input_stream(In
936932
if (header.algorithm == Algorithm::None)
937933
return std::make_unique<DecompressInputStreamNone>(source, first_block);
938934
#if REALM_USE_LIBCOMPRESSION
939-
if (__builtin_available(macOS 10.11, *)) {
940-
if (header.algorithm == Algorithm::Deflate || header.algorithm == Algorithm::Lzfse)
941-
return std::make_unique<DecompressInputStreamLibCompression>(source, first_block, header);
942-
}
935+
if (header.algorithm == Algorithm::Deflate || header.algorithm == Algorithm::Lzfse)
936+
return std::make_unique<DecompressInputStreamLibCompression>(source, first_block, header);
943937
#endif
944938
if (header.algorithm == Algorithm::Deflate)
945939
return std::make_unique<DecompressInputStreamZlib>(source, first_block, total_size);

src/realm/util/file_mapper.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,8 @@ static dispatch_queue_t reclaimer_queue;
241241
static void ensure_reclaimer_thread_runs()
242242
{
243243
if (!reclaimer_timer) {
244-
if (__builtin_available(iOS 10, macOS 12, tvOS 10, watchOS 3, *)) {
245-
reclaimer_queue = dispatch_queue_create_with_target("io.realm.page-reclaimer", DISPATCH_QUEUE_SERIAL,
246-
dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0));
247-
}
248-
else {
249-
reclaimer_queue = dispatch_queue_create("io.realm.page-reclaimer", DISPATCH_QUEUE_SERIAL);
250-
}
244+
reclaimer_queue = dispatch_queue_create_with_target("io.realm.page-reclaimer", DISPATCH_QUEUE_SERIAL,
245+
dispatch_get_global_queue(QOS_CLASS_BACKGROUND, 0));
251246
reclaimer_timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, reclaimer_queue);
252247
dispatch_source_set_timer(reclaimer_timer, DISPATCH_TIME_NOW, NSEC_PER_SEC, NSEC_PER_SEC);
253248
dispatch_source_set_event_handler(reclaimer_timer, ^{

src/realm/util/interprocess_condvar.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,6 @@ class InterprocessCondVar {
118118
struct timespec now;
119119
#ifdef _WIN32
120120
timespec_get(&now, TIME_UTC);
121-
#elif REALM_PLATFORM_APPLE
122-
if (__builtin_available(iOS 10, macOS 12, tvOS 10, watchOS 3, *)) {
123-
clock_gettime(CLOCK_REALTIME, &now);
124-
}
125-
else {
126-
timeval tv;
127-
gettimeofday(&tv, 0);
128-
now.tv_sec = tv.tv_sec;
129-
now.tv_nsec = tv.tv_usec * 1000;
130-
}
131121
#else
132122
clock_gettime(CLOCK_REALTIME, &now);
133123
#endif

src/realm/util/terminate.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
#include <realm/version.hpp>
2727

2828
#if REALM_PLATFORM_APPLE
29-
3029
#include <os/log.h>
31-
#include <asl.h>
3230

3331
#include <dlfcn.h>
3432
#include <execinfo.h>
@@ -78,18 +76,10 @@ void nslog(const char* message) noexcept
7876
// Standard error goes nowhere for applications managed by launchd,
7977
// so log to ASL/unified logging system logs as well.
8078
fputs(message, stderr);
81-
if (__builtin_available(iOS 10.0, macOS 10.12, tvOS 10.0, watchOS 3.0, *)) {
82-
// The unified logging system considers dynamic strings to be private in
83-
// order to protect users. This means we must specify "%{public}s" to get
84-
// the message here. See `man os_log` for more details.
85-
os_log_error(OS_LOG_DEFAULT, "%{public}s", message);
86-
}
87-
else {
88-
REALM_DIAG_PUSH();
89-
REALM_DIAG(ignored "-Wdeprecated");
90-
asl_log(nullptr, nullptr, ASL_LEVEL_ERR, "%s", message);
91-
REALM_DIAG_POP();
92-
}
79+
// The unified logging system considers dynamic strings to be private in
80+
// order to protect users. This means we must specify "%{public}s" to get
81+
// the message here. See `man os_log` for more details.
82+
os_log_error(OS_LOG_DEFAULT, "%{public}s", message);
9383
// Log the message to Crashlytics if it's loaded into the process
9484
void* addr = dlsym(RTLD_DEFAULT, "CLSLog");
9585
if (addr) {

tools/cmake/xcode.toolchain.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ if(NOT DEFINED CMAKE_XCODE_ATTRIBUTE_SDKROOT)
3030
set(CMAKE_XCODE_ATTRIBUTE_SDKROOT "$(SDKROOT_$(XCODE_VERSION_MAJOR))")
3131
endif()
3232

33-
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "11.0")
33+
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "12.0")
3434
set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET_CATALYST_NO "10.13")
3535
set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET_CATALYST_YES "10.15")
3636
set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "$(MACOSX_DEPLOYMENT_TARGET_CATALYST_$(IS_MACCATALYST))")
3737
set(CMAKE_XCODE_ATTRIBUTE_WATCHOS_DEPLOYMENT_TARGET "4.0")
38-
set(CMAKE_XCODE_ATTRIBUTE_TVOS_DEPLOYMENT_TARGET "11.0")
38+
set(CMAKE_XCODE_ATTRIBUTE_TVOS_DEPLOYMENT_TARGET "12.0")
3939

4040
set(REALM_ENABLE_ASSERTIONS ON CACHE BOOL "Enable release assertions")
4141
set(REALM_XCODE_TOOLCHAIN TRUE)

0 commit comments

Comments
 (0)