Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbound variable error in prepare artifacts script when vending xcframework (macos-x86_64) #9572

Closed
1 task done
hewigovens opened this issue Feb 29, 2020 · 2 comments
Closed
1 task done
Assignees
Labels
r:xcframeworks Related to the support for XCFrameworks s2:confirmed Issues that have been confirmed by a CocoaPods contributor
Milestone

Comments

@hewigovens
Copy link

Report

What did you do?

we have a framework contains both macos-x86_64 and ios-x86_64-maccatalyst

TrustWalletCore.xcframework
├── Info.plist
├── ios-arm64
│   └── TrustWalletCore.framework
├── ios-x86_64-maccatalyst
│   └── TrustWalletCore.framework
├── ios-x86_64-simulator
│   └── TrustWalletCore.framework
└── macos-x86_64
    └── TrustWalletCore.framework

The corresponding podspec:

Pod::Spec.new do |s|
  s.name             = 'WalletCoreFW'
  s.version          = '2.0.2'
  s.summary          = 'Trust Wallet core data structures and algorithms.'
  s.homepage         = 'https://github.com/trustwallet/wallet-core'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'hewigovens' => '360470+hewigovens@users.noreply.github.com' }
  s.source           = { :git => 'https://github.com/trustwallet/wallet-core.git', :tag => s.version.to_s }
  s.social_media_url = 'https://twitter.com/wallet_core'
  s.source = {
    http: 'https://wallet-core-dev.s3.ap-northeast-2.amazonaws.com/TrustWalletCore.xcframework-2.0.2.zip'
  }
  s.vendored_frameworks = 'TrustWalletCore.xcframework'
  s.ios.deployment_target = '11.0'
  s.osx.deployment_target = '10.12'
  s.swift_version = '5.1'
  s.dependency 'SwiftProtobuf'
end

but pod spec lint --allow-warnings failed if you enable s.osx.deployment_target = '10.12'

I also created a demo repo to reproduce this issue: https://github.com/hewigovens/TestXCFFFF and managed to build the project after change EFFECTIVE_PLATFORM_NAME checking in Pods-TestXCFFFF-artifacts.sh :

  if [[ ! -z ${EFFECTIVE_PLATFORM_NAME+x} && "$EFFECTIVE_PLATFORM_NAME" == *"maccatalyst" ]]; then
    target_variant="maccatalyst"
  fi

What did you expect to happen?

pod spec lint --allow-warnings successfully

What happened instead?

Failed to lint when osx.deployment_target is enabled

CocoaPods Environment

Stack

   CocoaPods : 1.9.0
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin18]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.3 (19D76)
       Xcode : 11.3.1 (11C504)
         Git : git version 2.25.0
Ruby lib dir : /Users/hewig/.rbenv/versions/2.6.3/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git @ 246318328d3e6054d677b0c5b4deaa91bd048995

               trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /Users/hewig/.rbenv/versions/2.6.3/bin/pod

Plugins

claide-plugins         : 0.9.2
cocoapods-deintegrate  : 1.0.4
cocoapods-dependencies : 1.0.0.beta.1
cocoapods-plugins      : 1.0.0
cocoapods-search       : 1.0.0
cocoapods-stats        : 1.1.0
cocoapods-trunk        : 1.4.0
cocoapods-try          : 1.1.0
cocoapods_debug        : 0.1.0

Podfile

platform :osx, '10.12'

target 'TestXCFFFF' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  pod 'WalletCoreFW', path: './'
  pod 'SwiftProtobuf'
end

Project that demonstrates the issue

https://github.com/hewigovens/TestXCFFFF

@amorde amorde added r:xcframeworks Related to the support for XCFrameworks s2:confirmed Issues that have been confirmed by a CocoaPods contributor labels Feb 29, 2020
@amorde
Copy link
Member

amorde commented Feb 29, 2020

Thanks for the report - I made the incorrect assumption that variable would always be available, but looks like Xcode doesn't export it at all for lower macOS deployment targets.

@amorde amorde added this to the 1.9.1 milestone Feb 29, 2020
@amorde
Copy link
Member

amorde commented Feb 29, 2020

And +1 for including a fix in the report 🙏

@amorde amorde self-assigned this Feb 29, 2020
amorde added a commit that referenced this issue Feb 29, 2020
${EFFECTIVE_PLATFORM_NAME} will only be set if applicable for the current platform.

Closes #9572
amorde added a commit that referenced this issue Feb 29, 2020
${EFFECTIVE_PLATFORM_NAME} will only be set if applicable for the current platform.

Closes #9572
amorde added a commit that referenced this issue Mar 1, 2020
${EFFECTIVE_PLATFORM_NAME} will only be set if applicable for the current platform.

Closes #9572
@dnkoutso dnkoutso closed this as completed Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r:xcframeworks Related to the support for XCFrameworks s2:confirmed Issues that have been confirmed by a CocoaPods contributor
Projects
None yet
Development

No branches or pull requests

3 participants