Skip to content

Commit

Permalink
Initial import of ekilmer/vcpkg-lifting-ports with some link fixups
Browse files Browse the repository at this point in the history
  • Loading branch information
ekilmer committed Dec 8, 2020
1 parent b965e28 commit c23deac
Show file tree
Hide file tree
Showing 60 changed files with 3,889 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
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"
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
name: CI CD
name: Old CI CD

on:
push:
branches:
- master
paths:
- 'old/**'
pull_request:
paths:
- 'old/**'

jobs:
Docker_Linux:
Expand Down Expand Up @@ -101,6 +105,7 @@ jobs:
with:
name: libraries-catalina-macos.tar.xz
path: ./old/libraries-catalina-macos.tar.xz

CreateRelease:
needs: [macOS, Docker_Linux]
runs-on: ubuntu-latest
Expand Down
233 changes: 233 additions & 0 deletions .github/workflows/vcpkg_ci_linux.yml
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
Loading

0 comments on commit c23deac

Please sign in to comment.