LicensePlist: Build fails on Xcode 10.2(Swift 5.0)
When I run brew upgrade license-plist
I get the following error.
$ brew upgrade license-plist
==> Upgrading 1 outdated package:
mono0926/license-plist/license-plist 2.0.0 -> 2.3.0
==> Upgrading mono0926/license-plist/license-plist
==> Downloading https://github.com/mono0926/LicensePlist/archive/2.3.0.tar.gz
Already downloaded: /Users/davidcorbin/Library/Caches/Homebrew/downloads/fdbb23e4cbb10e97c178e8caf0d2aff6be4d3134ecf89b892773398384ccce25--LicensePlist-2.3.0.tar.gz
==> make install PREFIX=/usr/local/Cellar/license-plist/2.3.0
Last 15 lines from /Users/davidcorbin/Library/Logs/Homebrew/license-plist/01.make:
"_swift_weakInit", referenced from:
_$s6APIKit7SessionC14cancelRequests4with11passingTestyxm_SbxctAA7RequestRzlF in Session.swift.o
"_swift_weakLoadStrong", referenced from:
_$s6APIKit7SessionC14cancelRequests4with11passingTestyxm_SbxctAA7RequestRzlFySayAA0B4Task_pGcfU_SbAaH_pXEfU_ in Session.swift.o
"_swift_willThrow", referenced from:
_$s10Foundation4DataV6APIKitE11inputStream8capacityACSo07NSInputE0C_SitKcfCTf4gnd_n in Data+InputStream.swift.o
_$s6APIKit28FormURLEncodedBodyParametersVAA0dE0A2aDP11buildEntityAA07RequestdG0OyKFTW in FormURLEncodedBodyParameters.swift.o
_$s6APIKit18JSONBodyParametersV11buildEntityAA011RequestBodyE0OyKF in JSONBodyParameters.swift.o
_$s6APIKit18JSONBodyParametersVAA04BodyC0A2aDP11buildEntityAA07RequestdF0OyKFTW in JSONBodyParameters.swift.o
_$s6APIKit31MultipartFormDataBodyParametersVAA0eF0A2aDP11buildEntityAA07RequesteH0OyKFTW in MultipartFormDataBodyParameters.swift.o
_$s6APIKit31MultipartFormDataBodyParametersV4PartV5value4name8mimeType8fileName8encodingAEyp_S2SSgAKSS10FoundationE8EncodingVtKcfC in MultipartFormDataBodyParameters.swift.o
_$s6APIKit31MultipartFormDataBodyParametersV4PartV7fileURL4name8mimeType0H4NameAE10Foundation0I0V_S2SSgAMtKcfC in MultipartFormDataBodyParameters.swift.o
...
ld: symbol(s) not found for architecture x86_64
make: *** [build] Error 1
If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/mono0926/homebrew-license-plist/issues
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 18 (10 by maintainers)
Commits related to this issue
- Update README - https://github.com/mono0926/LicensePlist/issues/102 — committed to mono0926/LicensePlist by mono0926 5 years ago
- Update README - https://github.com/mono0926/LicensePlist/issues/102 Fix Move caution — committed to mono0926/LicensePlist by mono0926 5 years ago
Confirmed on both my personal environment and my CI (Bitrise) environment 🎉
Same problem happens on my environment too. It turns out that it seems to be an issue of APIKit which LicensePlist uses as a dependency.
I tried to fork APIKit, update its dependencies as well as Xcode settings; and then fork LicensePlist and update its dependencies to include my forked APIKit, then it worked well.
There’s already someone sent a PR to migrate APIKit to Swift 5, so hopefully it’ll be resolved soon.
Reference:
My forked APIKit with updates: https://github.com/el-hoshino/APIKit/commits/master
My forked LicensePlist with updates: https://github.com/el-hoshino/LicensePlist/commits/master
@el-hoshino
Thanks for the confirmation 👍
No, but it is used for releasing new CocoaPods version, so there are no problems for normal users. Maintainer(only me, currently) should have Xcode-10.1.app app in their /Application directory.
I’ve released 2.5.0 and all problems have been fixed as far as I confirmed.
My environment
I prepared different build, and use it for CocoaPods build with Xcode 10.1:
https://github.com/mono0926/LicensePlist/blob/439d7ae9d7afe976228a7207bdee167ff4103182/Makefile#L8-L11
https://github.com/mono0926/LicensePlist/blob/2a2fcb1eacebe6696dcbaf3e65fa0a56411b9d19/Makefile#L29-L34
https://github.com/mono0926/LicensePlist/blob/2a2fcb1eacebe6696dcbaf3e65fa0a56411b9d19/release.sh#L70
It seems that the build result depends on Command Line Tools versions.
Xcode 10.1
Xcode 10.2
Build Result
-Xswiftc -static-stdlib
-Xswiftc -static-stdlib
https://github.com/mono0926/LicensePlist/blob/2d793f20da00f1128e4e168c2b7f9c7c9d03b3be/Makefile#L5-L6
But, without
-Xswiftc -static-stdlib
, the tool which is installed by CocoaPods doesn’t work on Xcode 10.1(Swift 4.2.1) or earlier(ABI not supported version) as written #103. So, I think it is prioritized.I added about this to README.
I am using xcode 10.2.1 and installed it via brew without any problems.
I guess one of the workarounds we can do now is to deploy different versions for CocoaPods and Homebrew with different versions specified in .podspec file and formula file 😄
@mono0926 Found a similar problem here: https://github.com/grpc/grpc-swift/issues/416
Seems that it’s because Xcode no longer embeds Swift Standard Library 🤔
I tried installing through homebrew again and got the same error with 2.4.0.
However, I cloned the repository and ran
make install
and there were no problems. I will just use the version from source for now! Thanks!