32
32
demumbleVer : " 1.1.0"
33
33
# Use SHA256 for hashing files.
34
34
hashCommand : " sha256sum"
35
- # Xcode version 12 is the version we build the SDK with.
35
+ # Xcode version 12.2 is the version we build the SDK with.
36
36
# Our MacOS runners will use the version in /Applications/Xcode_${xcodeVersion}.app
37
- xcodeVersion : " 12"
37
+ xcodeVersion : " 12.2"
38
+ # LLVM version with ARM MachO support has no version number yet.
39
+ llvmVer : " 5f187f0afaad33013ba03454c4749d99b1362534"
40
+ GITHUB_TOKEN : ${{ github.token }}
38
41
39
42
jobs :
40
43
log_inputs :
91
94
if : runner.os == 'macOS'
92
95
run : sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
93
96
94
- - name : fetch and build binutils
97
+ - name : Fetch and build binutils
95
98
run : |
96
99
set +e
97
100
# Retry up to 10 times because Curl has a tendency to timeout on
@@ -105,13 +108,46 @@ jobs:
105
108
106
109
tar -xf binutils.tar.xz
107
110
mv ./binutils-${{ matrix.binutils_version }} ./binutils-src
111
+ mkdir /tmp/binutils-output
108
112
cd binutils-src
109
- ./configure --enable-targets=all --prefix=/tmp/binutils
110
- make
113
+ ./configure --enable-targets=all --prefix=/tmp/binutils-output
114
+ make -j2
111
115
make install
112
116
cd -
113
117
mkdir -p packaging-tools
114
- cp -af /tmp/binutils/bin/* packaging-tools
118
+ cp -af /tmp/binutils-output/bin/* packaging-tools
119
+
120
+ - name : Cache LLVM (Mac only)
121
+ if : matrix.tools_platform == 'darwin'
122
+ id : cache_llvm
123
+ uses : actions/cache@v2
124
+ with :
125
+ path : llvm-src/llvm/build/bin
126
+ key : llvm-bin-${{matrix.tools_platform}}-${{env.xcodeVersion}}-${{env.llvmVer}}
127
+
128
+ - name : Fetch LLVM source (Mac only)
129
+ # Only fetch LLVM if we don't already have binaries from the cache.
130
+ if : ${{ matrix.tools_platform == 'darwin' && !steps.cache_llvm.outputs.cache-hit }}
131
+
132
+ with :
133
+ repository : llvm/llvm-project
134
+ path : llvm-src
135
+ ref : ${{ env.llvmVer }}
136
+
137
+ - name : Build LLVM (Mac only)
138
+ # Only build LLVM if we don't already have binaries from the cache.
139
+ if : ${{ matrix.tools_platform == 'darwin' && !steps.cache_llvm.outputs.cache-hit }}
140
+ run : |
141
+ mkdir llvm-src/llvm/build
142
+ cd llvm-src/llvm/build
143
+ cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release ..
144
+ cmake --build . -j 3 --target llvm-objcopy --target llvm-nm --target llvm-ar
145
+
146
+ - name : Package LLVM output (Mac only)
147
+ if : matrix.tools_platform == 'darwin'
148
+ run : |
149
+ mkdir -p packaging-tools
150
+ cp -af llvm-src/llvm/build/bin/* packaging-tools
115
151
116
152
- name : fetch demumble
117
153
@@ -127,7 +163,7 @@ jobs:
127
163
cmake --build .
128
164
python demumble_test.py
129
165
cd -
130
- mkdir -p packaging-tools-
166
+ mkdir -p packaging-tools
131
167
cp -af demumble-src/demumble packaging-tools
132
168
133
169
- name : archive tools
@@ -147,6 +183,13 @@ jobs:
147
183
runs-on : macos-latest
148
184
if : ${{ github.event.inputs.downloadPublicVersion == '' && github.event.inputs.downloadPreviousRun == '' }}
149
185
steps :
186
+ - name : Store git credentials for all git commands
187
+ # Forces all git commands to use authenticated https, to prevent throttling.
188
+ shell : bash
189
+ run : |
190
+ git config --global credential.helper 'store --file /tmp/git-credentials'
191
+ echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials
192
+
150
193
- name : setup Xcode version (macos)
151
194
if : runner.os == 'macOS'
152
195
run : sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
@@ -207,6 +250,13 @@ jobs:
207
250
with :
208
251
path : sdk-src
209
252
253
+ - name : Store git credentials for all git commands
254
+ # Forces all git commands to use authenticated https, to prevent throttling.
255
+ shell : bash
256
+ run : |
257
+ git config --global credential.helper 'store --file /tmp/git-credentials'
258
+ echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials
259
+
210
260
- name : Cache NDK
211
261
id : cache_ndk
212
262
uses : actions/cache@v2
@@ -254,7 +304,7 @@ jobs:
254
304
matrix :
255
305
os : [windows-latest, ubuntu-latest, macos-latest]
256
306
build_type : ["Release", "Debug"]
257
- architecture : ["x64", "x86"]
307
+ architecture : ["x64", "x86", "arm64" ]
258
308
msvc_runtime : ["static", "dynamic"]
259
309
linux_abi : ["legacy", "c++11"]
260
310
python_version : [3.7]
@@ -292,8 +342,19 @@ jobs:
292
342
msvc_runtime : " dynamic"
293
343
- os : ubuntu-latest
294
344
build_type : " Debug"
345
+ - os : ubuntu-latest
346
+ architecture : " arm64"
347
+ - os : windows-latest
348
+ architecture : " arm64"
295
349
296
350
steps :
351
+ - name : Store git credentials for all git commands
352
+ # Forces all git commands to use authenticated https, to prevent throttling.
353
+ shell : bash
354
+ run : |
355
+ git config --global credential.helper 'store --file /tmp/git-credentials'
356
+ echo 'https://${{ github.token }}@github.com' > /tmp/git-credentials
357
+
297
358
- name : setup Xcode version (macos)
298
359
if : runner.os == 'macOS'
299
360
run : sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
@@ -308,6 +369,10 @@ jobs:
308
369
echo "VCPKG_RESPONSE_FILE=external/vcpkg_${{ matrix.vcpkg_triplet }}_response_file.txt" >> $GITHUB_ENV
309
370
echo "MATRIX_UNIQUE_NAME=${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.python_version }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}" >> $GITHUB_ENV
310
371
echo "SDK_NAME=${{ matrix.sdk_platform }}-${{ matrix.architecture }}-${{ matrix.build_type }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}" >> $GITHUB_ENV
372
+ if [[ '${{ matrix.sdk_platform }}' == 'darwin' ]]; then
373
+ # If Mac, also hash vcpkg cache on Xcode version.
374
+ echo "VCPKG_EXTRA_HASH=-xcode${{env.xcodeVersion}}" >> $GITHUB_ENV
375
+ fi
311
376
312
377
- name : Add msbuild to PATH (windows)
313
378
if : startsWith(matrix.os, 'windows')
@@ -318,7 +383,7 @@ jobs:
318
383
uses : actions/cache@v2
319
384
with :
320
385
path : external/vcpkg/installed
321
- key : dev-vcpkg-${{ matrix.architecture }}-${{ matrix.vcpkg_triplet_suffix }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}-${{ hashFiles(format('{0}', env.VCPKG_RESPONSE_FILE)) }}-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}
386
+ key : dev-vcpkg-${{ matrix.architecture }}-${{ matrix.vcpkg_triplet_suffix }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}-${{ hashFiles(format('{0}', env.VCPKG_RESPONSE_FILE)) }}-${{ hashFiles('.git/modules/external/vcpkg/HEAD') }}${{env.VCPKG_EXTRA_HASH}}
322
387
323
388
- name : Cache ccache files
324
389
if : startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
@@ -503,15 +568,15 @@ jobs:
503
568
variant=$(sdk-src/build_scripts/desktop/get_variant.sh "${pkg}")
504
569
additional_flags=(${verbose_flag})
505
570
# Several build targets require explicitly-set binutils format to be passed
506
- # to package.sh (and thus, to merge_libraries).
507
- if [[ "${{ matrix.sdk_platform }}" == "darwin" && "${variant}" == "arm64" ]]; then
508
- # MacOS ARM
509
- additional_flags+=(-f mach-o-arm64 )
571
+ # to package.sh (and thus, to merge_libraries), or use LLVM binutils .
572
+ if [[ "${{ matrix.sdk_platform }}" == "darwin" ]]; then
573
+ # MacOS: use LLVM binutils for both X64 and ARM64
574
+ additional_flags+=(-L )
510
575
elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x64/"* ]]; then
511
- # Windows x64
576
+ # Windows x64: force input and output target format
512
577
additional_flags+=(-f pe-x86-64,pe-bigobj-x86-64)
513
578
elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x86/"* ]]; then
514
- # Windows x86
579
+ # Windows x86: force input and output target format
515
580
additional_flags+=(-f pe-i386,pe-bigobj-i386)
516
581
fi
517
582
sdk-src/build_scripts/desktop/package.sh -b ${pkg} -o firebase-cpp-sdk-${{ matrix.sdk_platform }}${{ matrix.suffix }}-package -p ${{ matrix.sdk_platform }} -t bin -d ${variant} -P python3 -j ${additional_flags[*]}
@@ -721,8 +786,8 @@ jobs:
721
786
USE_EXPANDED_MATRIX=0
722
787
fi
723
788
if [[ "${{ github.event_name }}" == "schedule" ]]; then
724
- # reuse flag --test_pull_request=sdk to generate report
725
- generate_report=(-p test_pull_request sdk )
789
+ # reuse flag --test_pull_request=nightly-packaging to generate report
790
+ generate_report=(-p test_pull_request nightly-packaging )
726
791
fi
727
792
verbose_flag=
728
793
if [[ -n "${{ github.event.inputs.verboseBuild }}" && "${{ github.event.inputs.verboseBuild }}" -ne 0 ]]; then
0 commit comments