From 9218239e460438dc15d32f237595b4a32d205882 Mon Sep 17 00:00:00 2001 From: Roman Melnyk Date: Thu, 8 Sep 2022 17:45:27 +0300 Subject: [PATCH 1/2] #34610 Fix invalid range "t-5" in string transliteration [iOS] for M1 pod install issue. --- scripts/cocoapods/utils.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/cocoapods/utils.rb b/scripts/cocoapods/utils.rb index bc14b58378e2..b93df4e66b56 100644 --- a/scripts/cocoapods/utils.rb +++ b/scripts/cocoapods/utils.rb @@ -139,14 +139,16 @@ def self.fix_library_search_path(config) return end - # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1) - # since the libraries there are only built for x86_64 and i386. - lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") - lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"") - - if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\"")) - # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11 - lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift") + if lib_search_paths.include?("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") || lib_search_paths.include?("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"") + # $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) causes problem with Xcode 12.5 + arm64 (Apple M1) + # since the libraries there are only built for x86_64 and i386. + lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") + lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"") + + if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\"")) + # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11 + lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift") + end end end From dd4a2d1d07ade6c3f90c489deb6caf34111abfaa Mon Sep 17 00:00:00 2001 From: Roman Melnyk Date: Fri, 9 Sep 2022 17:52:52 +0300 Subject: [PATCH 2/2] Fix tests. --- scripts/cocoapods/utils.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/cocoapods/utils.rb b/scripts/cocoapods/utils.rb index b93df4e66b56..7b5cc32bb453 100644 --- a/scripts/cocoapods/utils.rb +++ b/scripts/cocoapods/utils.rb @@ -144,11 +144,11 @@ def self.fix_library_search_path(config) # since the libraries there are only built for x86_64 and i386. lib_search_paths.delete("$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)") lib_search_paths.delete("\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"") + end - if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\"")) - # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11 - lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift") - end + if !(lib_search_paths.include?("$(SDKROOT)/usr/lib/swift") || lib_search_paths.include?("\"$(SDKROOT)/usr/lib/swift\"")) + # however, $(SDKROOT)/usr/lib/swift is required, at least if user is not running CocoaPods 1.11 + lib_search_paths.insert(0, "$(SDKROOT)/usr/lib/swift") end end