grab / grab/cocoapods-binary-cache

Integration Attempts to Use Dependent Frameworks from Wrong Path

Open
#41 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
488
Forks
69
PR merge metrics
No merged PRs in 30d

Description

Not entirely sure whether this is a *cocoapods-binary-cache* issue or *CocoaPods* issue. I did not see this before so I'll assume it's related to *cocoapods-binary-cache*.

I have some app modules packaged as Pods hosted on private Git repo, the `Podfile` is defined as follows:

```ruby
# Enable prebuilt binary pods.
plugin "cocoapods-binary-cache"
config_cocoapods_binary_cache(
cache_repo: {
"default" => {
"remote" => "git@github.com:some/repo.git",
"local" => "~/Library/Caches/CocoaPods/Binary",
},
},
prebuild_config: "Debug",
prebuild_sandbox_path: "Pods/_Prebuild",
device_build_enabled: true,

# Pull source for binary pods.
still_download_sources: false,
)

platform :ios, "11.0"
inhibit_all_warnings!
use_frameworks!

...

pod "ModuleOne", :git => "git@github.com:some/repo.git", :tag => "1.0", :binary => true
```

*ModuleOne* here is a mega Pod that depends on some other framework, say *ModuleZero* and so on. It has an oversimplified folder structure like this:

```
.
├── ModuleOne
│   └─── ModuleZero
│   ├── ModuleZero.bundle
│    └── ModuleZero.framework
├── License
├── ModuleOne.podspec
└── ReadMe.md
```

Running `pod binary prebuild --push` or `bundle exec pod binary prebuild --push` generated/prebuilt *ModuleOne* and dependencies as expected in the specified sandbox directory, but the final integration failed due to **"Errno::ENOENT - No such file or directory @ realpath_rec - ..."**. No Pod-related workspace was generated after the command failed.

I dug around and it seemed the issue was *cocoapods-binary-cache* or *CocoaPods* looking into the wrong path when searching for dependent frameworks. When *ModuleOne* depended on *ModuleZero*, *ModuleOne* was prebuilt into `$SANDBOX_PATH/GeneratedFrameworks/ModuleOne/ModuleOne.framework`, where CocoaPods got it right; *ModuleZero* was left in `$SANDBOX_PATH/GeneratedFrameworks/ModuleOne/ModuleOne/ModuleZero/ModuleZero.framework` but somehow *CocoaPods* wanted to find it in `$SANBOX_PATH/GeneratedFrameworks/ModuleOne/ModuleZero.framework`. Even if I manually moved *.framework* directory, *.bundle* also faced the same issue.

Verbose `pod binary prebuild` points the stack to `.gem/gems/cocoapods-1.10.0/lib/cocoapods/project.rb:326` but I've never ran into this issue on stock CocoaPods installation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.