3232 demumbleVer : " 1.1.0"
3333 # Use SHA256 for hashing files.
3434 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.
3636 # 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"
3840
3941jobs :
4042 log_inputs :
9193 if : runner.os == 'macOS'
9294 run : sudo xcode-select -s /Applications/Xcode_${{ env.xcodeVersion }}.app/Contents/Developer
9395
94- - name : fetch and build binutils
96+ - name : Fetch and build binutils
9597 run : |
9698 set +e
9799 # Retry up to 10 times because Curl has a tendency to timeout on
@@ -105,13 +107,46 @@ jobs:
105107
106108 tar -xf binutils.tar.xz
107109 mv ./binutils-${{ matrix.binutils_version }} ./binutils-src
110+ mkdir /tmp/binutils-output
108111 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
111114 make install
112115 cd -
113116 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+ uses : actions/checkout@v2.3.1
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
115150
116151 - name : fetch demumble
117152 uses : actions/checkout@v2.3.1
@@ -127,7 +162,7 @@ jobs:
127162 cmake --build .
128163 python demumble_test.py
129164 cd -
130- mkdir -p packaging-tools-
165+ mkdir -p packaging-tools
131166 cp -af demumble-src/demumble packaging-tools
132167
133168 - name : archive tools
@@ -254,7 +289,7 @@ jobs:
254289 matrix :
255290 os : [windows-latest, ubuntu-latest, macos-latest]
256291 build_type : ["Release", "Debug"]
257- architecture : ["x64", "x86"]
292+ architecture : ["x64", "x86", "arm64" ]
258293 msvc_runtime : ["static", "dynamic"]
259294 linux_abi : ["legacy", "c++11"]
260295 python_version : [3.7]
@@ -292,6 +327,10 @@ jobs:
292327 msvc_runtime : " dynamic"
293328 - os : ubuntu-latest
294329 build_type : " Debug"
330+ - os : ubuntu-latest
331+ architecture : " arm64"
332+ - os : windows-latest
333+ architecture : " arm64"
295334
296335 steps :
297336 - name : setup Xcode version (macos)
@@ -308,6 +347,10 @@ jobs:
308347 echo "VCPKG_RESPONSE_FILE=external/vcpkg_${{ matrix.vcpkg_triplet }}_response_file.txt" >> $GITHUB_ENV
309348 echo "MATRIX_UNIQUE_NAME=${{ matrix.os }}-${{ matrix.build_type }}-${{ matrix.architecture }}-${{ matrix.python_version }}-${{ matrix.msvc_runtime }}-${{ matrix.linux_abi }}" >> $GITHUB_ENV
310349 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
311354
312355 - name : Add msbuild to PATH (windows)
313356 if : startsWith(matrix.os, 'windows')
@@ -318,7 +361,7 @@ jobs:
318361 uses : actions/cache@v2
319362 with :
320363 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}}
322365
323366 - name : Cache ccache files
324367 if : startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macos')
@@ -503,15 +546,15 @@ jobs:
503546 variant=$(sdk-src/build_scripts/desktop/get_variant.sh "${pkg}")
504547 additional_flags=(${verbose_flag})
505548 # 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 )
510553 elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x64/"* ]]; then
511- # Windows x64
554+ # Windows x64: force input and output target format
512555 additional_flags+=(-f pe-x86-64,pe-bigobj-x86-64)
513556 elif [[ "${{ matrix.sdk_platform }}" == "windows" && "${variant}" == *"/x86/"* ]]; then
514- # Windows x86
557+ # Windows x86: force input and output target format
515558 additional_flags+=(-f pe-i386,pe-bigobj-i386)
516559 fi
517560 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