Skip to content

Commit

Permalink
Drop support for Xcode 14 (#8563)
Browse files Browse the repository at this point in the history
Xcode 15.1 (Swift 5.9.2) is now the minimum supported version.
  • Loading branch information
tgoyne authored May 1, 2024
1 parent 9c9479a commit 3d12581
Show file tree
Hide file tree
Showing 33 changed files with 29 additions and 132 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
target: [macosx, iphoneos, iphonesimulator, appletvos, appletvsimulator, watchos, watchsimulator, maccatalyst]
xcode: ["14.3.1"]
xcode: ["15.1"]
include:
- target: xros
xcode: "15.2.0"
Expand Down
24 changes: 5 additions & 19 deletions .github/workflows/master-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ on:
- "master"
- "release/**"
env:
XCODE_VERSION: "['14.2', '14.3.1', '15.1', '15.2', '15.3']"
# Github actions doesn't have Xcode 15.3 on any runners yet, so we can't run
# installation tests for it
XCODE_TEST_VERSIONS: "['14.2', '14.3.1', '15.1', '15.2']"
XCODE_VERSION: "['15.1', '15.2', '15.3']"
XCODE_TEST_VERSIONS: "['15.1', '15.2', '15.3']"
PLATFORM: "['ios', 'osx', 'watchos', 'tvos', 'catalyst', 'visionos']"
BUILD_PLATFORM: "['ios', 'iossimulator', 'osx', 'watchos', 'watchossimulator', 'tvos', 'tvossimulator', 'catalyst', 'visionos', 'visionossimulator']"
DOC_VERSION: '15.2'
RELEASE_VERSION: '15.2'
TEST_VERSION: '15.2'
DOC_VERSION: '15.3'
RELEASE_VERSION: '15.3'
TEST_VERSION: '15.3'
jobs:
cleanup: # Clean-up XCode cloud workflows, before running the pipeline
runs-on: ubuntu-latest
Expand Down Expand Up @@ -108,14 +106,6 @@ jobs:
configuration: static
- platform: visionossimulator
configuration: static
- platform: visionos
xcode-version: 14.2
- platform: visionossimulator
xcode-version: 14.2
- platform: visionos
xcode-version: 14.3.1
- platform: visionossimulator
xcode-version: 14.3.1
- platform: visionos
xcode-version: 15.1
- platform: visionossimulator
Expand Down Expand Up @@ -189,10 +179,6 @@ jobs:
platform: ${{ fromJSON(needs.prepare.outputs.PLATFORM_MATRIX) }}
xcode-version: ${{ fromJSON(needs.prepare.outputs.XCODE_VERSIONS_MATRIX) }}
exclude:
- platform: visionos
xcode-version: 14.2
- platform: visionos
xcode-version: 14.3.1
- platform: visionos
xcode-version: 15.1
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Publish release
on: workflow_dispatch
env:
XCODE_VERSION: "['14.2', '14.3.1', '15.1', '15.2', '15.3']"
TEST_XCODE_VERSION: '15.2'
XCODE_VERSION: "['15.1', '15.2', '15.3']"
TEST_XCODE_VERSION: '15.3'
jobs:
prepare:
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
x.y.z Release notes (yyyy-MM-dd)
=============================================================

Drop support for Xcode 14, as it can no longer be used to submit app to the app
store. Xcode 15.1 is now the minimum supported version.

### Enhancements
* Added `SyncConfiguration.initialSubscriptions` which describes the initial
subscription configuration that was passed when constructing the
Expand Down
7 changes: 1 addition & 6 deletions Configuration/Base.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,12 @@ MACOSX_DEPLOYMENT_TARGET_1400 = 10.13;
MACOSX_DEPLOYMENT_TARGET_1500 = 10.14;
MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR));
WATCHOS_DEPLOYMENT_TARGET_1400 = 4.0;
WATCHOS_DEPLOYMENT_TARGET_1500 = 5.0;
WATCHOS_DEPLOYMENT_TARGET_1500 = 4.0;
WATCHOS_DEPLOYMENT_TARGET = $(WATCHOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR));
TVOS_DEPLOYMENT_TARGET_1400 = 11.0;
TVOS_DEPLOYMENT_TARGET_1500 = 12.0;
TVOS_DEPLOYMENT_TARGET = $(TVOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR));

