bazel-ios / cocoapods-bazel

A Cocoapods plugin for automatically generating Bazel BUILD files
Apache License 2.0
110 stars 21 forks source link

failed to install CocoaAsyncSocket #92

Closed joprice closed 10 months ago

joprice commented 10 months ago

I'm trying to build react native with this project, and it fails with an error regarding a missing release configuration:

Error

ArgumentError - No build settings for CocoaAsyncSocket (7.6.5) (configuration :release) (known configurations [:debug])
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-1.14.2/lib/cocoapods/target/pod_target.rb:1049:in `build_settings_for_spec'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel/target.rb:158:in `pod_target_xcconfig'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel/target.rb:172:in `resolved_value_by_build_setting'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel/target.rb:106:in `product_module_name'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel/target.rb:285:in `block in to_rule_kwargs'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel/target.rb:16:in `initialize'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel/target.rb:282:in `new'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel/target.rb:282:in `to_rule_kwargs'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel.rb:64:in `block (3 levels) in post_install'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel.rb:61:in `each'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel.rb:61:in `block (2 levels) in post_install'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel.rb:27:in `each'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel.rb:27:in `block in post_install'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-1.14.2/lib/cocoapods/user_interface.rb:86:in `titled_section'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods/bazel.rb:19:in `post_install'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-bazel-0.1.5/lib/cocoapods_plugin.rb:20:in `block in <class:Installer>'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-1.14.2/lib/cocoapods/installer.rb:173:in `install!'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-1.14.2/lib/cocoapods/command/install.rb:52:in `run'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-1.14.2/lib/cocoapods/command.rb:52:in `run'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/gems/cocoapods-1.14.2/bin/pod:55:in `<top (required)>'
/Users/josephprice/dev/prompter/bundle/ruby/3.1.0/bin/pod:25:in `load'

Stack

   CocoaPods : 1.14.2
        Ruby : ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-darwin22]
    RubyGems : 3.4.20
        Host : macOS 13.5 (22G74)
       Xcode : 15.0.1 (15A507)
         Git : git version 2.40.1
Ruby lib dir : /nix/store/y78vyxrlj2038p1fcs18inflz4w5gmh0-ruby-3.1.4/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Plugins

cocoapods-bazel       : 0.1.5
cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0
thiagohmcruz commented 10 months ago

Hm, not sure if I'm aware of a use case where the release config is not present so that's weird. @joprice it would be great if you could share a small repro of the issue.

joprice commented 10 months ago

I found the issue. I'm using rules_xcodeproj and I did not provide the xcode_configurations key, so it defaulted to only having Debug: https://github.com/MobileNativeFoundation/rules_xcodeproj/blob/7cbbda71e76f2e05eedf3a911cb3c2926d707258/xcodeproj/internal/xcodeproj_macro.bzl#L47

thiagohmcruz commented 10 months ago

Oh I see, @joprice yeah you have to transition flags you need for each config in xcode_configurations indeed. Closing this for now then! Feel free to reopen if you hit anything else!