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

Most upvoted comments

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:

@el-hoshino

Thanks for the confirmation 👍

But BTW, DEVELOPER_DIR=/Applications/Xcode-10.1.app/Contents/Developer ←does it work for those who don’t have Xcode-10.1.app app in their /Application directory…?

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.

. Xcode 10.1(Swift 4.2.1) or earlier Xcode 10.2(Swift 5.0) or later
Build
Homebrew
CocoaPods

My environment

  • macOS 10.14.4
  • Installed Xcode versions
    • Xcode 10.2 (Default Command Line Tools)
    • Xcode 10.1

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.

image

Xcode 10.1

$ swift --version
$ Apple Swift version 4.2.1 (swiftlang-1000.11.42 clang-1000.11.45.1)
$ Target: x86_64-apple-darwin18.5.0

Xcode 10.2

$ swift --version
$ Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
$ Target: x86_64-apple-darwin18.5.0

Build Result

. Swift 4.2.1 Swift 5.0
with -Xswiftc -static-stdlib
without -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.

$ brew upgrade license-plist
==> Upgrading 1 outdated package:
mono0926/license-plist/license-plist 2.0.0 -> 2.4.0
==> Upgrading mono0926/license-plist/license-plist
==> Downloading https://github.com/mono0926/LicensePlist/archive/2.4.0.tar.gz
Already downloaded: /Users/davidcorbin/Library/Caches/Homebrew/downloads/f895de1e973f820618d1fcbfd0aaedd10065f3f7841c28a69c2d40520c07de47--LicensePlist-2.4.0.tar.gz
==> make install PREFIX=/usr/local/Cellar/license-plist/2.4.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

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!