Tealium / tealium-swift

Tealium Swift Integration Library
Other
41 stars 40 forks source link

[TEALIUM SWIFT BUG]: Unable to compile Tealium with Xcode12 & Carthage #145

Closed JuhaO81 closed 3 years ago

JuhaO81 commented 4 years ago

Trying to compile Tealium 1.9.5 with carthage using Xcode12 beta1 as build environment fails. Here is the log:

Undefined symbols for architecture i386: "type metadata for Swift._StringObject.Variant", referenced from: outlined init with take of Swift._StringObject.Variant in TealiumDiskStorage.o ld: symbol(s) not found for architecture i386

craigrouse commented 4 years ago

Thanks @JuhaO81. We're just having a play around with the beta ourselves too, so thanks for the early warning about this. Installation via Swift Package Manager works as expected.

craigrouse commented 4 years ago

@JuhaO81 could I just check which build of Xcode you're using? Are you using the one designated for building Universal binaries for Apple Silicon and Intel processors, or the standard build?

craigrouse commented 4 years ago

A quick check of the Carthage GH Issues page revealed this issue: https://github.com/Carthage/Carthage/issues/3004

This seems very similar to our issue. We'll continue to investigate 🕵️

JuhaO81 commented 4 years ago

I was compiling with "carthage update --platform iOS"

JuhaO81 commented 4 years ago

hmm I might try Swift Package Manager. Thx for the tip.

craigrouse commented 4 years ago

@JuhaO81 Let us know how you get on. SPM is far quicker to build our library if you're able to use it!

Which version of the beta do you have? image

Xcode > About will give you the exact build number. Thanks!

craigrouse commented 4 years ago

@JuhaO81 FYI, I've found that this is a Swift compiler/code optimizer bug. I've posted my findings on the Carthage issue page and also sent feedback to Apple. I've checked again with Swift Package manager and I'm definitely not seeing an issue there, even if the app is in Release mode, so I hope that's an acceptable workaround for the time being. Thanks again for taking the time to let us know about this.

JuhaO81 commented 4 years ago

Version 12.0 beta (12A6159)

craigrouse commented 4 years ago

This is confirmed to be an Xcode bug: https://developer.apple.com/forums/thread/649918

Will leave this issue open for now for visibility, but there is nothing we can do until the Xcode issue is resolved.

JuhaO81 commented 4 years ago

SMP worked just fine! Thanks for the tip.

JuhaO81 commented 4 years ago

About Carthage vs SMP. We have used Carthage so that we compile the libs and commit them to git. This way we have prebuild libs and they don't need to be compiled every time on developers machines.

I roughly calculated that compiling Tealium at my machine with SMP took over 2 minutes. This means two minutes extra wait time for every clean build.

As result we hope Carthage support starts to work that we can switch back using it :)

craigrouse commented 4 years ago

@JuhaO81 we have a few optimizations coming that should speed up compilation time. Hopefully the xcode bug affecting Carthage builds will be fixed before the final release of Xcode 12.

denni01 commented 4 years ago

@craigrouse, it looks like Apple has explicitly stated that the Valid Architectures build setting is no longer supported here in the build system section. The supported path forward is to use Excluded Architectures build setting instead. This should allow the project to build with Carthage.

JuhaO81 commented 3 years ago

This is not anymore relevant to us. We moved to SPM.

christinasund commented 3 years ago

This has been fixed in the 2.1.0 release, let us know of any other issues. Thanks