From 0c6125a39dd7922deef37a2b7b4abf61f15aa416 Mon Sep 17 00:00:00 2001 From: Jared Weakly Date: Mon, 18 Jan 2021 15:14:12 -0800 Subject: [PATCH 1/9] Pin the version of llvm --- .github/workflows/crux-llvm-build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/crux-llvm-build.yml b/.github/workflows/crux-llvm-build.yml index 8dff425a9..77936ea64 100644 --- a/.github/workflows/crux-llvm-build.yml +++ b/.github/workflows/crux-llvm-build.yml @@ -42,6 +42,11 @@ jobs: with: submodules: true + - name: Install LLVM and Clang + uses: KyleMayes/install-llvm-action@v1 + with: + version: "9" + - uses: actions/setup-haskell@v1 id: setup-haskell with: From 161a7ec3c3ba3028e19653537cdbf5512f92abec Mon Sep 17 00:00:00 2001 From: Jared Weakly Date: Mon, 18 Jan 2021 15:15:48 -0800 Subject: [PATCH 2/9] Clean up crux llvm workflow --- .github/ci.sh | 4 ++-- .github/workflows/crux-llvm-build.yml | 22 +++++----------------- .github/workflows/crux-mir-build.yml | 2 +- .gitignore | 1 + 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/ci.sh b/.github/ci.sh index 788972a66..3b8bcd653 100755 --- a/.github/ci.sh +++ b/.github/ci.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -Eeuxo pipefail -DATE=`date "+%Y-%m-%d"` +DATE=$(date "+%Y-%m-%d") [[ "$RUNNER_OS" == 'Windows' ]] && IS_WIN=true || IS_WIN=false BIN=bin EXT="" @@ -166,7 +166,7 @@ zip_dist() { bundle_crux_llvm_files() { setup_dist extract_exe crux-llvm dist/bin - if ! $IS_WIN ; then + if ! $IS_WIN; then extract_exe crux-llvm-svcomp dist/bin fi cp crux-llvm/README.md dist/doc diff --git a/.github/workflows/crux-llvm-build.yml b/.github/workflows/crux-llvm-build.yml index 77936ea64..8802fc5d5 100644 --- a/.github/workflows/crux-llvm-build.yml +++ b/.github/workflows/crux-llvm-build.yml @@ -6,24 +6,8 @@ on: workflow_dispatch: jobs: - outputs: - runs-on: ubuntu-latest - outputs: - changed: ${{ steps.outputs.outputs.changed-files }} - name: ${{ steps.outputs.outputs.name }} - crux-llvm-version: ${{ steps.outputs.outputs.crux-llvm-version }} - release: ${{ steps.env.outputs.release }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - id: outputs - run: | - .github/ci.sh set_crux_llvm_version - build: runs-on: ${{ matrix.os }} - needs: [outputs] strategy: fail-fast: false matrix: @@ -42,6 +26,10 @@ jobs: with: submodules: true + - name: Set version + run: .github/ci.sh set_crux_llvm_version + id: version + - name: Install LLVM and Clang uses: KyleMayes/install-llvm-action@v1 with: @@ -107,7 +95,7 @@ jobs: env: SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} SIGNING_KEY: ${{ secrets.SIGNING_KEY }} - VERSION: ${{ needs.outputs.outputs.crux-llvm-version }} + VERSION: ${{ steps.version.outputs.crux-llvm-version }} - uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/crux-mir-build.yml b/.github/workflows/crux-mir-build.yml index 9f758980a..0c4a25f7d 100644 --- a/.github/workflows/crux-mir-build.yml +++ b/.github/workflows/crux-mir-build.yml @@ -73,7 +73,7 @@ jobs: YICES_VERSION: "2.6.2" - shell: bash - run: cd dependencies/mir-json && cargo install --locked --force + run: cd dependencies/mir-json && cargo install --locked --force --path . - shell: bash run: .github/ci.sh configure diff --git a/.gitignore b/.gitignore index 35dbd7cf4..264046185 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ cabal.project.local *.tix .ghc.environment.* *~ +cabal.project.freeze From f31cd7a7dc33b1774496a554cbbb461582a83f15 Mon Sep 17 00:00:00 2001 From: Jared Weakly Date: Mon, 18 Jan 2021 15:20:21 -0800 Subject: [PATCH 3/9] Clean up crux mir workflow --- .github/workflows/crux-mir-build.yml | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/crux-mir-build.yml b/.github/workflows/crux-mir-build.yml index 0c4a25f7d..bf5e3fd72 100644 --- a/.github/workflows/crux-mir-build.yml +++ b/.github/workflows/crux-mir-build.yml @@ -6,24 +6,8 @@ on: workflow_dispatch: jobs: - outputs: - runs-on: ubuntu-latest - outputs: - changed: ${{ steps.outputs.outputs.changed-files }} - name: ${{ steps.outputs.outputs.name }} - crux-mir-version: ${{ steps.outputs.outputs.crux-mir-version }} - release: ${{ steps.env.outputs.release }} - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - id: outputs - run: | - .github/ci.sh set_crux_mir_version - build: runs-on: ${{ matrix.os }} - needs: [outputs] strategy: fail-fast: false matrix: @@ -44,6 +28,10 @@ jobs: with: submodules: true + - name: Set version + run: .github/ci.sh set_crux_mir_version + id: version + - uses: actions/setup-haskell@v1 id: setup-haskell with: @@ -92,7 +80,7 @@ jobs: env: SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} SIGNING_KEY: ${{ secrets.SIGNING_KEY }} - VERSION: ${{ needs.outputs.outputs.crux-mir-version }} + VERSION: ${{ steps.version.outputs.crux-mir-version }} - uses: actions/upload-artifact@v2 with: From 1c535b3a2d3099b68b0dfb35c7d9fa9e4c749821 Mon Sep 17 00:00:00 2001 From: Jared Weakly Date: Mon, 18 Jan 2021 15:30:59 -0800 Subject: [PATCH 4/9] Cache rust dependencies in crux-mir-build --- .github/workflows/crux-mir-build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/crux-mir-build.yml b/.github/workflows/crux-mir-build.yml index bf5e3fd72..0528df6a3 100644 --- a/.github/workflows/crux-mir-build.yml +++ b/.github/workflows/crux-mir-build.yml @@ -60,8 +60,13 @@ jobs: Z3_VERSION: "4.8.8" YICES_VERSION: "2.6.2" + - uses: Swatinem/rust-cache@v1 + with: + working-directory: dependencies/mir-json + - shell: bash - run: cd dependencies/mir-json && cargo install --locked --force --path . + run: cargo install --locked --force --path . + working-directory: dependencies/mir-json - shell: bash run: .github/ci.sh configure @@ -70,7 +75,8 @@ jobs: run: .github/ci.sh build exe:crux-mir - shell: bash - run: cd crux-mir && bash ./translate_libs.sh + run: ./translate_libs.sh + working-directory: crux-mir - shell: bash run: .github/ci.sh test crux-mir From cef3d218440a0ca9aecc3b4619cb96346fd81785 Mon Sep 17 00:00:00 2001 From: Jared Weakly Date: Mon, 18 Jan 2021 15:38:16 -0800 Subject: [PATCH 5/9] Fix usage of llvm action --- .github/workflows/crux-llvm-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/crux-llvm-build.yml b/.github/workflows/crux-llvm-build.yml index 8802fc5d5..864fadbc9 100644 --- a/.github/workflows/crux-llvm-build.yml +++ b/.github/workflows/crux-llvm-build.yml @@ -34,6 +34,7 @@ jobs: uses: KyleMayes/install-llvm-action@v1 with: version: "9" + directory: ${{ runner.temp }}/llvm - uses: actions/setup-haskell@v1 id: setup-haskell From cd946a378465c7fa38f47444693a440769157428 Mon Sep 17 00:00:00 2001 From: Jared Weakly Date: Mon, 18 Jan 2021 16:07:28 -0800 Subject: [PATCH 6/9] Don't override llvm path that's now set correctly --- .github/ci.sh | 16 ---------------- .github/workflows/crux-llvm-build.yml | 25 ++++--------------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/.github/ci.sh b/.github/ci.sh index 3b8bcd653..834dbc3cf 100755 --- a/.github/ci.sh +++ b/.github/ci.sh @@ -112,29 +112,13 @@ build() { } test() { - # System-agnostic path - export PATH="$PATH:/usr/local/opt/llvm/bin:/c/Program Files/LLVM/bin" cabal v2-test "$@" } -install_llvm() { - if [[ "$RUNNER_OS" = "Linux" ]]; then - sudo apt-get update -q && sudo apt-get install -y clang-10 llvm-10-tools - elif [[ "$RUNNER_OS" = "macOS" ]]; then - brew install llvm@10 - elif [[ "$RUNNER_OS" = "Windows" ]]; then - choco install llvm - else - echo "Unknown platform!" - return 1 - fi -} - install_system_deps() { install_z3 & # install_cvc4 & install_yices & - install_llvm & wait export PATH=$PWD/$BIN:$PATH echo "$PWD/$BIN" >> $GITHUB_PATH diff --git a/.github/workflows/crux-llvm-build.yml b/.github/workflows/crux-llvm-build.yml index 864fadbc9..3dca5af94 100644 --- a/.github/workflows/crux-llvm-build.yml +++ b/.github/workflows/crux-llvm-build.yml @@ -33,7 +33,7 @@ jobs: - name: Install LLVM and Clang uses: KyleMayes/install-llvm-action@v1 with: - version: "9" + version: "10" directory: ${{ runner.temp }}/llvm - uses: actions/setup-haskell@v1 @@ -64,28 +64,11 @@ jobs: run: .github/ci.sh build exe:crux-llvm - shell: bash - name: Test (Linux) + name: Test run: .github/ci.sh test crux-llvm - if: runner.os == 'Linux' env: - LLVM_LINK: "llvm-link-10" - CLANG: "clang-10" - - - shell: bash - name: Test (macOS) - run: .github/ci.sh test crux-llvm - if: runner.os == 'macOS' - env: - LLVM_LINK: "/usr/local/opt/llvm/bin/llvm-link" - CLANG: "/usr/local/opt/llvm/bin/clang" - - - shell: bash - name: Test (Windows) - run: .github/ci.sh test crux-llvm - if: runner.os == 'Windows' - env: - LLVM_LINK: "/c/Program Files/LLVM/bin/llvm-link" - CLANG: "/c/Program Files/LLVM/bin/clang" + LLVM_LINK: llvm-link + CLANG: clang - shell: bash run: .github/ci.sh build exe:crux-llvm-svcomp From 5a124f44cec186414d1084137768930730007e33 Mon Sep 17 00:00:00 2001 From: Jared Weakly Date: Mon, 18 Jan 2021 16:57:19 -0800 Subject: [PATCH 7/9] use LIBCLANG_PATH --- .github/workflows/crux-llvm-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/crux-llvm-build.yml b/.github/workflows/crux-llvm-build.yml index 3dca5af94..f4db96b15 100644 --- a/.github/workflows/crux-llvm-build.yml +++ b/.github/workflows/crux-llvm-build.yml @@ -68,6 +68,7 @@ jobs: run: .github/ci.sh test crux-llvm env: LLVM_LINK: llvm-link + LIBCLANG_PATH: ${{ runner.temp }}/llvm/lib CLANG: clang - shell: bash From a0932e65debfa905bb75b501fa91eb59c1666f84 Mon Sep 17 00:00:00 2001 From: Lisanna Dettwyler Date: Thu, 28 Jan 2021 13:11:55 -0800 Subject: [PATCH 8/9] debug --- .github/workflows/crux-llvm-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/crux-llvm-build.yml b/.github/workflows/crux-llvm-build.yml index f4db96b15..4e0a98a7f 100644 --- a/.github/workflows/crux-llvm-build.yml +++ b/.github/workflows/crux-llvm-build.yml @@ -36,6 +36,9 @@ jobs: version: "10" directory: ${{ runner.temp }}/llvm + - uses: mxschmitt/action-tmate@v3 + if: runner.os == 'macOS' && matrix.ghc == '8.6.5' + - uses: actions/setup-haskell@v1 id: setup-haskell with: From 4aea84804997f5be711308aa2642ad09f664f82b Mon Sep 17 00:00:00 2001 From: Lisanna Dettwyler Date: Thu, 28 Jan 2021 13:55:54 -0800 Subject: [PATCH 9/9] try explicitly setting CLANG path, system version is used otherwise --- .github/workflows/crux-llvm-build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/crux-llvm-build.yml b/.github/workflows/crux-llvm-build.yml index 4e0a98a7f..59871b42f 100644 --- a/.github/workflows/crux-llvm-build.yml +++ b/.github/workflows/crux-llvm-build.yml @@ -36,9 +36,6 @@ jobs: version: "10" directory: ${{ runner.temp }}/llvm - - uses: mxschmitt/action-tmate@v3 - if: runner.os == 'macOS' && matrix.ghc == '8.6.5' - - uses: actions/setup-haskell@v1 id: setup-haskell with: @@ -70,9 +67,12 @@ jobs: name: Test run: .github/ci.sh test crux-llvm env: - LLVM_LINK: llvm-link + LLVM_LINK: ${{ runner.temp }}/llvm/bin/llvm-link LIBCLANG_PATH: ${{ runner.temp }}/llvm/lib - CLANG: clang + CLANG: ${{ runner.temp }}/llvm/bin/clang + + - uses: mxschmitt/action-tmate@v3 + if: runner.os == 'macOS' && matrix.ghc == '8.6.5' - shell: bash run: .github/ci.sh build exe:crux-llvm-svcomp