BatchLabs / Batch-iOS-SDK

Batch SDK for iOS
https://batch.com/features
Other
29 stars 12 forks source link

Build fails on XCode 14 with Carthage #32

Closed tokou closed 1 year ago

tokou commented 1 year ago

Summary

Our build fails when building the Batch SDK dependency using Carthage since moving to XCode 14

Reproduction steps

xcodebuild -project Sources/Batch.xcodeproj -scheme Batch -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO

Logs

Command line invocation:
    /Applications/Xcode-14.2.0.app/Contents/Developer/usr/bin/xcodebuild -project Sources/Batch.xcodeproj -scheme Batch -configuration Release -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive VALIDATE_WORKSPACE=NO SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO

User defaults from command line:
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    CARTHAGE = YES
    CLANG_ENABLE_CODE_COVERAGE = NO
    CODE_SIGN_IDENTITY =
    CODE_SIGNING_REQUIRED = NO
    GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
    ONLY_ACTIVE_ARCH = NO
    SDKROOT = iphoneos16.2
    SKIP_INSTALL = YES
    STRIP_INSTALLED_PRODUCT = NO
    VALIDATE_WORKSPACE = NO

Resolve Package Graph

Resolved source packages:
  InstantMock: https://github.com/pirishd/InstantMock @ 2.5.5

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device }
{ platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00006000-000C58C80223801E }
{ platform:macOS, arch:arm64, variant:Mac Catalyst, id:00006000-000C58C80223801E }
{ platform:macOS, arch:x86_64, variant:Mac Catalyst, id:00006000-000C58C80223801E }
{ platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device }
{ platform:macOS, variant:Mac Catalyst, name:Any Mac }
{ platform:iOS Simulator, id:68496E12-FA34-46B9-8503-77E3191A6DE8, OS:16.2, name:iPad (9th generation) }
{ platform:iOS Simulator, id:04489EE7-9898-47CC-AFE7-DC46E014FEE3, OS:16.2, name:iPad (10th generation) }
{ platform:iOS Simulator, id:24D6A622-CA1F-40F8-8E8E-4923B40B2510, OS:16.2, name:iPad Air (5th generation) }
{ platform:iOS Simulator, id:4B11511A-A023-4805-99F2-2495C67B6300, OS:16.2, name:iPad Pro (9.7-inch) }
{ platform:iOS Simulator, id:CF9DA727-F10E-42E5-94FA-29D1674FFA29, OS:16.2, name:iPad Pro (11-inch) (3rd generation) }
{ platform:iOS Simulator, id:F1736F3A-B64A-4E38-BA21-AAFCDCF79873, OS:16.2, name:iPad Pro (11-inch) (4th generation) }
{ platform:iOS Simulator, id:BBA84FE7-10A6-4993-B361-9F33147B302F, OS:16.2, name:iPad Pro (12.9-inch) (5th generation) }
{ platform:iOS Simulator, id:9425C122-AF1F-4253-B55C-2A89142D25DE, OS:16.2, name:iPad Pro (12.9-inch) (6th generation) }
{ platform:iOS Simulator, id:C7763C6A-17E3-4284-8171-A8CF927D4B79, OS:16.2, name:iPad mini (6th generation) }
{ platform:iOS Simulator, id:3A645A10-B546-4666-AB5D-CA67A667885C, OS:16.2, name:iPhone 8 }
{ platform:iOS Simulator, id:277A185A-02D3-418C-B80A-AA93B3F636CB, OS:16.2, name:iPhone 8 Plus }
{ platform:iOS Simulator, id:33C66DA8-649C-4705-9459-75DD6E95CFD9, OS:16.2, name:iPhone 11 }
{ platform:iOS Simulator, id:83BBEAD7-5621-480F-BD9E-7D978E0912B8, OS:16.2, name:iPhone 11 Pro }
{ platform:iOS Simulator, id:5C3F57C3-57E1-42F4-B9A0-7FA227591139, OS:16.2, name:iPhone 11 Pro Max }
{ platform:iOS Simulator, id:E8DAB9FB-ECB0-4999-B815-81ECDF0C6585, OS:16.2, name:iPhone 12 }
{ platform:iOS Simulator, id:35AC681A-D141-48B5-8739-D473C527484A, OS:16.2, name:iPhone 12 Pro }
{ platform:iOS Simulator, id:563503A5-5660-4D4F-94B0-BC4028D110F6, OS:16.2, name:iPhone 12 Pro Max }
{ platform:iOS Simulator, id:08253095-DB3B-438B-AAE1-D83C32560307, OS:16.2, name:iPhone 12 mini }
{ platform:iOS Simulator, id:F01E1C72-1241-4877-A790-131C218979CD, OS:16.2, name:iPhone 13 }
{ platform:iOS Simulator, id:516169F8-F8EE-46A5-A3A5-16DFEC455A16, OS:16.2, name:iPhone 13 Pro }
{ platform:iOS Simulator, id:3A6C96B4-8F4B-46E8-A66E-B1F712C29092, OS:16.2, name:iPhone 13 Pro Max }
{ platform:iOS Simulator, id:C899514D-D1AB-40F4-9902-DF4D244D1286, OS:16.2, name:iPhone 13 mini }
{ platform:iOS Simulator, id:2EB1F857-C828-46C2-A578-20BF3123D572, OS:16.2, name:iPhone 14 }
{ platform:iOS Simulator, id:CD2A4BAB-9092-4223-AE69-C1041ABE8649, OS:16.2, name:iPhone 14 Plus }
{ platform:iOS Simulator, id:76F798F8-5D09-44D0-8111-EE6382D52CBA, OS:16.2, name:iPhone 14 Pro }
{ platform:iOS Simulator, id:5B8AB764-6766-4141-8652-C4E19C9C0B56, OS:16.2, name:iPhone 14 Pro Max }
{ platform:iOS Simulator, id:99E28BB9-4B6E-4947-BDD0-27A27E8835EE, OS:16.2, name:iPhone SE (3rd generation) }

