Dealing with updated pod in BuddyBuild

Issue #149

We’re using BuddyBuild as our CI. Today one of our dependencies gets a sweat update https://github.com/hyperoslo/BarcodeScanner/releases/tag/4.1.1. So we pod update BarcodeScanner in one of our projects that depends on it. All is fine when running locally. So I make a Pull Request and wait for the build to kick off in BuddyBuild.

For some reason, BuddyBuild can’t pick up the right version of Cocoapods, hence can’t update the new pods.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
[!] The version of CocoaPods used to generate the lockfile (1.3.1) is higher than the version of the current executable (1.1.1). Incompatibility issues may arise.

=== CocoaPods ===
104
Switching CocoaPods version to 1.1.1
105
Using Command Line: gem cleanup "cocoapods"
106
Using Command Line: gem uninstall "cocoapods" --all --executables --force
107
Using Command Line: gem install "cocoapods" --no-rdoc --no-ri --version "1.1.1"
108
Unpacking caches - cocoapods pod specs
109
Using Command Line: pod install --no-repo-update
110
Analyzing dependencies
111
Pre-downloading: `Tailor` from `https://github.com/zenangst/Tailor`, tag `3.0.0`
112
[!] Unable to satisfy the following requirements:
113
- `BarcodeScanner (~> 4.0)` required by `Podfile`
114
- `BarcodeScanner (~> 4.0)` required by `Podfile`
115
- `BarcodeScanner (~> 4.0)` required by `Podfile`
116
- `BarcodeScanner (~> 4.0)` required by `Podfile`
117
- `BarcodeScanner (~> 4.0)` required by `Podfile`
118
- `BarcodeScanner (~> 4.0)` required by `Podfile`
119
- `BarcodeScanner (= 4.1.1)` required by `Podfile.lock`
120
None of your spec sources contain a spec satisfying the dependencies: `BarcodeScanner (~> 4.0), BarcodeScanner (= 4.1.1)`.
121
You have either:
122
* out-of-date source repos which you can update with `pod repo update`.
123
* mistyped the name or version.
124
* not added the source repo that hosts the Podspec to your Podfile.
125
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

Trying script

So I thought I could run some custom script to force BuddyBuild to update the pods. Start with https://docs.buddybuild.com/builds/custom_build_steps.html

I commit the file buddybuild_postclone.sh with

1
2
3
4
#!/usr/bin/env bash

pod repo update
pod update BarcodeScanner

Didn’t work. I then update the script with

1
2
3
4
5
#!/usr/bin/env bash

pod repo remove master
pod setup
pod install

Didn’t work. Taking a closer look at the log. I see

1
Switching CocoaPods version to 1.1.1

It seems BuddyBuild is using cocoapods 1.1.1. Mine is 1.4.0.

Specifying cocoapods version

So I need to specify the correct cocoapods version to make sure I and BuddyBuild are on the same page

1
2
gem install bundler
bundler init

And in my Gemfile

1
2
3
4
5
6
7
# frozen_string_literal: true

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

gem "cocoapods", '~> 1.0'

Then run

1
bundler install

And check Gemfile.lock to make sure everything is OK

Finally

Commit the changes, and now BuddyBuild is picking up the right cocoapods version, hence using the new pods

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15


=== CocoaPods ===
45
Switching CocoaPods version to 1.4.0
46
Using Command Line: gem cleanup "cocoapods"
47
Using Command Line: gem uninstall "cocoapods" --all --executables --force
48
Using Command Line: gem install "cocoapods" --no-rdoc --no-ri --version "1.4.0"
49
Unpacking caches - cocoapods pod specs
50
Using Command Line: pod install --no-repo-update

Comments