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

Failed to install Firestore Cocoapod dependency #5623

Closed
g30r93g opened this issue May 16, 2020 · 10 comments
Closed

Failed to install Firestore Cocoapod dependency #5623

g30r93g opened this issue May 16, 2020 · 10 comments

Comments

@g30r93g
Copy link

g30r93g commented May 16, 2020

Step 1: Describe your environment

  • Xcode version: 11.5 b2 (11N605f)
  • Firebase SDK version: 6.24.0
  • Firebase Component: Firestore
  • Component version: 1.13.0
  • Installation method: CocoaPods

Step 2: Describe the problem

Steps to reproduce:

What happened? How can we make the problem occur?
Tried installing Firestore via cocoapods but failed when installing gRPC-C++ (1.28.0)

Relevant Code:

 % pod install
Analyzing dependencies
Downloading dependencies
Installing BoringSSL-GRPC (0.0.7)
Installing Firebase 6.24.0
Using FirebaseAnalytics (6.5.0)
Using FirebaseAuth (6.5.3)
Using FirebaseAuthInterop (1.1.0)
Using FirebaseCore (6.7.0)
Using FirebaseCoreDiagnostics (1.3.0)
Using FirebaseCoreDiagnosticsInterop (1.2.0)
Installing FirebaseFirestore (1.13.0)
Using FirebaseInstallations (1.2.0)
Using GTMSessionFetcher (1.4.0)
Using GoogleAppMeasurement (6.5.0)
Using GoogleDataTransport (6.1.0)
Using GoogleDataTransportCCTSupport (3.1.0)
Using GoogleUtilities (6.6.0)
Using PromisesObjC (1.2.8)
Installing abseil (0.20200225.0)
Installing gRPC-C++ (1.28.0)
[!] /usr/local/bin/bash -c 
set -e
sed -E -i '' 's;#include <openssl/(.*)>;#if COCOAPODS==1\
  #include <openssl_grpc/\1>\
#else\
  #include <openssl/\1>\
#endif;g' $(find src/core -type f \( -path '*.h' -or -path '*.cc' \) -print | xargs grep -H -c '#include <openssl_grpc/' | grep 0$ | cut -d':' -f1)
    find src/core/ third_party/upb/ -type f \( -name '*.h' -or -name '*.c' -or -name '*.cc' \) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "upb/(.*)";#if COCOAPODS==1\
  #include  "third_party/upb/upb/\1"\
#else\
  #include  "upb/\1"\
#endif;g'
    find src/core/ third_party/upb/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
    find src/core/ src/cpp/ -type f \( -name '*.h' -or -name '*.c' -or -name '*.cc' \) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(.*).upb.h";#if COCOAPODS==1\
  #include  "src/core/ext/upb-generated/\1.upb.h"\
#else\
  #include  "\1.upb.h"\
#endif;g'
    find src/core/ src/cpp/ -type f -name '*.grpc_back' -print0 | xargs -0 rm

sed: can't read s;#include <openssl/(.*)>;#if COCOAPODS==1\
  #include <openssl_grpc/\1>\
#else\
  #include <openssl/\1>\
#endif;g: No such file or directory

@g30r93g
Copy link
Author

g30r93g commented May 16, 2020

Note that updating cocoapods, reinstalling openssl and exporting to PATH produces same error

@g30r93g
Copy link
Author

g30r93g commented May 16, 2020

Here is the verbose output:

-> Installing gRPC-C++ (1.28.0)
 > Git download
 > Git download
     $ /usr/local/bin/git clone https://github.com/grpc/grpc.git
     /var/folders/l5/vrgd77q96p9fhc7npl8ntsv40000gp/T/d20200516-91865-xn0c4l --template= --single-branch
     --depth 1 --branch v1.28.0
     Cloning into '/var/folders/l5/vrgd77q96p9fhc7npl8ntsv40000gp/T/d20200516-91865-xn0c4l'...
     Note: checking out 'c5789be22cada39b80d70d4ace3738d62f1c0a04'.
     
     You are in 'detached HEAD' state. You can look around, make experimental
     changes and commit them, and you can discard any commits you make in this
     state without impacting any branches by performing another checkout.
     
     If you want to create a new branch to retain commits you create, you may
     do so (now or later) by using -b with the checkout command again. Example:
     
       git checkout -b <new-branch-name>
     
 > Running prepare command
   $ /usr/local/bin/bash -c  set -e sed -E -i '' 's;#include <openssl/(.*)>;#if COCOAPODS==1\   #include
   <openssl_grpc/\1>\ #else\   #include <openssl/\1>\ #endif;g' $(find src/core -type f \( -path '*.h'
   -or -path '*.cc' \) -print | xargs grep -H -c '#include <openssl_grpc/' | grep 0$ | cut -d':' -f1)   
   find src/core/ third_party/upb/ -type f \( -name '*.h' -or -name '*.c' -or -name '*.cc' \) -print0 |
   xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "upb/(.*)";#if COCOAPODS==1\   #include 
   "third_party/upb/upb/\1"\ #else\   #include  "upb/\1"\ #endif;g'     find src/core/ third_party/upb/
   -type f -name '*.grpc_back' -print0 | xargs -0 rm     find src/core/ src/cpp/ -type f \( -name '*.h'
   -or -name '*.c' -or -name '*.cc' \) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include
   "(.*).upb.h";#if COCOAPODS==1\   #include  "src/core/ext/upb-generated/\1.upb.h"\ #else\   #include 
   "\1.upb.h"\ #endif;g'     find src/core/ src/cpp/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
   sed: can't read s;#include <openssl/(.*)>;#if COCOAPODS==1\
     #include <openssl_grpc/\1>\
   #else\
     #include <openssl/\1>\
   #endif;g: No such file or directory