Prepare packages

note: Using codesigning identity override:
Computing target dependency graph and provisioning inputs

Create build description
Build description signature: 08485287b63024081d7fe789146492f8
Build description path: /Users/tarek/Library/Developer/Xcode/DerivedData/Batch-disvrprujjrztfhgyposajdtyuvn/Build/Intermediates.noindex/ArchiveIntermediates/Batch/IntermediateBuildFilesPath/XCBuildData/08485287b63024081d7fe789146492f8-desc.xcbuild

note: Building targets in dependency order
/Users/tarek/Sources/360Learning/Batch-iOS-SDK/Sources/Batch.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 11.0 to 16.2.99. (in target 'Batch' from project 'Batch')
error: The armv7s architecture is deprecated. You should update your ARCHS build setting to remove the armv7s architecture. (in target 'Batch' from project 'Batch')
warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Batch' from project 'Batch')
** ARCHIVE FAILED **

Specifications

SDK Version

1.19.2

Installation method

Carthage

Relevant development tools versions

XCode 14.2

Additional information

This bug can be fixed by removing the armv7s architecture in Build Settings. Here's a patch for the fix

diff --git a/Sources/Batch.xcodeproj/project.pbxproj b/Sources/Batch.xcodeproj/project.pbxproj
index 6038691..9ccb93b 100644
--- a/Sources/Batch.xcodeproj/project.pbxproj
+++ b/Sources/Batch.xcodeproj/project.pbxproj
@@ -3918,6 +3918,11 @@
                517D701F22BBC34A00E374FB /* Release */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
+                               "ARCHS[sdk=iphoneos*]" = (
+                                       "$(ARCHS_STANDARD)",
+                                       arm64e,
+                                       armv7s,
+                               );
                                BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
                                CLANG_ANALYZER_NONNULL = YES;
                                CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
abarisain commented 1 year ago

Hi,

Thanks for the report.

Support for the armv7s architecture and iOS 10 will be dropped in a future version, but we cannot release this as a patch as this would break the semver contract.

Carthage should pick up the precompiled versions, are you building from source on purpose? If so, I suggest you patch this out in a fork for the time being, or find a way to use the precompiled version.

I have not used Carthage in a while, but you also may be able to override the Xcode build settings and override the ARCH.

abarisain commented 1 year ago

Closing this as the new version we're about to release drops iOS 10 and armv7s