CocoaPods / fourflusher

A library for interacting with Xcode simulators.
MIT License
32 stars 15 forks source link

DEVELOPER_DIR shell variable seems to not be respected in Cocoapods 1.0.1 #3

Closed maschall closed 5 years ago

maschall commented 8 years ago

I am doing the following in our CI build DEVELOPER_DIR=/Applications/Xcode6.4.app build_script.sh

The script runs a pod repo push --allow-warnings --use-libraries --verbose

In CocoaPods 0.37.1 we never had issues.

We are now getting an error

  • ERROR | [iOS] unknown: Encountered an unknown error (/Applications/Xcode7.2.app/Contents/Developer/usr/bin/xcrun simctl list devices

xcrun: error: unable to find Xcode installation from active developer path "/Applications/Xcode7.2.app", use xcode-select to change

/Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/fourflusher-0.3.2/lib/fourflusher/executable.rb:101:in execute_command' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/fourflusher-0.3.2/lib/fourflusher/executable.rb:58:inblock in executable' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/fourflusher-0.3.2/lib/fourflusher/simctl.rb:16:in simctl!' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/fourflusher-0.3.2/lib/fourflusher/simctl.rb:10:inlist' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/fourflusher-0.3.2/lib/fourflusher/find.rb:72:in usable_simulators' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/fourflusher-0.3.2/lib/fourflusher/find.rb:64:insimulator' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/fourflusher-0.3.2/lib/fourflusher/xcodebuild.rb:7:in destination' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/validator.rb:717:inxcodebuild' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/validator.rb:478:in block in build_pod' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/user_interface.rb:141:inmessage' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/validator.rb:477:in build_pod' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/validator.rb:274:inblock in perform_extensive_analysis' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/validator.rb:263:in each' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/validator.rb:263:inperform_extensive_analysis' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/validator.rb:81:in validate' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/command/repo/push.rb:125:inblock in validate_podspec_files' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/command/repo/push.rb:119:in each' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/command/repo/push.rb:119:invalidate_podspec_files' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/command/repo/push.rb:64:in run' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/claide-1.0.0/lib/claide/command.rb:334:inrun' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/lib/cocoapods/command.rb:50:in run' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/gems/cocoapods-1.0.1/bin/pod:55:in<top (required)>' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/bin/pod:23:in load' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/bin/pod:23:in

' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/bin/ruby_executable_hooks:15:in eval' /Users/jenkins/.rvm/gems/ruby-2.2.1@omnibus/bin/ruby_executable_hooks:15:in
' ) during validation.

The command is failing in fourflusher, but if you run DEVELOPER_DIR=/Applications/Xcode6.4.app xcrun simctl list devices you will get a list of devices back.

If I change it to DEVELOPER_DIR=/Applications/Xcode6.4.app/Contents/Developer we no longer get this failure, however the other format is valid and should be respected

neonichu commented 8 years ago

Interesting, I suspect that the way commands are executed by fourflusher, they'll only inherit exported environment variables.

Could you try:

export DEVELOPER_DIR=/Applications/Xcode6.4.app
build_script.sh

and see if that changes the result?

maschall commented 8 years ago

I had tried

DEVELOPER_DIR="/Applications/Xcode6.4.app" ruby -e "require 'fourflusher'; puts Fourflusher::SimControl.new.destination('iPhone 4s', '8.0')"

which works as expected, but I will try with the export and get back.

lemonkey commented 7 years ago

Thanks for this. It could the clue I needed for the issue with Jenkins that I'm seeing.

dnkoutso commented 5 years ago

Closing as too old issue.