Skip to content

Commit 39d59d6

Browse files
authored
Merge pull request #969 from oxen-io/dev
Release 2.6.0
2 parents cfbf0cc + 8276749 commit 39d59d6

File tree

348 files changed

+13065
-14505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

348 files changed

+13065
-14505
lines changed

.drone.jsonnet

+96-82
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,42 @@
11
// This build configuration requires the following to be installed:
2-
// Git, Xcode, XCode Command-line Tools, Cocoapods, Xcodebuild, Xcresultparser, pip
2+
// Git, Xcode, XCode Command-line Tools, Cocoapods, xcbeautify, xcresultparser, pip
33

44
// Log a bunch of version information to make it easier for debugging
55
local version_info = {
66
name: 'Version Information',
7+
environment: { LANG: 'en_US.UTF-8' },
78
commands: [
89
'git --version',
910
'pod --version',
10-
'xcodebuild -version'
11-
]
11+
'xcodebuild -version',
12+
'xcbeautify --version',
13+
'xcresultparser --version',
14+
'pip --version',
15+
],
1216
};
1317

1418
// Intentionally doing a depth of 2 as libSession-util has it's own submodules (and libLokinet likely will as well)
1519
local clone_submodules = {
1620
name: 'Clone Submodules',
17-
commands: ['git fetch --tags', 'git submodule update --init --recursive --depth=2 --jobs=4']
21+
commands: ['git submodule update --init --recursive --depth=2 --jobs=4'],
1822
};
1923

2024
// cmake options for static deps mirror
2125
local ci_dep_mirror(want_mirror) = (if want_mirror then ' -DLOCAL_MIRROR=https://oxen.rocks/deps ' else '');
2226

23-
// Output some information about the built tools in case specific combinations break the build
24-
local machine_info = {
25-
name: 'Machine info',
26-
commands: [
27-
'xcodebuild -version',
28-
'LANG=en_US.UTF-8 pod --version'
29-
]
30-
};
31-
3227
// Cocoapods
33-
//
28+
//
3429
// Unfortunately Cocoapods has a dumb restriction which requires you to use UTF-8 for the
3530
// 'LANG' env var so we need to work around the with https://github.com/CocoaPods/CocoaPods/issues/6333
3631
local install_cocoapods = {
3732
name: 'Install CocoaPods',
38-
commands: ['
39-
LANG=en_US.UTF-8 pod install || rm -rf ./Pods && LANG=en_US.UTF-8 pod install
40-
'],
33+
environment: { LANG: 'en_US.UTF-8' },
34+
commands: [
35+
'pod install || (rm -rf ./Pods && pod install)',
36+
],
4137
depends_on: [
42-
'Load CocoaPods Cache'
43-
]
38+
'Load CocoaPods Cache',
39+
],
4440
};
4541

4642
// Load from the cached CocoaPods directory (to speed up the build)
@@ -49,26 +45,26 @@ local load_cocoapods_cache = {
4945
commands: [
5046
|||
5147
LOOP_BREAK=0
52-
while test -e /Users/drone/.cocoapods_cache.lock; do
48+
while test -e /Users/$USER/.cocoapods_cache.lock; do
5349
sleep 1
5450
LOOP_BREAK=$((LOOP_BREAK + 1))
5551
5652
if [[ $LOOP_BREAK -ge 600 ]]; then
57-
rm -f /Users/drone/.cocoapods_cache.lock
53+
rm -f /Users/$USER/.cocoapods_cache.lock
5854
fi
5955
done
6056
|||,
61-
'touch /Users/drone/.cocoapods_cache.lock',
57+
'touch /Users/$USER/.cocoapods_cache.lock',
6258
|||
63-
if [[ -d /Users/drone/.cocoapods_cache ]]; then
64-
cp -r /Users/drone/.cocoapods_cache ./Pods
59+
if [[ -d /Users/$USER/.cocoapods_cache ]]; then
60+
cp -r /Users/$USER/.cocoapods_cache ./Pods
6561
fi
6662
|||,
67-
'rm -f /Users/drone/.cocoapods_cache.lock'
63+
'rm -f /Users/$USER/.cocoapods_cache.lock',
6864
],
6965
depends_on: [
70-
'Clone Submodules'
71-
]
66+
'Clone Submodules',
67+
],
7268
};
7369