[!] /usr/local/bin/bash -c 
set -e
sed -E -i '' 's;#include <openssl/(.*)>;#if COCOAPODS==1\
  #include <openssl_grpc/\1>\
#else\
  #include <openssl/\1>\
#endif;g' $(find src/core -type f \( -path '*.h' -or -path '*.cc' \) -print | xargs grep -H -c '#include <openssl_grpc/' | grep 0$ | cut -d':' -f1)
    find src/core/ third_party/upb/ -type f \( -name '*.h' -or -name '*.c' -or -name '*.cc' \) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "upb/(.*)";#if COCOAPODS==1\
  #include  "third_party/upb/upb/\1"\
#else\
  #include  "upb/\1"\
#endif;g'
    find src/core/ third_party/upb/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
    find src/core/ src/cpp/ -type f \( -name '*.h' -or -name '*.c' -or -name '*.cc' \) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(.*).upb.h";#if COCOAPODS==1\
  #include  "src/core/ext/upb-generated/\1.upb.h"\
#else\
  #include  "\1.upb.h"\
#endif;g'
    find src/core/ src/cpp/ -type f -name '*.grpc_back' -print0 | xargs -0 rm

sed: can't read s;#include <openssl/(.*)>;#if COCOAPODS==1\
  #include <openssl_grpc/\1>\
#else\
  #include <openssl/\1>\
#endif;g: No such file or directory


/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/executable.rb:73:in `execute_command'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/executable.rb:27:in `block in executable'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/pod_source_preparer.rb:66:in `block (2 levels) in run_prepare_command'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/pod_source_preparer.rb:60:in `chdir'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/pod_source_preparer.rb:60:in `block in run_prepare_command'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/pod_source_preparer.rb:59:in `run_prepare_command'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/pod_source_preparer.rb:37:in `prepare!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/downloader/cache.rb:202:in `copy_and_clean'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/downloader/cache.rb:159:in `block (2 levels) in uncached_pod'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/downloader/cache.rb:157:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/downloader/cache.rb:157:in `block in uncached_pod'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/downloader/cache.rb:181:in `in_tmpdir'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/downloader/cache.rb:153:in `uncached_pod'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/downloader/cache.rb:33:in `download_pod'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/downloader.rb:42:in `download'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/pod_source_installer.rb:117:in `download_source'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer/pod_source_installer.rb:69:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:557:in `install_source_of_pod'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:508:in `block (2 levels) in install_pod_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:86:in `titled_section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:507:in `block in install_pod_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:490:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:490:in `install_pod_sources'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:249:in `block in download_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:248:in `download_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/installer.rb:157:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.1/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

@paulb777
Copy link
Member

@g30r93g Thanks for the report. I suspect there's something strange about your environment. What version of CocoaPods is being used? Anything non-standard about the command line tools like sed and find? Here's what I see:

-> Installing gRPC-C++ 1.28.0 (was 0.0.9 and source changed to `https://cdn.cocoapods.org/` from `trunk`)
 > Git download
 > Git download
     $ /usr/local/git/current/bin/git clone https://github.com/grpc/grpc.git /var/folders/mk/9ccbvq8x00q20q0f7mfxbtrw00bzqz/T/d20200516-21594-rq0tbb --template= --single-branch
     --depth 1 --branch v1.28.0
     Cloning into '/var/folders/mk/9ccbvq8x00q20q0f7mfxbtrw00bzqz/T/d20200516-21594-rq0tbb'...
     Note: switching to 'c5789be22cada39b80d70d4ace3738d62f1c0a04'.

     You are in 'detached HEAD' state. You can look around, make experimental
     changes and commit them, and you can discard any commits you make in this
     state without impacting any branches by switching back to a branch.

     If you want to create a new branch to retain commits you create, you may
     do so (now or later) by using -c with the switch command. Example:

       git switch -c <new-branch-name>

     Or undo this operation with:

       git switch -

     Turn off this advice by setting config variable advice.detachedHead to false

     Updating files: 100% (8203/8203), done.
 > Running prepare command
   $ /bin/bash -c  set -e sed -E -i '' 's;#include <openssl/(.*)>;#if COCOAPODS==1\   #include <openssl_grpc/\1>\ #else\   #include <openssl/\1>\ #endif;g' $(find src/core -type f
   \( -path '*.h' -or -path '*.cc' \) -print | xargs grep -H -c '#include <openssl_grpc/' | grep 0$ | cut -d':' -f1)     find src/core/ third_party/upb/ -type f \( -name '*.h' -or
   -name '*.c' -or -name '*.cc' \) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "upb/(.*)";#if COCOAPODS==1\   #include  "third_party/upb/upb/\1"\ #else\   #include
   "upb/\1"\ #endif;g'     find src/core/ third_party/upb/ -type f -name '*.grpc_back' -print0 | xargs -0 rm     find src/core/ src/cpp/ -type f \( -name '*.h' -or -name '*.c' -or
   -name '*.cc' \) -print0 | xargs -0 -L1 sed -E -i'.grpc_back' 's;#include "(.*).upb.h";#if COCOAPODS==1\   #include  "src/core/ext/upb-generated/\1.upb.h"\ #else\   #include
   "\1.upb.h"\ #endif;g'     find src/core/ src/cpp/ -type f -name '*.grpc_back' -print0 | xargs -0 rm
  > Copying gRPC-C++ from `/Users/paulbeusterien/Library/Caches/CocoaPods/Pods/Release/gRPC-C++/1.28.0-2ea13` to `Pods/gRPC-C++`

@g30r93g
Copy link
Author

g30r93g commented May 16, 2020

Hi Paul. I'm on Cocoapods version 1.9.1 and there's nothing non-standard as far as I can see. It not only fails with gRPC-C++ but also gRPC-Core. Tried on my dad's mac and seems that its localised to my mac. Will have a good rummage through and see how to fix it.

@paulb777
Copy link
Member

@g30r93g Thanks for confirming the issue is specific to your mac. Since there's unlikely anything we can do to help, I'll close.

However, if you find an issue on the Firebase side, have additional questions, or would like to share the resolution, feel free to comment here or open another issue.

@a--hoang
Copy link

@g30r93g @paulb777 I was able to reproduce this issue on my mac (recently updated to catalina 10.15.4). perhaps your dad's isn't updated yet?

not sure what is wrong :) hopefully this provides a clue

@a--hoang
Copy link

a--hoang commented May 24, 2020

so i tracked this down to https://github.com/grpc/grpc/blob/master/gRPC-C%2B%2B.podspec#L1123, where that command fails because:

(from checkout of grpc)

find src/core -type f \\( -path '*.h' -or -path '*.cc' \\) -print

-bash: syntax error near unexpected token `('

turns out bash doesn't like double backslash. changing this to

find src/core -type f \( -path '*.h' -or -path '*.cc' \) -print

appropriately lists the files in that directory.

I will create a PR in https://github.com/grpc/grpc to fix this. I may open a corresponding issue here to track. Be back after some sleep...

@bht822
Copy link

bht822 commented May 27, 2020

I have the same issue.
Any luck creating the PR @a--hoang ?

@iqbalmineraltown
Copy link

Hi @g30r93g just dropping my 2 cents here
I happened to find the same problem.

My environment:

  • OSX 10.15.5
  • Cocoapods 1.9.3
  • ruby 2.6.0
  • XCode 11.5 (11E608c)
  • not sure about Firebase pod version, as I am developing using Flutter with Firebase plugins and haven't updated it for around 1 year. Now I tried to update everything and stumbled upon this

In my case, I am using gnu-sed and replace OSX sed with it 2 years ago. I restored the default sed and now gRPC-C++ and gRPC-Core are installed.

But I haven't encountered this problem with the previous version 😞

@meshalalhazmi
Copy link

I had the same issue with my mac, in my case, I had two sed installations.

/usr/local/opt/gnu-sed/libexec/gnubin/sed
/usr/bin/sed

I just reconfigured my zsh shell to point to /usr/bin/sed and it worked..

@firebase firebase locked and limited conversation to collaborators Jun 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants