CocoaPods / Rome

Makes it easy to build a list of frameworks.
MIT License
696 stars 64 forks source link

Rome crashes with cocoapods 1.5.2 #67

Open jugutier opened 6 years ago

jugutier commented 6 years ago

Report

platform :ios, '8.0'

plugin 'cocoapods-rome'

target 'caesar' do
  pod 'Alamofire'
end

To get an output folder with the compiled Alamofire framework

Got an error.

Command

/Users/julian/.rbenv/versions/2.0.0/bin/pod install

Stack

   CocoaPods : 1.5.2
        Ruby : ruby 2.0.0p647 (2015-08-18 revision 51631) [x86_64-darwin16.6.0]
    RubyGems : 2.0.14.1
        Host : Mac OS X 10.12.6 (16G1212)
       Xcode : 9.2 (9C40b)
         Git : git version 2.14.3 (Apple Git-98)
Ruby lib dir : /Users/julian/.rbenv/versions/2.0.0-p647/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 422a260e27e8636972adf4eeace58f53f26a031f

Plugins

cocoapods-deintegrate : 1.0.2
cocoapods-plugins     : 1.0.0
cocoapods-rome        : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.3.0
cocoapods-try         : 1.1.0

Podfile

platform :ios, '8.0'

plugin 'cocoapods-rome'

target 'caesar' do
  pod 'Alamofire'
end

Error

NoMethodError - undefined method `build_settings' for nil:NilClass
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-rome-1.0.0/lib/cocoapods-rome/post_install.rb:44:in `block in enable_debug_information'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-rome-1.0.0/lib/cocoapods-rome/post_install.rb:42:in `each'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-rome-1.0.0/lib/cocoapods-rome/post_install.rb:42:in `enable_debug_information'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-rome-1.0.0/lib/cocoapods-rome/post_install.rb:73:in `block in <top (required)>'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/hooks_manager.rb:109:in `call'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/hooks_manager.rb:109:in `block (3 levels) in run'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/user_interface.rb:142:in `message'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/hooks_manager.rb:103:in `block (2 levels) in run'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/hooks_manager.rb:101:in `each'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/hooks_manager.rb:101:in `block in run'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/user_interface.rb:142:in `message'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/hooks_manager.rb:100:in `run'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:455:in `run_plugins_post_install_hooks'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:433:in `perform_post_install_actions'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/installer.rb:125:in `install!'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/command/install.rb:41:in `run'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/lib/cocoapods/command.rb:52:in `run'
/Users/julian/.rbenv/versions/2.0.0-p647/lib/ruby/gems/2.0.0/gems/cocoapods-1.5.2/bin/pod:55:in `<top (required)>'
/Users/julian/.rbenv/versions/2.0.0/bin/pod:23:in `load'
/Users/julian/.rbenv/versions/2.0.0/bin/pod:23:in `<main>'
UnsafePointer commented 6 years ago

Could be related to https://github.com/CocoaPods/Rome/pull/63, you can try disabling dsym generation or using the plugin from master with the fix.

jugutier commented 6 years ago

Hi @Ruenzuo Thanks for looking into this.

I had noticed that issue and got something working using a sample app.

Overall I guess the big question was if I could run rome with just a podfile even without an app that holds a real target by the name caesar (in this case) The code that used to have an error before #63 seemed to expect a real target which made me think this was not possible.

After a second attempt today I was able to build the framework with just a podfile that looks like this:

platform :ios, '8.0'

plugin 'cocoapods-rome', { :pre_compile => Proc.new { |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '4.0'
        end
    end

    installer.pods_project.save
},

    dsym: false,
    configuration: 'Release'
}

target 'caesar' do
  pod 'Alamofire'
end

Is this something that would be worth adding to the samples in the readme?

Would dsym work once the new release is out?

Could we have something that says in the readme that a real xcodeproject or target isn't a requirement to get the frameworks to build?

Thanks!

UnsafePointer commented 6 years ago

@jugutier I tried to make this possible in https://github.com/CocoaPods/CocoaPods/pull/7588 but as you can see in the reply the problem is related to CocoaPods disabling integration. Your approach makes a lot of sense, dSYM should work in that case (you can try it now by using master in your Gemfile).

Feel free to send a PR adding this information to the README, I think it would be useful for some. The first time I tried Rome I also tried it without an Xcode project.

jugutier commented 6 years ago

agreed @Ruenzuo, readme enhancements now added in #69

jugutier commented 6 years ago

also it seems like this issue would be resolved with the latest in master, but I will close this issue when a new version of rome is released.