7470
// Override the cached CocoaPods directory (to speed up the next build)
@@ -77,107 +73,125 @@ local update_cocoapods_cache(depends_on) = {
7773
commands: [
7874
|||
7975
LOOP_BREAK=0
80-
while test -e /Users/drone/.cocoapods_cache.lock; do
76+
while test -e /Users/$USER/.cocoapods_cache.lock; do
8177
sleep 1
8278
LOOP_BREAK=$((LOOP_BREAK + 1))
8379
8480
if [[ $LOOP_BREAK -ge 600 ]]; then
85-
rm -f /Users/drone/.cocoapods_cache.lock
81+
rm -f /Users/$USER/.cocoapods_cache.lock
8682
fi
8783
done
8884
|||,
89-
'touch /Users/drone/.cocoapods_cache.lock',
85+
'touch /Users/$USER/.cocoapods_cache.lock',
9086
|||
9187
if [[ -d ./Pods ]]; then
92-
rm -rf /Users/drone/.cocoapods_cache
93-
cp -r ./Pods /Users/drone/.cocoapods_cache
88+
rsync -a --delete ./Pods/ /Users/$USER/.cocoapods_cache
9489
fi
9590
|||,
96-
'rm -f /Users/drone/.cocoapods_cache.lock'
91+
'rm -f /Users/$USER/.cocoapods_cache.lock',
9792
],
9893
depends_on: depends_on,
9994
};
10095

