Skip to content

Commit

Permalink
[SSDK-736] fix SDK import through SPM (#213)
Browse files Browse the repository at this point in the history
### Description
Fixes SSDK-736

- This fixes a "SILFunction type mistmatch" when using SPM and Xcode 15.3.
- More on SILFunction type mismatch: swiftlang/swift#65849

> I'm asking because @_implementationOnly is only compatible with resilient modules. You can build resilient modules using a classic Xcode project and by enabling the build setting Build Library for Distribution. I believe packages don't yet have a way to enable this feature without using unsafe flags.
>
> Using @_implementationOnly without resilience may lead to runtime crashes and memory corruption. Very recent compilers warn about this configuration.
>
> Considering @_implementationOnly is an unofficial feature you may still hit compiler crashes even in supported configurations. While there's not much we can do for crashes without resilience, if you still see a crash after enabling resilience I may be able to help on that front.

### Checklist
- [x] Update `CHANGELOG`
  • Loading branch information
aokj4ck authored Apr 19, 2024
1 parent 993f04f commit fa0a370
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 39 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Guide: https://keepachangelog.com/en/1.0.0/

<!-- Add changes for active work here -->

- [Offline] Remove `CoreOfflineIndexChangeEventType` extension previously used for development.
- [Core] Remove usages of `@_implementationOnly import` due to compilation issue.

- [Offline] Add optional `language` parameter to SearchOfflineManager.createTilesetDescriptor and SearchOfflineManager.createPlacesTilesetDescriptor functions.
- [Tests] Add Spanish language offline search test.

Expand Down
12 changes: 0 additions & 12 deletions MapboxSearch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
0477904E2B890F4E00A99528 /* search-box-retrieve-minsk.json in Resources */ = {isa = PBXBuildFile; fileRef = 0477904C2B890F4E00A99528 /* search-box-retrieve-minsk.json */; };
0477904F2B890F4E00A99528 /* search-box-retrieve-minsk.json in Resources */ = {isa = PBXBuildFile; fileRef = 0477904C2B890F4E00A99528 /* search-box-retrieve-minsk.json */; };
0484BCDF2BC4865C003CF408 /* OfflineIndexObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0484BCDE2BC4865C003CF408 /* OfflineIndexObserver.swift */; };
0484BCE22BC49A23003CF408 /* CoreOfflineIndexChangeEventType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0484BCE12BC49A23003CF408 /* CoreOfflineIndexChangeEventType.swift */; };
048823482B6B0A9D00C770AA /* category-hotel-search-along-route-jp.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B7C2B6B043C00FDE7D5 /* category-hotel-search-along-route-jp.json */; };
048823492B6B0A9D00C770AA /* category-hotel-search-along-route-jp.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B7C2B6B043C00FDE7D5 /* category-hotel-search-along-route-jp.json */; };
0488234A2B6B0A9E00C770AA /* category-hotel-search-along-route-jp.json in Resources */ = {isa = PBXBuildFile; fileRef = 04AB0B7C2B6B043C00FDE7D5 /* category-hotel-search-along-route-jp.json */; };
Expand Down Expand Up @@ -543,7 +542,6 @@
047790482B890A8500A99528 /* search-box-recursion.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "search-box-recursion.json"; sourceTree = "<group>"; };
0477904C2B890F4E00A99528 /* search-box-retrieve-minsk.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "search-box-retrieve-minsk.json"; sourceTree = "<group>"; };
0484BCDE2BC4865C003CF408 /* OfflineIndexObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OfflineIndexObserver.swift; sourceTree = "<group>"; };
0484BCE12BC49A23003CF408 /* CoreOfflineIndexChangeEventType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreOfflineIndexChangeEventType.swift; sourceTree = "<group>"; };
04970F8C2B7A97C900213763 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
04AB0B4A2B6AADB700FDE7D5 /* mapbox.places.san.francisco.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = mapbox.places.san.francisco.json; sourceTree = "<group>"; };
04AB0B792B6AF37800FDE7D5 /* DiscoverIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscoverIntegrationTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1056,14 +1054,6 @@
path = sbs;
sourceTree = "<group>";
};
0484BCE02BC49A18003CF408 /* Offline */ = {
isa = PBXGroup;
children = (
0484BCE12BC49A23003CF408 /* CoreOfflineIndexChangeEventType.swift */,
);
path = Offline;
sourceTree = "<group>";
};
04970F8B2B7A97C900213763 /* Resources */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1744,7 +1734,6 @@
FEEDD2C12508DFE400DC0A98 /* InternalAPI */ = {
isa = PBXGroup;
children = (
0484BCE02BC49A18003CF408 /* Offline */,
04C127562B62FFD000884325 /* Engine */,
148DE66E285777050085684D /* Common */,
F98BECBB2577B9150081D3BC /* Telemetry */,
Expand Down Expand Up @@ -2677,7 +2666,6 @@
F9E8146225418E7D00F6378E /* EventsManager.swift in Sources */,
FEEDD3002508DFE400DC0A98 /* CLLocationCoordinate2DCodable.swift in Sources */,
FEEDD3042508DFE400DC0A98 /* SearchResultType.swift in Sources */,
0484BCE22BC49A23003CF408 /* CoreOfflineIndexChangeEventType.swift in Sources */,
F91FD66C258CCB41008CB8E1 /* CoreResultType+Extensions.swift in Sources */,
FEEDD3152508DFE400DC0A98 /* ServerSearchResult.swift in Sources */,
140E47A2298BC90E00677E30 /* Discover.swift in Sources */,
Expand Down
10 changes: 4 additions & 6 deletions Sources/MapboxSearch/InternalAPI/CoreAliases.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
@_implementationOnly import MapboxCommon_Private
import MapboxCommon_Private
import MapboxCoreSearch
import MapboxCoreSearch_Private

/// https://forums.swift.org/t/update-on-implementation-only-imports/26996
@_implementationOnly import MapboxCoreSearch
@_implementationOnly import MapboxCoreSearch_Private

// Note: This file included in MapboxSearch and MapboxSearchTests targets
// Note: This file is included in MapboxSearch and MapboxSearchTests targets

typealias CoreSearchEngine = MapboxCoreSearch.SearchEngine
typealias CoreSearchResponse = MapboxCoreSearch_Private.SearchResponse
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@_implementationOnly import MapboxCoreSearch
@testable import MapboxCoreSearch
@testable import MapboxSearch

class CoreUserRecordsLayerStub: CoreUserRecordsLayerProtocol {
Expand Down
1 change: 0 additions & 1 deletion Tests/MapboxSearchTests/CoreAliases.swift

This file was deleted.

1 change: 0 additions & 1 deletion Tests/MockWebServer/MockResponse.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
@_implementationOnly import MapboxCoreSearch
@testable import MapboxSearch
import Swifter
import XCTest
Expand Down

0 comments on commit fa0a370

Please sign in to comment.