REALM_LD_CLASSIC_1400 = ;
REALM_LD_CLASSIC_1500 = -Wl,-ld_classic;
REALM_LD_CLASSIC = $(REALM_LD_CLASSIC_$(XCODE_VERSION_MAJOR));
OTHER_LDFLAGS = $(REALM_LD_CLASSIC);

APPLICATION_EXTENSION_API_ONLY = YES;
REALM_MACH_O_TYPE = mh_dylib;
SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator watchos watchsimulator appletvos appletvsimulator xros xrsimulator;
Expand Down
4 changes: 2 additions & 2 deletions Configuration/Realm/Realm.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = $(inherited) @executable_path/../Framewor

LINKER_FLAG_MACCATALYST_YES = -framework UIKit;
LINKER_FLAG_MACCATALYST_NO = ;
OTHER_LDFLAGS = $(REALM_SYMBOLS_FLAGS) $(REALM_LD_CLASSIC) -framework UIKit;
OTHER_LDFLAGS[sdk=macosx*] = $(REALM_SYMBOLS_FLAGS) $(REALM_LD_CLASSIC) $(LINKER_FLAG_MACCATALYST_$(IS_MACCATALYST));
OTHER_LDFLAGS = $(REALM_SYMBOLS_FLAGS) -framework UIKit;
OTHER_LDFLAGS[sdk=macosx*] = $(REALM_SYMBOLS_FLAGS) $(LINKER_FLAG_MACCATALYST_$(IS_MACCATALYST));
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ let package = Package(
name: "Realm",
platforms: [
.macOS(.v10_13),
.iOS(.v11),
.tvOS(.v11),
.iOS(.v12),
.tvOS(.v12),
.watchOS(.v4)
],
products: [
Expand Down
13 changes: 5 additions & 8 deletions Realm.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -134,27 +134,24 @@ Pod::Spec.new do |s|
'IPHONEOS_DEPLOYMENT_TARGET_1500' => '12.0',
'IPHONEOS_DEPLOYMENT_TARGET' => '$(IPHONEOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))',
'MACOSX_DEPLOYMENT_TARGET_1400' => '10.13',
'MACOSX_DEPLOYMENT_TARGET_1500' => '10.14',
'MACOSX_DEPLOYMENT_TARGET_1500' => '10.13',
'MACOSX_DEPLOYMENT_TARGET' => '$(MACOSX_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))',
'WATCHOS_DEPLOYMENT_TARGET_1400' => '4.0',
'WATCHOS_DEPLOYMENT_TARGET_1500' => '5.0',
'WATCHOS_DEPLOYMENT_TARGET_1500' => '4.0',
'WATCHOS_DEPLOYMENT_TARGET' => '$(WATCHOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))',
'TVOS_DEPLOYMENT_TARGET_1400' => '11.0',
'TVOS_DEPLOYMENT_TARGET_1500' => '12.0',
'TVOS_DEPLOYMENT_TARGET' => '$(TVOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))',

'REALM_LD_CLASSIC_1400' => '',
'REALM_LD_CLASSIC_1500' => '-Wl,-ld_classic',
'REALM_LD_CLASSIC' => '$(REALM_LD_CLASSIC_$(XCODE_VERSION_MAJOR))',
'OTHER_LDFLAGS' => '$(REALM_LD_CLASSIC) "-Wl,-unexported_symbols_list,${PODS_ROOT}/Realm/Configuration/Realm/PrivateSymbols.txt"',
'OTHER_LDFLAGS' => '"-Wl,-unexported_symbols_list,${PODS_ROOT}/Realm/Configuration/Realm/PrivateSymbols.txt"',
}
s.preserve_paths = %w(include scripts Configuration/Realm/PrivateSymbols.txt)
s.resource_bundles = {'realm_objc_privacy' => ['Realm/PrivacyInfo.xcprivacy']}

s.ios.deployment_target = '11.0'
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.13'
s.watchos.deployment_target = '4.0'
s.tvos.deployment_target = '11.0'
s.tvos.deployment_target = '12.0'

s.vendored_frameworks = 'core/realm-monorepo.xcframework'

Expand Down
11 changes: 0 additions & 11 deletions Realm/ObjectServerTests/RealmServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ extension URLSession {
}

// Synchronously perform a data task, returning the data from it
@available(macOS 10.12, *)
fileprivate func resultDataTask(with request: URLRequest) -> Result<Data, Error> {
let result = Locked(Result<Data, Error>?.none)
let group = DispatchGroup()
Expand Down Expand Up @@ -125,10 +124,6 @@ private extension Property {
}
}

// Swift 5.8 complains if collections are inferred as having type Any and adding
// explicit types everywhere makes things awful, but this doesn't quite work on
// older versions of Swift
#if swift(>=5.8)
internal protocol Json {}
extension Bool: Json {}
extension Int: Json {}
Expand All @@ -138,9 +133,6 @@ extension Double: Json {}
extension Dictionary: Json where Key == String, Value == Json {}
extension Array: Json where Element == Json {}
extension Optional: Json where Wrapped: Json {}
#else
typealias Json = Any
#endif

private extension ObjectSchema {
func stitchRule(_ partitionKeyType: String?, id: String? = nil, appId: String) -> [String: Json] {
Expand Down Expand Up @@ -218,7 +210,6 @@ private extension DispatchGroup {

// MARK: AdminSession
/// An authenticated session for using the Admin API
@available(macOS 10.12, *)
class AdminSession {
/// The access token of the authenticated user
var accessToken: String
Expand Down Expand Up @@ -425,7 +416,6 @@ class AdminSession {
}

// MARK: - Admin
@available(macOS 10.12, *)
class Admin {
private func userProfile(accessToken: String) -> Result<AdminProfile, Error> {
var request = URLRequest(url: URL(string: "http://localhost:9090/api/admin/v3.0/auth/profile")!)
Expand Down Expand Up @@ -482,7 +472,6 @@ public enum SyncMode {
A sandboxed server. This singleton launches and maintains all server processes
and allows for app creation.
*/
@available(OSX 10.13, *)
@objc(RealmServer)
public class RealmServer: NSObject {
public enum LogLevel: Sendable {
Expand Down
2 changes: 0 additions & 2 deletions Realm/ObjectServerTests/SwiftAsymmetricSyncServerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ class SwiftAsymmetricSyncTests: SwiftSyncTestCase {
}
}

#if swift(>=5.8)
@available(macOS 13.0, *)
extension SwiftAsymmetricSyncTests {
@MainActor
Expand Down Expand Up @@ -297,5 +296,4 @@ extension SwiftAsymmetricSyncTests {
XCTAssertEqual(document!["custom_stringCol"], AnyBSON("$%&/("))
}
}
#endif // canImport(_Concurrency)
#endif // os(macOS)
8 changes: 0 additions & 8 deletions Realm/ObjectServerTests/SwiftMongoClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -738,11 +738,6 @@ class SwiftMongoClientTests: SwiftSyncTestCase {
watchTestUtility.waitForClose()
}

#if swift(>=5.8)
// wait(for:) doesn't work in async functions because it blocks the calling
// thread and doesn't let async tasks run. Xcode 14.3 introduced a new async
// version of it which does work, but there doesn't appear to be a workaround
// for older Xcode versions.
@available(macOS 13, *)
func performAsyncWatchTest(filterIds: Bool = false, matchFilter: Bool = false) async throws {
let collection = setupMongoCollection()
Expand Down Expand Up @@ -802,7 +797,6 @@ class SwiftMongoClientTests: SwiftSyncTestCase {
func testWatchWithFilterIdsAsync() async throws {
try await performAsyncWatchTest(filterIds: true)
}
#endif

func testWatchMultipleFilterStreams() throws {
try performMultipleWatchStreamsTest(nil)
Expand Down Expand Up @@ -868,7 +862,6 @@ class SwiftMongoClientTests: SwiftSyncTestCase {
}
}

#if swift(>=5.8)
// MARK: - AsyncAwaitMongoClientTests
@available(macOS 13, *)
class AsyncAwaitMongoClientTests: SwiftSyncTestCase {
Expand Down Expand Up @@ -1247,6 +1240,5 @@ class AsyncAwaitMongoClientTests: SwiftSyncTestCase {
XCTAssertEqual(count5, 1)
}
}
#endif

#endif // os(macOS)
2 changes: 0 additions & 2 deletions Realm/ObjectServerTests/SwiftSyncTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ open class SwiftSyncTestCase: RLMSyncTestCase {
XCTAssertEqual(collection.count(filter: [:]).await(self), count)
}

#if swift(>=5.8)
// MARK: - Async helpers

// These are async versions of the synchronous functions defined above.
Expand Down Expand Up @@ -254,7 +253,6 @@ open class SwiftSyncTestCase: RLMSyncTestCase {
let credentials = try await basicCredentials(app: app)
return try await (app ?? self.app).login(credentials: credentials)
}
#endif // swift(>=5.8)
}

@available(macOS 10.15, watchOS 6.0, iOS 13.0, tvOS 13.0, *)
Expand Down
13 changes: 4 additions & 9 deletions RealmSwift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Pod::Spec.new do |s|
s.social_media_url = 'https://twitter.com/realm'
s.documentation_url = "https://docs.mongodb.com/realm/sdk/swift"
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.ios.deployment_target = '11.0'
s.ios.deployment_target = '12.0'
s.osx.deployment_target = '10.13'
s.watchos.deployment_target = '4.0'
s.tvos.deployment_target = '11.0'
s.tvos.deployment_target = '12.0'
s.preserve_paths = %w(build.sh)
s.swift_version = '5'

Expand All @@ -37,18 +37,13 @@ Pod::Spec.new do |s|
'IPHONEOS_DEPLOYMENT_TARGET_1500' => '12.0',
'IPHONEOS_DEPLOYMENT_TARGET' => '$(IPHONEOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))',
'MACOSX_DEPLOYMENT_TARGET_1400' => '10.13',
'MACOSX_DEPLOYMENT_TARGET_1500' => '10.14',
'MACOSX_DEPLOYMENT_TARGET_1500' => '10.13',
'MACOSX_DEPLOYMENT_TARGET' => '$(MACOSX_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))',
'WATCHOS_DEPLOYMENT_TARGET_1400' => '4.0',
'WATCHOS_DEPLOYMENT_TARGET_1500' => '5.0',
'WATCHOS_DEPLOYMENT_TARGET_1500' => '4.0',
'WATCHOS_DEPLOYMENT_TARGET' => '$(WATCHOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))',
'TVOS_DEPLOYMENT_TARGET_1400' => '11.0',
'TVOS_DEPLOYMENT_TARGET_1500' => '12.0',
'TVOS_DEPLOYMENT_TARGET' => '$(TVOS_DEPLOYMENT_TARGET_$(XCODE_VERSION_MAJOR))',

'REALM_LD_CLASSIC_1400' => '',
'REALM_LD_CLASSIC_1500' => '-Wl,-ld_classic',
'REALM_LD_CLASSIC' => '$(REALM_LD_CLASSIC_$(XCODE_VERSION_MAJOR))',
'OTHER_LDFLAGS' => '$(REALM_LD_CLASSIC)',
}
end
2 changes: 0 additions & 2 deletions RealmSwift/Aliases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ extension ObjectBase {
}
}

#if swift(>=5.8)
@available(macOS 10.15, tvOS 13.0, iOS 13.0, watchOS 6.0, *)
internal func _observe<A: Actor, T: ObjectBase>(
keyPaths: [String]? = nil, on actor: isolated A,
Expand All @@ -104,5 +103,4 @@ extension ObjectBase {
onCancel: { token.invalidate() })
return token
}
#endif // swift(>=5.8)
}
2 changes: 0 additions & 2 deletions RealmSwift/EmbeddedObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ extension EmbeddedObject: _RealmCollectionValueInsideOptional {
return _observe(on: queue, block)
}

#if swift(>=5.8)
/**
Registers a block to be called each time the object changes.

Expand Down Expand Up @@ -303,7 +302,6 @@ extension EmbeddedObject: _RealmCollectionValueInsideOptional {
) async -> NotificationToken {
await observe(keyPaths: keyPaths.map(_name(for:)), on: actor, block)
}
#endif // swift(>=5.8)

// MARK: Dynamic list

Expand Down
4 changes: 0 additions & 4 deletions RealmSwift/Impl/RealmCollectionImpl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ extension RealmCollectionImpl {
return collection.addNotificationBlock(wrapped, keyPaths: keyPaths, queue: queue)
}

#if swift(>=5.8)
@available(macOS 10.15, tvOS 13.0, iOS 13.0, watchOS 6.0, *)
@_unsafeInheritExecutor
public func observe<A: Actor>(
Expand All @@ -135,7 +134,6 @@ extension RealmCollectionImpl {
}
} ?? NotificationToken()
}
#endif

public var isFrozen: Bool {
return collection.isFrozen
Expand Down Expand Up @@ -170,7 +168,6 @@ extension Optional: OptionalProtocol {
public func _rlmInferWrappedType() -> Wrapped { return self! }
}

#if swift(>=5.8)
// `with(object, on: actor) { object, actor in ... }` hands the object over
// to the given actor and then invokes the callback within the actor.
// This might make sense to expose publicly.
Expand Down Expand Up @@ -221,4 +218,3 @@ internal func with<A: Actor, Value: ThreadConfined, Return: Sendable>(
#endif
}
}
#endif
2 changes: 0 additions & 2 deletions RealmSwift/Map.swift
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@ public final class Map<Key: _MapKey, Value: RealmCollectionValue>: RLMSwiftColle
return rlmDictionary.addNotificationBlock(wrapped, keyPaths: keyPaths, queue: queue)
}

#if swift(>=5.8)
/**
Registers a block to be called each time the map changes.

Expand Down Expand Up @@ -699,7 +698,6 @@ public final class Map<Key: _MapKey, Value: RealmCollectionValue>: RLMSwiftColle
) async -> NotificationToken where Value: OptionalProtocol, Value.Wrapped: ObjectBase {
await observe(keyPaths: keyPaths.map(_name(for:)), on: actor, block)
}
#endif

// MARK: Frozen Objects

Expand Down
2 changes: 0 additions & 2 deletions RealmSwift/Object.swift
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ extension Object: _RealmCollectionValueInsideOptional {
_observe(keyPaths: keyPaths.map(_name(for:)), on: queue, block)
}

#if swift(>=5.8)
/**
Registers a block to be called each time the object changes.

Expand Down Expand Up @@ -492,7 +491,6 @@ extension Object: _RealmCollectionValueInsideOptional {
) async -> NotificationToken {
await observe(keyPaths: keyPaths.map(_name(for:)), on: actor, block)
}
#endif // swift(>=5.8)

// MARK: Dynamic list

Expand Down
Loading

0 comments on commit 3d12581

Please sign in to comment.