55 VCPKG_BINARY_SOURCES : ' clear;nuget,Source,readwrite;nugettimeout,3601'
66 # Self-hosted runners can hopefully reuse already downloaded packages
77 VCPKG_USE_NUGET_CACHE : 1
8+ VCPKG_DEFAULT_HOST_TRIPLET : ' x64-linux-rel'
89
910on :
1011 release :
@@ -36,29 +37,25 @@ jobs:
3637 strategy :
3738 fail-fast : false
3839 matrix :
39- host :
40- - { arch: 'amd64', triplet: 'x64-linux-rel' }
4140 image :
42- - { name: 'ubuntu', tag: '20.04' }
43- - { name: 'ubuntu', tag: '22.04' }
41+ - { name: 'ubuntu-v2 ', tag: '20.04' }
42+ - { name: 'ubuntu-v2 ', tag: '22.04' }
4443 llvm : [ 'llvm-15', 'llvm-16[pasta]', 'llvm-16' ]
44+ target_arch : [ 'x64', 'arm64' ]
4545
4646 container :
4747 image : docker.pkg.github.com/lifting-bits/cxx-common/vcpkg-builder-${{ matrix.image.name }}:${{ matrix.image.tag }}
4848 credentials :
4949 username : ${{ github.actor }}
5050 password : ${{ secrets.GITHUB_TOKEN }}
5151
52- env :
53- VCPKG_DEFAULT_HOST_TRIPLET : ${{ matrix.host.triplet }}
54-
55- name : ${{matrix.image.name}}-${{matrix.image.tag}} ${{matrix.llvm}} ${{matrix.host.arch}}
52+ name : ${{matrix.image.name}}-${{matrix.image.tag}} ${{matrix.llvm}} ${{matrix.target_arch}}
5653 runs-on : ubuntu-latest # run the job on the newly created runner
5754 steps :
5855 - name : Set Artifact Name
5956 run : |
6057 # Need to fix because paths with brackets cause issues
61- NAME="$(echo 'vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_${{ matrix.llvm }}_${{ matrix.host.arch }}' | tr '[' '-' | tr -d ']')"
58+ NAME="$(echo 'vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_${{ matrix.llvm }}_${{ matrix.target_arch == 'x64' && 'amd64' || matrix.target_arch }}' | tr '[' '-' | tr -d ']')"
6259 echo "ARTIFACT_NAME=${NAME}" >> "$GITHUB_ENV"
6360
6461 - uses : actions/checkout@v3
@@ -116,10 +113,10 @@ jobs:
116113 -source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
117114 "${{ secrets.GITHUB_TOKEN }}"
118115
119- ./build_dependencies.sh --release --export-dir ./${{ env.ARTIFACT_NAME }} ${{ matrix.llvm }} --clean-after-build --debug
116+ ./build_dependencies.sh --release --target-arch ${{ matrix.target_arch }} -- export-dir ./${{ env.ARTIFACT_NAME }} ${{ matrix.llvm }} --clean-after-build --debug
120117
121118 echo "VCPKG_ROOT=$(pwd)/${{ env.ARTIFACT_NAME }}" >> $GITHUB_ENV
122- echo "TARGET_TRIPLET=${{ matrix.host.triplet }}" >> $GITHUB_ENV
119+ echo "TARGET_TRIPLET=${{ matrix.target_arch }}-linux-rel " >> $GITHUB_ENV
123120
124121 - name : Upload CMake logs on error
125122 if : failure()
@@ -165,9 +162,9 @@ jobs:
165162 uses : actions/cache@v3
166163 with :
167164 path : ${{ github.workspace }}/.ccache
168- key : ccache-${{ matrix.image.name }}-${{ matrix.image.tag }}-${{ matrix.host.arch }}-${{ matrix.llvm }}-${{ steps.ccache_prep.outputs.timestamp }}
165+ key : ccache-${{ matrix.image.name }}-${{ matrix.image.tag }}-${{ matrix.target_arch }}-${{ matrix.llvm }}-${{ steps.ccache_prep.outputs.timestamp }}
169166 restore-keys : |
170- ccache-${{ matrix.image.name }}-${{ matrix.image.tag }}-${{ matrix.host.arch }}-${{ matrix.llvm }}-
167+ ccache-${{ matrix.image.name }}-${{ matrix.image.tag }}-${{ matrix.target_arch }}-${{ matrix.llvm }}-
171168
172169 - name : ccache Initial stats
173170 shell : bash
@@ -177,26 +174,30 @@ jobs:
177174 - name : ' Rellic build'
178175 shell : ' bash'
179176 working-directory : rellic
180- if : contains(matrix.llvm, 'llvm-15')
177+ if : contains(matrix.llvm, 'llvm-15') && matrix.target_arch == 'x64'
181178 run : |
179+ # Does not compile with gcc
180+ export CC="$(which clang)"
181+ export CXX="$(which clang++)"
182182 cmake -G Ninja \
183183 -DCMAKE_VERBOSE_MAKEFILE=ON \
184184 "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \
185185 -DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET} \
186- -DVCPKG_HOST_TRIPLET=${TARGET_TRIPLET } \
186+ -DVCPKG_HOST_TRIPLET=${VCPKG_DEFAULT_HOST_TRIPLET } \
187187 "-DCMAKE_INSTALL_PREFIX=$(pwd)/install" \
188188 -S . -B build
189189 cmake --build build
190190 cmake --build build --target install
191191 - name : ' Rellic test'
192192 shell : ' bash'
193193 working-directory : rellic/build
194- if : contains(matrix.llvm, 'llvm-15')
194+ if : contains(matrix.llvm, 'llvm-15') && matrix.target_arch == 'x64'
195195 run : |
196196 ../scripts/roundtrip.py ./tools/rellic-decomp ../tests/tools/decomp "${VCPKG_ROOT}/installed/${TARGET_TRIPLET}/tools/llvm/clang"
197197
198198 - name : ' Remill dependencies'
199199 shell : ' bash'
200+ if : contains(matrix.llvm, 'llvm-15') && matrix.target_arch == 'x64'
200201 working-directory : remill
201202 run : |
202203 python3 -m pip install poetry
@@ -206,13 +207,19 @@ jobs:
206207
207208 - name : ' Remill build'
208209 shell : ' bash'
210+ if : contains(matrix.llvm, 'llvm-15') && matrix.target_arch == 'x64'
209211 working-directory : remill
210212 run : |
213+ if [[ '${{ matrix.image.tag }}' == '20.04' ]]; then
214+ # Remill uses C++20 concepts that aren't supported by gcc-9 in 20.04
215+ export CC="$(which clang)"
216+ export CXX="$(which clang++)"
217+ fi
211218 cmake -G Ninja \
212219 -DCMAKE_VERBOSE_MAKEFILE=ON \
213220 "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \
214221 -DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET} \
215- -DVCPKG_HOST_TRIPLET=${TARGET_TRIPLET } \
222+ -DVCPKG_HOST_TRIPLET=${VCPKG_DEFAULT_HOST_TRIPLET } \
216223 "-DCMAKE_INSTALL_PREFIX=$(pwd)/install" \
217224 -S . -B build
218225 cmake --build build
@@ -221,21 +228,26 @@ jobs:
221228 - name : ' Remill test'
222229 shell : ' bash'
223230 working-directory : remill/build
231+ if : contains(matrix.llvm, 'llvm-15') && matrix.target_arch == 'x64'
224232 run : |
225233 # Some tests fail on ubuntu 22.04
226234 env CTEST_OUTPUT_ON_FAILURE=1 ctest . || true
227235
228236 - name : ' Anvill build'
229237 shell : ' bash'
230238 working-directory : anvill
231- if : contains(matrix.llvm, 'llvm-15')
239+ if : contains(matrix.llvm, 'llvm-15') && matrix.target_arch == 'x64'
232240 run : |
241+ # TODO: Does not support compilation with gcc
242+ export CC="$(which clang)"
243+ export CXX="$(which clang++)"
244+
233245 cmake -G Ninja \
234246 -DCMAKE_VERBOSE_MAKEFILE=ON \
235247 "-DCMAKE_INSTALL_PREFIX=$(pwd)/install" \
236248 "-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \
237249 -DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET} \
238- -DVCPKG_HOST_TRIPLET=${TARGET_TRIPLET } \
250+ -DVCPKG_HOST_TRIPLET=${VCPKG_DEFAULT_HOST_TRIPLET } \
239251 -DANVILL_ENABLE_TESTS=true \
240252 -DANVILL_ENABLE_INSTALL=true \
241253 -DANVILL_ENABLE_PYTHON3_LIBS=OFF \
@@ -249,7 +261,7 @@ jobs:
249261 # - name: 'Anvill test'
250262 # shell: 'bash'
251263 # working-directory: anvill
252- # if: contains(matrix.llvm, 'llvm-15')
264+ # if: contains(matrix.llvm, 'llvm-15') && matrix.target_arch == 'x64'
253265 # run: |
254266 # ./install/bin/anvill-decompile-spec --spec ../bin/Decompile/tests/specs/ret0.json --bc_out ./ret0.bc --ir_out ret0.ir
255267
0 commit comments