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

"pod install" for binary frameworks works correctly only with ruby 2.6.8 #11211

Closed
1 task done
mkondakov83 opened this issue Feb 18, 2022 · 9 comments
Closed
1 task done
Milestone

Comments

@mkondakov83
Copy link

mkondakov83 commented Feb 18, 2022

Report

"pod install" for binary frameworks works properly only with ruby 2.6.8
Any higher or lower version of ruby causes issues: some frameworks are not presented in application bundle; application crashes in runtime with error: Library not loaded: @rpath/TestFramework.framework/TestFramework

Please check attached test project.

Issue description:
We deliver some of our frameworks to our clients as fat binaries. This frameworks are built by script with all dependencies.
Finally we deliver all our frameworks as binaries and all dependencies as binaries.

Client installs our frameworks and all dependencies as binaries from git repo.

This approach was working good until Xcode 13.x
If we build our frameworks with Xcode 13.x we have unexpected issue during "pod install" phase on client's side

All dependency frameworks, installed to original "TestProject" with Podfile (in our case it's Reachability.framework) are installed correctly
But all our own frameworks added to original project "TestProject" (in our case it's TestProject.framework) are not added to app bundle during "pod install"

We have spent a lot of time to discover the reason why it happens and accidentally we have found that "pod install" works fine if active ruby version is set to 2.6.8

What did you do?

Steps to reproduce:

  1. unzip test project
  2. cd TestApp
  3. pod install
  4. sh ./build.sh
  5. cd ../ClientTestApp

At this moment check ruby version with "ruby -v" command. If ruby version is other than 2.6.8 (tested with 2.6.3, 2.7.4, 3.1.0) next command will generate incorrect ClientTestApp/Pods/Target Support Files/Pods-ClientTestApp/Pods-ClientTestApp-frameworks.sh script with missed TestFramework

  1. pod install
    7 open ClientTestApp.xcworkspace and run project

What did you expect to happen?

Project ClientTestApps runs without issues

What happened instead?

Project ClientTestApps crashes at runtime with error Library not loaded: @rpath/TestFramework.framework/TestFramework

CocoaPods Environment

Stack

   CocoaPods : 1.11.2
        Ruby : ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-darwin21]
    RubyGems : 3.2.32
        Host : macOS 12.0.1 (21A559)
       Xcode : 13.0 (13A233)
         Git : git version 2.30.1 (Apple Git-130)
Ruby lib dir : /Users/maksym.kondakov/.rubies/ruby-2.7.4/lib
Repositories : cocoapods - git - https://github.com/CocoaPods/Specs.git @ 5c4c892a88cfed7a7c0a7ef8d2e101d7d4e53bdb

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

Installation Source

Executable Path: /Users/maksym.kondakov/.gem/ruby/2.7.4/bin/pod

Plugins

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

Podfile

install! 'cocoapods', :disable_input_output_paths => true

post_install do |installer|
	installer.pods_project.build_configurations.each do |config|
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
    end
end

target 'ClientTestApp' do
  use_frameworks!
  pod 'TestFramework', :path => "../TestApp/build/universal"
end

Project that demonstrates the issue

RubyIssue.zip

@sethfri
Copy link
Contributor

sethfri commented Feb 18, 2022

The error you've included, Library not loaded: @rpath/TestFramework.framework/TestFramework, actually seems reminiscent of this bug fix, not a Ruby version issue. Have you tried pointing your CocoaPods version to the master branch and seeing if that resolves your issue? I don't think this has been in an official CocoaPods release yet

@mkondakov83
Copy link
Author

The error you've included, Library not loaded: @rpath/TestFramework.framework/TestFramework, actually seems reminiscent of this bug fix, not a Ruby version issue. Have you tried pointing your CocoaPods version to the master branch and seeing if that resolves your issue? I don't think this has been in an official CocoaPods release yet

Thanks a lot @sethfri, I have built CocoaPods from master branch and my issue is gone.

Now I can't reproduce this issue even with older version of cocoapods, I tried to reinstall cocoapods, switch ruby versions, clean caches. Maybe you can help me? I want to understand what happens and why it works now even with older configuration.

@sethfri
Copy link
Contributor

sethfri commented Feb 22, 2022

I'm not sure exactly what caches you're clearing when you say clean caches, but a possibility is that unless you're fully deleting the Pods directory or running a clean install, CocoaPods may be doing some caching that prevents the target support file in question from being regenerated.

You could try running pod install --clean-install on an older version of CocoaPods to see if that's able to reintroduce your issue.

@dnkoutso dnkoutso added this to the 1.11.3 milestone Feb 24, 2022
@dnkoutso
Copy link
Contributor

This is fixed with #11217. The original fix was merged to master (1.12) but now we are cherry-picking it down to for 1.11.3.

@dnkoutso
Copy link
Contributor

The 1.12 original PR can be found here #11158

@mkondakov83
Copy link
Author

@dnkoutso thanks a lot! Maybe you know when 1.11.3 is planned to be released?

@dnkoutso
Copy link
Contributor

@mkondakov83 I can do it in the next few days .

@mkondakov83
Copy link
Author

Hi @dnkoutso, do you still plan to release 1.11.3 ?

@dnkoutso
Copy link
Contributor

Heh, tried to do it last night but had some build issues, will resume today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants