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

Cocoapods pod update: Parsing unable to continue due to parsing error #12172

Closed
a75c6 opened this issue Aug 14, 2017 · 27 comments
Closed

Cocoapods pod update: Parsing unable to continue due to parsing error #12172

a75c6 opened this issue Aug 14, 2017 · 27 comments
Assignees

Comments

@a75c6
Copy link

a75c6 commented Aug 14, 2017

Should this be an issue in the gRPC issue tracker?

Yes

What version of gRPC and what language are you using?

1.4.2 with Objective-C / Swift

What operating system (Linux, Windows, …) and version?

OSX 10.12.6

What runtime / compiler are you using (e.g. python version or version of gcc)

ProtoCompiler 3.2.0

What did you do?

There is an issue with running pod update. So I noticed that all of my previously running workspaces result in the same error when running pod update:

[!] ERROR: Parsing unable to continue due to parsing error:
contained in the file located at /Users/.../Documents/grpc_test_081317/Podfile.lock
PODS:
  - !ProtoCompiler (3.2.0):
    - Protobuf (~> 3.0)
  - !ProtoCompiler-gRPCPlugin (1.4.2):
    - !ProtoCompiler (= 3.2.0)
    - gRPC-ProtoRPC (= 1.4.2)
  - BoringSSL (8.2):
    - BoringSSL/Implementation (= 8.2)
    - BoringSSL/Interface (= 8.2)
  - BoringSSL/Implementation (8.2):
    - BoringSSL/Interface (= 8.2)
  - BoringSSL/Interface (8.2)
  - Global (0.0.1):
    - !ProtoCompiler-gRPCPlugin (~> 1.0)
    - Global/Messages (= 0.0.1)
    - Global/Services (= 0.0.1)
  - Global/Messages (0.0.1):
    - !ProtoCompiler-gRPCPlugin (~> 1.0)
    - Protobuf
  - Global/Services (0.0.1):
    - !ProtoCompiler-gRPCPlugin (~> 1.0)
    - Global/Messages
    - gRPC-ProtoRPC
  - gRPC (1.4.2):
    - gRPC-Core (= 1.4.2)
    - gRPC-RxLibrary (= 1.4.2)
  - gRPC-Core (1.4.2):
    - gRPC-Core/Implementation (= 1.4.2)
    - gRPC-Core/Interface (= 1.4.2)
  - gRPC-Core/Implementation (1.4.2):
    - BoringSSL (~> 8.0)
    - gRPC-Core/Interface (= 1.4.2)
    - nanopb (~> 0.3)
  - gRPC-Core/Interface (1.4.2)
  - gRPC-ProtoRPC (1.4.2):
    - gRPC (= 1.4.2)
    - gRPC-RxLibrary (= 1.4.2)
    - Protobuf (~> 3.0)
  - gRPC-RxLibrary (1.4.2)
  - nanopb (0.3.8):
    - nanopb/decode (= 0.3.8)
    - nanopb/encode (= 0.3.8)
  - nanopb/decode (0.3.8)
  - nanopb/encode (0.3.8)
  - Protobuf (3.3.0)

DEPENDENCIES:
  - Global (from `.`)

EXTERNAL SOURCES:
  Global:
    :path: .

SPEC CHECKSUMS:
  !ProtoCompiler: b66c7c0c1d911ad1490dcbfce30e1508739d8309
  !ProtoCompiler-gRPCPlugin: 892d2bfa38a797c026ead6c8aba6df99081407c9
  BoringSSL: 4135ae556ee2b82ee85477c39ba917a3dd5424ba
  Global: 0469a39d48a9b3548f751f9dd3d56e9f3e386256
  gRPC: 74b57d3c8a9366e09493828e0a1d27f6d69a79fd
  gRPC-Core: 642d29e59e5490374622b0629c2dd1c4c111775c
  gRPC-ProtoRPC: 675ef3d484c06967ed2a5f5ee0e510a3756f755e
  gRPC-RxLibrary: 7a25c5c25282669a82d1783d7e8a036f53e8ef27
  nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
  Protobuf: d582fecf68201eac3d79ed61369ef45734394b9c

PODFILE CHECKSUM: 43d72c97fe8940bce10f202cf95faeee63ec5ce9

COCOAPODS: 1.3.1

I have even setup a brand new test project. The setup allows everything to install fine as follows:

Installing !ProtoCompiler (3.2.0)
Installing !ProtoCompiler-gRPCPlugin (1.4.2)
Installing BoringSSL (8.2)
Installing Global (0.0.1)
Installing Protobuf (3.3.0)
Installing gRPC (1.4.2)
Installing gRPC-Core (1.4.2)
Installing gRPC-ProtoRPC (1.4.2)
Installing gRPC-RxLibrary (1.4.2)
Installing nanopb (0.3.8)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `grpc_test_081317.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 10 total pods installed.

My podspec is Global.podspec and my proto file is global.proto.

But as soon as I run pod update, I get the same parsing error. I have tried deintegrating podfiles from all the previous project and completely rebuilding but still the same error occurs. When I run pod install after the initial install, I get the same error:

[!] ERROR: Parsing unable to continue due to parsing error:
contained in the file located at /Users/.../Documents/grpc_test_081317/Podfile.lock
PODS:
  - !ProtoCompiler (3.2.0):
    - Protobuf (~> 3.0)
  - !ProtoCompiler-gRPCPlugin (1.4.2):
    - !ProtoCompiler (= 3.2.0)
    - gRPC-ProtoRPC (= 1.4.2)
  - BoringSSL (8.2):
    - BoringSSL/Implementation (= 8.2)
    - BoringSSL/Interface (= 8.2)
  - BoringSSL/Implementation (8.2):
    - BoringSSL/Interface (= 8.2)
  - BoringSSL/Interface (8.2)
  - Global (0.0.1):
    - !ProtoCompiler-gRPCPlugin (~> 1.0)
    - Global/Messages (= 0.0.1)
    - Global/Services (= 0.0.1)
  - Global/Messages (0.0.1):
    - !ProtoCompiler-gRPCPlugin (~> 1.0)
    - Protobuf
  - Global/Services (0.0.1):
    - !ProtoCompiler-gRPCPlugin (~> 1.0)
    - Global/Messages
    - gRPC-ProtoRPC
  - gRPC (1.4.2):
    - gRPC-Core (= 1.4.2)
    - gRPC-RxLibrary (= 1.4.2)
  - gRPC-Core (1.4.2):
    - gRPC-Core/Implementation (= 1.4.2)
    - gRPC-Core/Interface (= 1.4.2)
  - gRPC-Core/Implementation (1.4.2):
    - BoringSSL (~> 8.0)
    - gRPC-Core/Interface (= 1.4.2)
    - nanopb (~> 0.3)
  - gRPC-Core/Interface (1.4.2)
  - gRPC-ProtoRPC (1.4.2):
    - gRPC (= 1.4.2)
    - gRPC-RxLibrary (= 1.4.2)
    - Protobuf (~> 3.0)
  - gRPC-RxLibrary (1.4.2)
  - nanopb (0.3.8):
    - nanopb/decode (= 0.3.8)
    - nanopb/encode (= 0.3.8)
  - nanopb/decode (0.3.8)
  - nanopb/encode (0.3.8)
  - Protobuf (3.3.0)

DEPENDENCIES:
  - Global (from `.`)

EXTERNAL SOURCES:
  Global:
    :path: .

SPEC CHECKSUMS:
  !ProtoCompiler: b66c7c0c1d911ad1490dcbfce30e1508739d8309
  !ProtoCompiler-gRPCPlugin: 892d2bfa38a797c026ead6c8aba6df99081407c9
  BoringSSL: 4135ae556ee2b82ee85477c39ba917a3dd5424ba
  Global: 0469a39d48a9b3548f751f9dd3d56e9f3e386256
  gRPC: 74b57d3c8a9366e09493828e0a1d27f6d69a79fd
  gRPC-Core: 642d29e59e5490374622b0629c2dd1c4c111775c
  gRPC-ProtoRPC: 675ef3d484c06967ed2a5f5ee0e510a3756f755e
  gRPC-RxLibrary: 7a25c5c25282669a82d1783d7e8a036f53e8ef27
  nanopb: 5601e6bca2dbf1ed831b519092ec110f66982ca3
  Protobuf: d582fecf68201eac3d79ed61369ef45734394b9c

PODFILE CHECKSUM: 43d72c97fe8940bce10f202cf95faeee63ec5ce9

COCOAPODS: 1.3.1

So this has locked me out of updating all projects using GRPC. I have also tried solutions like the following but the same error still returns:

sudo rm -fr ~/.cocoapods/repos/master
sudo gem uninstall cocoapods
sudo gem update
sudo gem instal cocoapods
pod setup

What did you expect to see?

A regular pod update as was the case before.

What did you see instead?

The errors outlined.

Anything else we should know about your project / environment?

Xcode 8.3.3
Cocoapods 1.3.1

@a75c6
Copy link
Author

a75c6 commented Aug 14, 2017

Using pod spec lint shows the following error:

- ERROR | [iOS] unknown: Encountered an unknown error (/bin/bash -c set -e mkdir -p ./Pods/Global
./Pods/!ProtoCompiler/protoc --plugin=protoc-gen-grpc=./Pods/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin 
--objc_out=./Pods/Global --grpc_out=./Pods/Global -I . -I ./Pods/!ProtoCompiler ./*.proto
/bin/bash: line 3: ./Pods/!ProtoCompiler/protoc: No such file or directory
)

@a75c6
Copy link
Author

a75c6 commented Aug 14, 2017

I have tried reinstalling protobuf from source so that I have a clean install and receive the following when I run protoc --version:

libprotoc 3.3.0

So after doing that and starting a clean project with the Podspec as found here, I still get the following error when running pod spec lint before running pod install:

set -e
mkdir -p ./Pods/Global
./Pods/!ProtoCompiler/protoc         --plugin=protoc-gen-grpc=./Pods/!ProtoCompiler-gRPCPlugin/grpc_objective_c_plugin         --objc_out=./Pods/Global         --grpc_out=./Pods/Global         -I .         -I ./Pods/!ProtoCompiler         ./*.proto

/bin/bash: line 3: ./Pods/!ProtoCompiler/protoc: No such file or directory
) during validation.

Analyzed 1 podspec.

So what I was testing there was whether there was an error when with the podspec even before I ran pod install. Regardless of the error, I am still able to run a clean pod install only to receive an error on pod update.

@sibinlutoken
Copy link

I have the same issue. It happen only if I include the !ProtoCompiler as a pod in the Podfile

@a75c6
Copy link
Author

a75c6 commented Aug 15, 2017

@sibinlutoken Interesting. Do you have a workaround that you are currently using?

@a75c6
Copy link
Author

a75c6 commented Aug 15, 2017

@jcanizales Any suggestions regarding this?

@sibinlutoken
Copy link

@namsoila there are three work around:
1: using cocoapods version 1.2.1
2: manually run a script to add "" around !protocompiler in Podfile.lock and manfest.lock.( Which is the cause of the parser error)
3. Point cocoapods-core to SHA.

Im using cocoapods 1.2.1 to work around.

@a75c6
Copy link
Author

a75c6 commented Aug 17, 2017

@sibinlutoken Thanks for sharing!

@a75c6
Copy link
Author

a75c6 commented Aug 17, 2017

@sibinlutoken Thanks! Using 1.2.1 and it is updating.

sudo gem install cocoapods-deintegrate cocoapods-clean
pod deintegrate
pod clean
rm Podfile
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.2.1

Then was able to do install and update.

@derpoliuk
Copy link

@dgquintas, @ctiller

It is still an issue to install with CocoaPods v1.4.0. Is there any way to update .podspec files without !? I guess it's the cause of the problem with CocoaPods.

@muxi
Copy link
Member

muxi commented Jan 22, 2018

Cocoapods did not put the patch in 1.4.0; they are targeting at 1.5. We are unable to remove the ! because those pods are supposed to be installed before others. They are aware of the issue and is working on it.

@derpoliuk
Copy link

@muxi thank you for update! I did find a bunch of issues in https://github.com/CocoaPods/CocoaPods/ connected to issue with ! after posting my comment.

@ghost
Copy link

ghost commented Jan 23, 2018

May I know if this issue with ! fixed or not ?

@muxi
Copy link
Member

muxi commented Jan 23, 2018

@Sidhdarth no so far. Tracking issue is CocoaPods/CocoaPods#7302

@samskiter
Copy link

Ok for my own sanity, the workaround involves editing TWO files. Podfile.lock AND Pods/Manifest.lock

The edits should look like this in both:

PODS:
  - "!ProtoCompiler (3.4.0)":
    - Protobuf (~> 3.0)
  - "!ProtoCompiler-gRPCPlugin (1.6.5)":
    - "!ProtoCompiler (= 3.4.0)"
    - gRPC-ProtoRPC (= 1.6.5)

DEPENDENCIES:
  - "!ProtoCompiler-gRPCPlugin (= 1.6.5)"
  [...]
SPEC CHECKSUMS:
  "!ProtoCompiler": 07d0c441bc00e7f01e84debf7c53794683fbca7c
  "!ProtoCompiler-gRPCPlugin": dfc8eead3e132b22750b0ec7f5fe4774ef98362a
  [...]

This is a dupe or in some way related to CocoaPods/CocoaPods#6980 CocoaPods/CocoaPods#6925 and CocoaPods/CocoaPods#6955 (so I can find my way back to this issue)

@phlippieb
Copy link

@muxi

We are unable to remove the ! because those pods are supposed to be installed before others.

I know it's ugly, but would it work if the pods were renamed to something like AAA-ProtoCompiler?

@njovy
Copy link

njovy commented Mar 6, 2018

@samskiter Could you highlight which part did you edit to avoid this error? I'm using 1.10.0. Thank you in advance.

@phlippieb
Copy link

@njovy I believe @samskiter added quotes ("...") around the parts that start with exclamation marks.

@muxi
Copy link
Member

muxi commented Mar 6, 2018

I know it's ugly, but would it work if the pods were renamed to something like AAA-ProtoCompiler?

@phlippieb Yes that would work but we would really prefer not to do it because it breaks the versioning of those pods. We still prefer to wait for the patch from Cocoapods.

@samskiter
Copy link

@phlippieb is right. You need to add quotes around the relevant parts in both files. after the pod install runs, the lock file will be reverted so this isn't a permanent fix :(

@muxi
Copy link
Member

muxi commented Mar 7, 2018

An easier way is to remove Pods/ and Podfile.lock before pod install

@phlippieb
Copy link

phlippieb commented Mar 8, 2018

An easier way is to remove Pods/ and Podfile.lock before pod install

@muxi Wouldn't that cause every pod install to act like a pod update though?

@phlippieb
Copy link

You can try to add the quotes to the files using sed. I hacked together the following command which seems to do the right things for my lockfile, but I don't actually use this, so use at your own risk.

gsed '/\!/ s/\(\!\)\(.*\)\(:\|$\)\(.*\)/"\1\2"\3\4/'

It doesn't work with the builtin MacOS sed; you have to install and use GNU sed. Hence gsed.

Or you could just revert to CocoaPods 1.2.1 or earlier:

sudo gem install cocoapods -v 1.2.1

But note that those early versions have their own issues, for example if you use the Permissions pod, well, good luck to ya.

@njovy
Copy link

njovy commented Mar 8, 2018

@phlippieb Thank you for the gsed command! Now I can pod update.

  gsed -i.bak '/\!/ s/\(\!\)\(.*\)\(:\|$\)\(.*\)/"\1\2"\3\4/' Podfile.lock Pods/Manifest.lock 

@samskiter
Copy link

samskiter commented Apr 12, 2018

The tracking bug was closed with this fix which went into 1.5.0. I've just installed and tested this out on our project and it seemed to work! We can now run 'pod install' 2 times in a row! :)

@phlippieb
Copy link

Confirmed, it's fixed 👍

@Mingriweiji-github
Copy link

I can fix by this :

  1. rm -rf Pods
  2. rm Podfile.lock
  3. pod install

@phlippieb
Copy link

@Mingriweiji-github Yes, that's what was suggested a few posts up, but that would cause every pod install to act as a pod update, so you're gonna have to make sure the updated pods don't break anything every time you do this (unless your Podfile strictly specifies the version of each pod to use, in which case you will have to maintain that more carefully). Anyway, as pointed out above, this is fixed in cocoapods 1.5; can't you just use that?

@lock lock bot locked as resolved and limited conversation to collaborators Sep 28, 2018
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