-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial import of ekilmer/vcpkg-lifting-ports with some link fixups
- Loading branch information
Showing
60 changed files
with
3,889 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
updates: | ||
|
||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
name: Linux Continuous Integration | ||
|
||
env: | ||
# "Source" is set in the vcpkg install step | ||
VCPKG_BINARY_SOURCES: 'clear;nuget,Source,readwrite' | ||
TRIPLET: 'x64-linux-rel' | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
push: | ||
paths-ignore: | ||
- 'docker/**' | ||
- '.github/workflows/vcpkg_docker.yml' | ||
- '**.md' | ||
- 'old/**' | ||
tags-ignore: | ||
- 'v*' | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
image: | ||
- { name: 'ubuntu', tag: '18.04' } | ||
- { name: 'ubuntu', tag: '20.04' } | ||
llvm: [ | ||
'llvm-9', | ||
'llvm-10', | ||
'llvm-11' | ||
] | ||
|
||
runs-on: ubuntu-20.04 | ||
container: | ||
image: ghcr.io/${{ github.repository_owner }}/vcpkg-builder-${{ matrix.image.name }}:${{ matrix.image.tag }} | ||
credentials: | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_PACKAGE_REGISTRY_TOKEN }} | ||
|
||
env: | ||
ARTIFACT_NAME: vcpkg_${{ matrix.image.name }}-${{ matrix.image.tag }}_${{ matrix.llvm }}_amd64.tar.xz | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Read vcpkg Info | ||
id: vcpkg_info | ||
shell: bash | ||
run: | | ||
{ read -r vcpkg_repo_url && read -r vcpkg_commit; } <./vcpkg_info.txt || exit 1 | ||
echo ::set-output name=repo_url::${vcpkg_repo_url} | ||
echo ::set-output name=commit::${vcpkg_commit} | ||
# Needed for caching the actual vcpkg executable | ||
- name: 'Restore from cache and install vcpkg' | ||
uses: lukka/[email protected] | ||
with: | ||
vcpkgGitURL: ${{ steps.vcpkg_info.outputs.repo_url }} | ||
vcpkgGitCommitId: ${{ steps.vcpkg_info.outputs.commit }} | ||
appendedCacheKey: '${{ matrix.image.name }}-${{ matrix.image.tag }}-${{ matrix.llvm }}' | ||
setupOnly: true | ||
|
||
# Omit this step if using manifests | ||
- name: 'vcpkg install dependencies' | ||
shell: 'bash' | ||
run: | | ||
# Setup NuGet authentication | ||
mono "$(${VCPKG_ROOT}/vcpkg fetch nuget | tail -n 1)" sources add \ | ||
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ | ||
-storepasswordincleartext \ | ||
-name "Source" \ | ||
-username "${{ github.repository_owner }}" \ | ||
-password "${{ secrets.GITHUB_TOKEN }}" | ||
mono "$(${VCPKG_ROOT}/vcpkg fetch nuget | tail -n 1)" setapikey \ | ||
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \ | ||
"${{ secrets.GITHUB_TOKEN }}" | ||
${VCPKG_ROOT}/vcpkg install \ | ||
--triplet "${TRIPLET}" \ | ||
--clean-after-build \ | ||
--debug \ | ||
${{ matrix.llvm }} \ | ||
@overlays.txt \ | ||
@dependencies.txt | ||
- name: 'Export Packages' | ||
if: contains(github.event.head_commit.message, 'debug artifacts') || github.event.release | ||
shell: 'bash' | ||
run: | | ||
apt-get update | ||
apt-get install -y pixz | ||
./emit_artifacts.sh ${{ env.ARTIFACT_NAME }} | ||
- uses: actions/[email protected] | ||
if: "contains(github.event.head_commit.message, 'debug artifacts')" | ||
with: | ||
name: ${{ env.ARTIFACT_NAME }} | ||
path: ${{ env.ARTIFACT_NAME }} | ||
|
||
# Only for LLVM-10 right now... | ||
- name: 'Build Packaged Lifting Tools' | ||
if: ${{ matrix.llvm == 'llvm-10' }} | ||
shell: 'bash' | ||
# NOTE: Cannot use --clean-after-build because of path issue finding semantics files | ||
run: | | ||
${VCPKG_ROOT}/vcpkg install \ | ||
--triplet "${TRIPLET}" \ | ||
--debug \ | ||
@overlays.txt \ | ||
remill | ||
- name: Prepare ccache | ||
id: ccache_prep | ||
shell: bash | ||
run: | | ||
echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV | ||
echo "CCACHE_COMPILERCHECK=content" >> $GITHUB_ENV | ||
echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> $GITHUB_ENV | ||
echo "CMAKE_C_COMPILER_LAUNCHER=$(which ccache)" >> $GITHUB_ENV | ||
echo "CMAKE_CXX_COMPILER_LAUNCHER=$(which ccache)" >> $GITHUB_ENV | ||
echo ::set-output name=timestamp::$(date +"%Y-%m-%d-%H:%M:%S" --utc) | ||
- name: ccache cache files | ||
uses: actions/[email protected] | ||
with: | ||
path: ${{ github.workspace }}/.ccache | ||
key: ccache-${{ matrix.image.name }}-${{ matrix.image.tag }}-${{ matrix.llvm }}-${{ steps.ccache_prep.outputs.timestamp }} | ||
restore-keys: | | ||
ccache-${{ matrix.image.name }}-${{ matrix.image.tag }}-${{ matrix.llvm }}- | ||
- name: ccache Initial stats | ||
shell: bash | ||
run: | | ||
ccache --show-stats | ||
- name: 'Test rellic build' | ||
shell: 'bash' | ||
run: | | ||
cd rellic | ||
mkdir build && cd build | ||
cmake -G Ninja \ | ||
-DCMAKE_VERBOSE_MAKEFILE=ON \ | ||
-DVCPKG_ROOT="${VCPKG_ROOT}" \ | ||
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" \ | ||
.. | ||
cmake --build . | ||
cmake --build . --target install | ||
../scripts/roundtrip.py ./tools/rellic-decomp-* ../tests/tools/decomp "${VCPKG_ROOT}/installed/${TRIPLET}/bin/clang" || true | ||
- name: 'Test remill build' | ||
shell: 'bash' | ||
run: | | ||
cd remill | ||
mkdir build && cd build | ||
cmake -G Ninja \ | ||
-DCMAKE_VERBOSE_MAKEFILE=ON \ | ||
-DVCPKG_ROOT="${VCPKG_ROOT}" \ | ||
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" \ | ||
.. | ||
cmake --build . | ||
cmake --build . --target install | ||
cmake --build . --target test_dependencies | ||
env CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --target test || true | ||
# Only for LLVM-10 right now... | ||
- name: 'Anvill build - vcpkg remill' | ||
if: ${{ matrix.llvm == 'llvm-10' }} | ||
shell: 'bash' | ||
run: | | ||
cd anvill | ||
mkdir build-vcpkg && cd build-vcpkg | ||
cmake -G Ninja \ | ||
-DCMAKE_VERBOSE_MAKEFILE=ON \ | ||
-DVCPKG_ROOT="${VCPKG_ROOT}" \ | ||
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" \ | ||
.. | ||
cmake --build . | ||
cmake --build . --target install | ||
./anvill-decompile-json-* -spec ../examples/ret0.json -bc_out ./ret0.bc -ir_out ret0.ir | ||
- name: 'Anvill build - custom remill' | ||
shell: 'bash' | ||
run: | | ||
cd anvill | ||
mkdir build && cd build | ||
cmake -G Ninja \ | ||
-DCMAKE_VERBOSE_MAKEFILE=ON \ | ||
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" \ | ||
-Dremill_DIR="$(pwd)/../../remill/build/install/lib/cmake/remill" \ | ||
.. | ||
cmake --build . | ||
cmake --build . --target install | ||
./anvill-decompile-json-* -spec ../examples/ret0.json -bc_out ./ret0.bc -ir_out ret0.ir | ||
- name: 'Test mcsema build' | ||
if: ${{ matrix.llvm != 'llvm-11' }} | ||
shell: 'bash' | ||
run: | | ||
cd mcsema | ||
mkdir build && cd build | ||
cmake -G Ninja \ | ||
-DCMAKE_VERBOSE_MAKEFILE=ON \ | ||
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" \ | ||
-Dremill_DIR="$(pwd)/../../remill/build/install/lib/cmake/remill" \ | ||
-Danvill_DIR="$(pwd)/../../anvill/build/install/lib/cmake/anvill" \ | ||
.. | ||
cmake --build . | ||
cmake --build . --target install | ||
- name: Publish Release Assets | ||
if: | | ||
github.event.release | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ env.ARTIFACT_NAME }} | ||
asset_name: ${{ env.ARTIFACT_NAME }} | ||
asset_content_type: application/x-xz | ||
|
||
- name: Cache cleanup and reporting | ||
shell: 'bash' | ||
run: | | ||
rm -rf ${VCPKG_ROOT}/{buildtrees,installed,packages} | ||
ccache --show-stats |
Oops, something went wrong.