96+
local boot_simulator(device_type) = {
97+
name: 'Boot Test Simulator',
98+
commands: [
99+
'devname="Test-iPhone-${DRONE_COMMIT:0:9}-${DRONE_BUILD_EVENT}"',
100+
'xcrun simctl create "$devname" ' + device_type,
101+
'sim_uuid=$(xcrun simctl list devices -je | jq -re \'[.devices[][] | select(.name == "\'$devname\'").udid][0]\')',
102+
'xcrun simctl boot $sim_uuid',
103+
104+
'mkdir -p build/artifacts',
105+
'echo $sim_uuid > ./build/artifacts/sim_uuid',
106+
'echo $devname > ./build/artifacts/device_name',
107+
108+
'xcrun simctl list -je devices $sim_uuid | jq -r \'.devices[][0] | "\\u001b[32;1mSimulator " + .state + ": \\u001b[34m" + .name + " (\\u001b[35m" + .deviceTypeIdentifier + ", \\u001b[36m" + .udid + "\\u001b[34m)\\u001b[0m"\'',
109+
],
110+
};
111+
local sim_keepalive = {
112+
name: '(Simulator keep-alive)',
113+
commands: [
114+
'/Users/$USER/sim-keepalive/keepalive.sh $(<./build/artifacts/sim_uuid)',
115+
],
116+
depends_on: ['Boot Test Simulator'],
117+
};
118+
local sim_delete_cmd = 'if [ -f build/artifacts/sim_uuid ]; then rm -f /Users/$USER/sim-keepalive/$(<./build/artifacts/sim_uuid); fi';
119+
101120
[
102121
// Unit tests (PRs only)
103122
{
104123
kind: 'pipeline',
105124
type: 'exec',
106125
name: 'Unit Tests',
107-
platform: { os: 'darwin', arch: 'amd64' },
108-
trigger: { event: { exclude: [ 'push' ] } },
126+
platform: { os: 'darwin', arch: 'arm64' },
127+
trigger: { event: { exclude: ['push'] } },
109128
steps: [
110129
version_info,
111130
clone_submodules,
112131
load_cocoapods_cache,
113132
install_cocoapods,
114-
{
115-
name: 'Pre-Boot Test Simulator',
116-
commands: [
117-
'mkdir -p build/artifacts',
118-
'echo "Test-iPhone14-${DRONE_COMMIT:0:9}-${DRONE_BUILD_EVENT}" > ./build/artifacts/device_name',
119-
'xcrun simctl create "$(cat ./build/artifacts/device_name)" com.apple.CoreSimulator.SimDeviceType.iPhone-14',
120-
'echo $(xcrun simctl list devices | grep -m 1 $(cat ./build/artifacts/device_name) | grep -E -o -i "([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})") > ./build/artifacts/sim_uuid',
121-
'xcrun simctl boot $(cat ./build/artifacts/sim_uuid)',
122-
'echo "Pre-booting simulator complete: $(xcrun simctl list | sed "s/^[[:space:]]*//" | grep -o ".*$(cat ./build/artifacts/sim_uuid).*")"',
123-
]
124-
},
133+
134+
boot_simulator('com.apple.CoreSimulator.SimDeviceType.iPhone-15'),
135+
sim_keepalive,
125136
{
126137
name: 'Build and Run Tests',
127138
commands: [
128-
'NSUnbufferedIO=YES set -o pipefail && xcodebuild test -workspace Session.xcworkspace -scheme Session -derivedDataPath ./build/derivedData -resultBundlePath ./build/artifacts/testResults.xcresult -parallelizeTargets -destination "platform=iOS Simulator,id=$(cat ./build/artifacts/sim_uuid)" -parallel-testing-enabled NO -test-timeouts-enabled YES -maximum-test-execution-time-allowance 10 -collect-test-diagnostics never 2>&1 | xcbeautify --is-ci',
139+
'NSUnbufferedIO=YES set -o pipefail && xcodebuild test -workspace Session.xcworkspace -scheme Session -derivedDataPath ./build/derivedData -resultBundlePath ./build/artifacts/testResults.xcresult -parallelizeTargets -destination "platform=iOS Simulator,id=$(<./build/artifacts/sim_uuid)" -parallel-testing-enabled NO -test-timeouts-enabled YES -maximum-test-execution-time-allowance 10 -collect-test-diagnostics never 2>&1 | xcbeautify --is-ci',
129140
],
130141
depends_on: [
131-
'Pre-Boot Test Simulator',
132-
'Install CocoaPods'
142+
'Boot Test Simulator',
143+
'Install CocoaPods',
133144
],
134145
},
135146
{
136147
name: 'Unit Test Summary',
137148
commands: [
138-
'xcresultparser --output-format cli --failed-tests-only ./build/artifacts/testResults.xcresult',
149+
sim_delete_cmd,
150+
|||
151+
if [[ -d ./build/artifacts/testResults.xcresult ]]; then
152+
xcresultparser --output-format cli --failed-tests-only ./build/artifacts/testResults.xcresult
153+
else
154+
echo -e "\n\n\n\e[31;1mUnit test results not found\e[0m"
155+
fi
156+
|||,
139157
],
140158
depends_on: ['Build and Run Tests'],
141159
when: {
142-
status: ['failure', 'success']
143-
}
144-
},
145-
{
146-
name: 'Delete Test Simulator',
147-
commands: [
148-
'xcrun simctl delete $(cat ./build/artifacts/sim_uuid)'
149-
],
150-
depends_on: [
151-
'Build and Run Tests',
152-
],
153-
when: {
154-
status: ['failure', 'success']
155-
}
160+
status: ['failure', 'success'],
161+
},
156162
},
157163
update_cocoapods_cache(['Build and Run Tests']),
158164
{
159165
name: 'Install Codecov CLI',
160166
commands: [
167+
'mkdir -p build/artifacts',
161168
'pip3 install codecov-cli',
162-
'~/Library/Python/3.9/bin/codecovcli --version'
169+
'find $HOME/Library/Python -name codecovcli -print -quit > ./build/artifacts/codecov_path',
170+
|||
171+
if [[ ! -s ./build/artifacts/codecov_path ]]; then
172+
which codecovcli > ./build/artifacts/codecov_path
173+
fi
174+
|||,
175+
'$(<./build/artifacts/codecov_path) --version',
163176
],
164177
},
165178
{
166179
name: 'Convert xcresult to xml',
167180
commands: [
168181
'xcresultparser --output-format cobertura ./build/artifacts/testResults.xcresult > ./build/artifacts/coverage.xml',
169182
],
170-
depends_on: ['Build and Run Tests']
183+
depends_on: ['Build and Run Tests'],
171184
},
172185
{
186+
// No token needed for public repos
173187
name: 'Upload coverage to Codecov',
174188
commands: [
175-
'~/Library/Python/3.9/bin/codecovcli upload-process --fail-on-error -f ./build/artifacts/coverage.xml',
189+
'$(<./build/artifacts/codecov_path) upload-process --fail-on-error -f ./build/artifacts/coverage.xml',
176190
],
177191
depends_on: [
178192
'Convert xcresult to xml',
179-
'Install Codecov CLI'
180-
]
193+
'Install Codecov CLI',
194+
],
181195
},
182196
],
183197
},
@@ -186,24 +200,24 @@ local update_cocoapods_cache(depends_on) = {
186200
kind: 'pipeline',
187201
type: 'exec',
188202
name: 'Check Build Artifact Existence',
189-
platform: { os: 'darwin', arch: 'amd64' },
190-
trigger: { event: { exclude: [ 'push' ] } },
203+
platform: { os: 'darwin', arch: 'arm64' },
204+
trigger: { event: { exclude: ['push'] } },
191205
steps: [
192206
{
193207
name: 'Poll for build artifact existence',
194208
commands: [
195-
'./Scripts/drone-upload-exists.sh'
196-
]
197-
}
198-
]
209+
'./Scripts/drone-upload-exists.sh',
210+
],
211+
},
212+
],
199213
},
200214
// Simulator build (non-PRs only)
201215
{
202216
kind: 'pipeline',
203217
type: 'exec',
204218
name: 'Simulator Build',
205-
platform: { os: 'darwin', arch: 'amd64' },
206-
trigger: { event: { exclude: [ 'pull_request' ] } },
219+
platform: { os: 'darwin', arch: 'arm64' },
220+
trigger: { event: { exclude: ['pull_request'] } },
207221
steps: [
208222
version_info,
209223
clone_submodules,
@@ -213,22 +227,22 @@ local update_cocoapods_cache(depends_on) = {
213227
name: 'Build',
214228
commands: [
215229
'mkdir build',
216-
'xcodebuild archive -workspace Session.xcworkspace -scheme Session -derivedDataPath ./build/derivedData -parallelizeTargets -configuration "App Store Release" -sdk iphonesimulator -archivePath ./build/Session_sim.xcarchive -destination "generic/platform=iOS Simulator" | xcbeautify --is-ci'
230+
'NSUnbufferedIO=YES set -o pipefail && xcodebuild archive -workspace Session.xcworkspace -scheme Session -derivedDataPath ./build/derivedData -parallelizeTargets -configuration "App Store Release" -sdk iphonesimulator -archivePath ./build/Session_sim.xcarchive -destination "generic/platform=iOS Simulator" | xcbeautify --is-ci',
217231
],
218232
depends_on: [
219-
'Install CocoaPods'
233+
'Install CocoaPods',
220234
],
221235
},
222236
update_cocoapods_cache(['Build']),
223237
{
224238
name: 'Upload artifacts',
225239
environment: { SSH_KEY: { from_secret: 'SSH_KEY' } },
226240
commands: [
227-
'./Scripts/drone-static-upload.sh'
241+
'./Scripts/drone-static-upload.sh',
228242
],
229243
depends_on: [
230-
'Build'
231-
]
244+
'Build',
245+
],
232246
},
233247
],
234248
},

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ Index/
3030

3131
# CocoaPods
3232
Pods
33+
34+
# VSCode
35+
.vscode

BUILDING.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,23 @@ You can then add the Session repo to sync with upstream changes:
3030
git remote add upstream https://github.com/oxen-io/session-ios
3131
```
3232

33-
## 2. Pods
33+
## 2. Submodules
34+
35+
Session requires a number of submodules to build, these can be retrieved by navigating to the project directory and running:
36+
37+
```
38+
git submodule update --init --recursive
39+
```
40+
41+
## 3. Pods
3442

3543
To build and configure the libraries Session uses, just run:
3644

3745
```
3846
pod install
3947
```
4048

41-
## 3. Xcode
49+
## 4. Xcode
4250

4351
Open the `Session.xcworkspace` in Xcode.
4452

LibSession-Util

Submodule LibSession-Util updated 132 files

0 commit comments

Comments
 (0)