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"
38
40
39
41
jobs :
40
42
log_inputs :
91
93
if : runner.os == 'macOS'
92
94
run : sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
93
95
94
- - name : fetch and build binutils
96
+ - name : Fetch and build binutils
95
97
run : |
96
98
set +e
97
99
# Retry up to 10 times because Curl has a tendency to timeout on
@@ -105,13 +107,46 @@ jobs:
105
107
106
108
tar -xf binutils.tar.xz
107
109
mv ./binutils-${{ matrix.binutils_version }} ./binutils-src
110
+ mkdir /tmp/binutils-output
108
111
cd binutils-src
109
- ./configure --enable-targets=all --prefix=/tmp/binutils
110
- make
112
+ ./configure --enable-targets=all --prefix=/tmp/binutils-output
113
+ make -j2
111
114
make install
112
115
cd -
113
116
mkdir -p packaging-tools
114
- cp -af /tmp/binutils/bin/* packaging-tools
117
+ cp -af /tmp/binutils-output/bin/* packaging-tools
118
+
119
+ - name : Cache LLVM (Mac only)
120
+ if : matrix.tools_platform == 'darwin'
121
+ id : cache_llvm
122
+ uses : actions/cache@v2
123
+ with :
124
+ path : llvm-src/llvm/build/bin
125
+ key : llvm-bin-${{matrix.tools_platform}}-${{env.xcodeVersion}}-${{env.llvmVer}}
126
+
127
+ - name : Fetch LLVM source (Mac only)
128
+ # Only fetch LLVM if we don't already have binaries from the cache.
129
+ if : ${{ matrix.tools_platform == 'darwin' && !steps.cache_llvm.outputs.cache-hit }}
130
+
131
+ with :
132
+ repository : llvm/llvm-project
133
+ path : llvm-src
134
+ ref : ${{ env.llvmVer }}
135
+
136
+ - name : Build LLVM (Mac only)
137
+ # Only build LLVM if we don't already have binaries from the cache.
138
+ if : ${{ matrix.tools_platform == 'darwin' && !steps.cache_llvm.outputs.cache-hit }}
139
+ run : |
140
+ mkdir llvm-src/llvm/build
141
+ cd llvm-src/llvm/build
142
+ cmake -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release ..
143
+ cmake --build . -j 3 --target llvm-objcopy --target llvm-nm --target llvm-ar
144
+
145
+ - name : Package LLVM output (Mac only)
146
+ if : matrix.tools_platform == 'darwin'
147
+ run : |
148
+ mkdir -p packaging-tools
149
+ cp -af llvm-src/llvm/build/bin/* packaging-tools
115
150
116
151
- name : fetch demumble
117
152
@@ -127,7 +162,7 @@ jobs:
127
162
cmake --build .
128
163
python demumble_test.py
129
164
cd -
130
- mkdir -p packaging-tools-
165
+ mkdir -p packaging-tools
131
166
cp -af demumble-src/demumble packaging-tools
132
167
133
168
- name : archive tools
@@ -254,7 +289,7 @@ jobs:
254
289
matrix :
255
290
os : [windows-latest, ubuntu-latest, macos-latest]
256
291
build_type : ["Release", "Debug"]
257
- architecture : ["x64", "x86"]
292
+ architecture : ["x64", "x86", "arm64" ]
258
293
msvc_runtime : ["static", "dynamic"]
259
294
linux_abi : ["legacy", "c++11"]
260
295
python_version : [3.7]
@@ -292,6 +327,10 @@ jobs:
292
327
msvc_runtime : " dynamic"
293
328
- os : ubuntu-latest
294
329
build_type : " Debug"
330
+ - os : ubuntu-latest
331
+ architecture : " arm64"
332
+ - os : windows-latest
333
+ architecture : " arm64"
295
334
296
335
steps :
297
336
- name : setup Xcode version (macos)
@@ -308,6 +347,10 @@ jobs:
308
347
echo "VCPKG_RESPONSE_FILE=external/vcpkg_${{ matrix.vcpkg_triplet }}_response_file.txt" >> $GITHUB_ENV
309
348
echo "MATRIX_UNIQUE_NAME=${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.python_version }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}" >> $GITHUB_ENV
310
349
echo "SDK_NAME=${{ matrix.sdk_platform }}-${{ matrix.architecture }}-${{ matrix.build_type }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}" >> $GITHUB_ENV
350
+ if [[ '${{ matrix.sdk_platform }}' == 'darwin' ]]; then
351
+ # If Mac, also hash vcpkg cache on Xcode version.
352
+ echo "VCPKG_EXTRA_HASH=-xcode${{env.xcodeVersion}}" >> $GITHUB_ENV
353
+ fi
311
354
312
355
- name : Add msbuild to PATH (windows)
313
356
if : startsWith(matrix.os, 'windows')
@@ -318,7 +361,7 @@ jobs:
318
361
uses : actions/cache@v2
319
362
with :
320
363
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') }}
364
+ 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
365
323
366
- name : Cache ccache files
324
367
if : startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
@@ -503,15 +546,15 @@ jobs:
503
546
variant=$(sdk-src/build_scripts/desktop/get_variant.sh "${pkg}")
504
547
additional_flags=(${verbose_flag})
505
548
# 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 )
549
+ # to package.sh (and thus, to merge_libraries), or use LLVM binutils .
550
+ if [[ "${{ matrix.sdk_platform }}" == "darwin" ]]; then
551
+ # MacOS: use LLVM binutils for both X64 and ARM64
552
+ additional_flags+=(-L )
510
553
elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x64/"* ]]; then
511
- # Windows x64
554
+ # Windows x64: force input and output target format
512
555
additional_flags+=(-f pe-x86-64,pe-bigobj-x86-64)
513
556
elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x86/"* ]]; then
514
- # Windows x86
557
+ # Windows x86: force input and output target format
515
558
additional_flags+=(-f pe-i386,pe-bigobj-i386)
516
559
fi
517
560
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[*]}
0 commit comments