Get downcasts from &dyn Any working #3440
Workflow file for this run
This file contains hidden or 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
| name: crux-llvm | |
| on: | |
| push: | |
| tags: ["crux-v?[0-9]+.[0-9]+(.[0-9]+)?"] | |
| branches: [master, "release-**"] | |
| pull_request: | |
| schedule: | |
| - cron: "0 10 * * *" # 10am UTC -> 2/3am PST | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: bash | |
| # The CACHE_VERSION can be updated to force the use of a new cache if | |
| # the current cache contents become corrupted/invalid. This can | |
| # sometimes happen when (for example) the OS version is changed but | |
| # older .so files are cached, which can have various effects | |
| # (e.g. cabal complains it can't find a valid version of the "happy" | |
| # tool). | |
| # | |
| # This also periodically happens on MacOS builds due to a tar bug | |
| # (symptom: "No suitable image found ... unknown file type, first | |
| # eight bytes: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00") | |
| env: | |
| CACHE_VERSION: 1 | |
| jobs: | |
| config: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| name: ${{ steps.config.outputs.name }} | |
| crux-llvm-version: ${{ steps.config.outputs.crux-llvm-version }} | |
| event-tag: ${{ steps.config.outputs.tag }} | |
| event-schedule: ${{ steps.config.outputs.schedule }} | |
| publish: ${{ steps.config.outputs.publish }} | |
| release: ${{ steps.config.outputs.release }} | |
| retention-days: ${{ steps.config.outputs.retention-days }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: config | |
| id: config | |
| env: | |
| EVENT_TAG: ${{ startsWith(github.event.ref, 'refs/tags/') }} | |
| EVENT_SCHEDULE: ${{ github.event_name == 'schedule' }} | |
| EVENT_DISPATCH: ${{ github.event_name == 'workflow_dispatch' }} | |
| RELEASE: ${{ startsWith(github.event.ref, 'refs/heads/release-crux-') }} | |
| run: | | |
| set -x | |
| .github/ci.sh output name crux-llvm-$(.github/ci.sh crux_llvm_ver) | |
| .github/ci.sh output crux-llvm-version $(.github/ci.sh crux_llvm_ver) | |
| .github/ci.sh output tag $EVENT_TAG | |
| .github/ci.sh output schedule $EVENT_SCHEDULE | |
| .github/ci.sh output publish $({ $EVENT_TAG || $EVENT_SCHEDULE; } && echo true || echo false) | |
| .github/ci.sh output release $([[ "refs/heads/release-crux-$(.github/ci.sh crux_llvm_ver)" == "${{ github.event.ref }}" ]] && echo true || echo false) | |
| .github/ci.sh output retention-days $($RELEASE && echo 90 || echo 5) | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| needs: [config] | |
| env: | |
| CI_TEST_LEVEL: "1" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-24.04] | |
| cabal: ["3.14.2.0"] | |
| ghc: ["9.6.7", "9.8.4", "9.10.1"] | |
| include: | |
| - os: ubuntu-22.04 | |
| cabal: 3.14.2.0 | |
| ghc: 9.10.1 | |
| - os: macos-14 | |
| cabal: 3.14.2.0 | |
| ghc: 9.10.1 | |
| - os: windows-2022 | |
| cabal: 3.14.2.0 | |
| ghc: 9.10.1 | |
| name: crux-llvm - GHC v${{ matrix.ghc }} - ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - uses: haskell-actions/setup@v2 | |
| id: setup-haskell | |
| with: | |
| ghc-version: ${{ matrix.ghc }} | |
| cabal-version: ${{ matrix.cabal }} | |
| - name: Post-GHC installation fixups on Windows | |
| if: runner.os == 'Windows' | |
| run: | | |
| # A workaround for https://github.com/Mistuke/CabalChoco/issues/5 | |
| cabal user-config update -a "extra-include-dirs: \"\"" | |
| cabal user-config update -a "extra-lib-dirs: \"\"" | |
| - uses: actions/cache/restore@v4 | |
| name: Restore cabal store cache | |
| id: cache | |
| env: | |
| key: ${{ env.CACHE_VERSION }}-crux-llvm-${{ matrix.os }}-cabal${{ steps.setup-haskell.outputs.cabal-version }}-ghc${{ steps.setup-haskell.outputs.ghc-version }} | |
| with: | |
| path: | | |
| ${{ steps.setup-haskell.outputs.cabal-store }} | |
| dist-newstyle | |
| key: ${{ env.key }}-${{ hashFiles(format('cabal.GHC-{0}.config', matrix.ghc)) }}-${{ github.ref }} | |
| restore-keys: | | |
| ${{ env.key }}-${{ hashFiles(format('cabal.GHC-{0}.config', matrix.ghc)) }}- | |
| ${{ env.key }}- | |
| - run: .github/ci.sh install_system_deps | |
| env: | |
| SOLVER_PKG_VERSION: "snapshot-20250606" | |
| BUILD_TARGET_OS: ${{ matrix.os }} | |
| BUILD_TARGET_ARCH: ${{ runner.arch }} | |
| - run: .github/ci.sh configure | |
| - name: Generate source distributions | |
| run: cabal sdist crucible-symio crux-llvm crucible-{cli,debug} crucible-llvm{,-cli,-debug,-syntax} | |
| - run: > | |
| cabal build | |
| crucible | |
| crucible-cli | |
| crucible-debug | |
| crucible-llvm | |
| crucible-llvm-cli | |
| crucible-llvm-debug | |
| crucible-llvm-syntax | |
| crucible-syntax | |
| crux-llvm | |
| - name: Haddock | |
| # Note [--disable-documentation] | |
| # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| # | |
| # Build the Haddocks to ensure that they are well formed. Somewhat | |
| # counterintuitively, we run this with the --disable-documentation flag. | |
| # This does not mean "do not build the Haddocks", but rather, "build the | |
| # Haddocks for the top-level library, but do not build dependencies with | |
| # Haddocks". The upshot is that we do not change the build configuration | |
| # for any dependencies, which means that we don't have to rebuild them. | |
| # The downside is that the rendered Haddocks won't contain any links to | |
| # identifiers from library dependencies. Since we are only building | |
| # Haddocks to ensure well-formedness, we consider this an acceptable | |
| # tradeoff. | |
| run: cabal haddock --disable-documentation crucible-debug crucible-symio crucible-llvm{,-debug,-syntax} crux-llvm | |
| - name: Test crucible | |
| run: .github/ci.sh test crucible | |
| - name: Test crucible-cli | |
| run: .github/ci.sh test crucible-cli | |
| - name: Test crucible-debug | |
| run: cd crucible-debug && ../.github/ci.sh test pkg:crucible-debug | |
| # NOTE(lb): Not sure what's going on with these tests... and I don't | |
| # have a Windows machine to debug. | |
| if: runner.os != 'Windows' | |
| - name: Test crucible-symio | |
| run: cabal test pkg:crucible-symio | |
| if: runner.os == 'Linux' | |
| - name: Test crucible-llvm | |
| run: .github/ci.sh test crucible-llvm | |
| if: runner.os == 'Linux' || runner.os == 'macOS' | |
| - name: Test crucible-llvm-syntax | |
| run: .github/ci.sh test crucible-llvm-syntax | |
| if: runner.os == 'Linux' | |
| - name: Test crucible-llvm-cli | |
| run: .github/ci.sh test crucible-llvm-cli | |
| if: runner.os == 'Linux' | |
| - name: Test crux-llvm | |
| run: .github/ci.sh test crux-llvm | |
| if: runner.os == 'Linux' || runner.os == 'macOS' | |
| - uses: actions/cache/save@v4 | |
| name: Save cabal store cache | |
| if: always() | |
| with: | |
| path: | | |
| ${{ steps.setup-haskell.outputs.cabal-store }} | |
| dist-newstyle | |
| key: ${{ steps.cache.outputs.cache-primary-key }} | |
| # We support older Cabal versions so that users can build the project even | |
| # if they lack access to the latest Cabal package, e.g., when using the | |
| # version provided by their OS package manager on older systems. | |
| # | |
| # Rather than running the whole CI workflow with multiple Cabal versions | |
| # (e.g., in the `matrix`), we run the equivalent of `cabal clean`, but | |
| # using the version of the Cabal library that is bundled with GHC. This is | |
| # sufficient to check that the bundled version of Cabal can parse the Cabal | |
| # configuration files (`.cabal`, `cabal.project{,freeze}`). This guarantees | |
| # that our package can be built with the versions of Cabal that are likely to | |
| # be available alongside the supported versions of GHC. | |
| # | |
| # We run this after `actions/cache/save` since it deletes most of | |
| # `dist-newstyle`. | |
| - name: Check Cabal/GHC compatibility | |
| run: | | |
| for dir in crucible{,-cli,-debug,-llvm,-llvm-cli,-llvm-debug,-llvm-syntax} crux{,-llvm}; do | |
| cd "${GITHUB_WORKSPACE}/${dir}" | |
| echo 'import Distribution.Simple; main = defaultMain' > Setup.hs | |
| runhaskell Setup.hs clean | |
| done | |
| - name: Create binary artifact | |
| run: | | |
| NAME="crux-llvm-${{ needs.config.outputs.crux-llvm-version }}-${{ matrix.os }}-${{ runner.arch }}" | |
| echo "NAME=$NAME" >> $GITHUB_ENV | |
| .github/ci.sh bundle_crux_llvm_files | |
| if: github.event.pull_request.head.repo.fork == false && github.repository_owner == 'GaloisInc' | |
| env: | |
| OS_TAG: ${{ matrix.os }} | |
| ARCH_TAG: ${{ runner.arch }} | |
| VERSION: ${{ needs.config.outputs.crux-llvm-version }} | |
| - name: Sign binary artifact | |
| # The SIGNING_PASSPHRASE and SIGNING_KEY secrets are only available on | |
| # jobs run from the main repo, and as a result, they won't work when | |
| # run from a fork. Signing binaries isn't essential to the rest of the | |
| # workflow, so it is safe to skip this step on forks. Note that it | |
| # isn't sufficient to test the pull request info because this job is | |
| # also scheduled. See notes in README.md. | |
| if: github.event.pull_request.head.repo.fork == false && github.repository_owner == 'GaloisInc' | |
| env: | |
| SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }} | |
| SIGNING_KEY: ${{ secrets.SIGNING_KEY }} | |
| run: | | |
| .github/ci.sh sign "${NAME}.tar.gz" | |
| - uses: actions/upload-artifact@v4 | |
| if: github.event.pull_request.head.repo.fork == false && github.repository_owner == 'GaloisInc' | |
| with: | |
| path: crux-llvm-*.tar.gz* | |
| name: crux-llvm-${{ matrix.os }}-${{ runner.arch }}-${{ matrix.ghc }} | |
| build-push-image: | |
| runs-on: ubuntu-24.04 | |
| needs: [config] | |
| if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || needs.config.outputs.release == 'true') && github.repository_owner == 'GaloisInc' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - file: .github/Dockerfile-crux-llvm | |
| image: ghcr.io/galoisinc/crux-llvm | |
| cache: ghcr.io/galoisinc/cache-crux-llvm | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Generate crux.buildinfo.json | |
| shell: bash | |
| run: .github/ci.sh generate_buildinfo "${{ github.sha }}" "${{ github.ref_name }}" | |
| - uses: rlespinasse/[email protected] | |
| - id: common-tag | |
| run: | | |
| echo "::set-output name=common-tag::$GITHUB_REF_SLUG" | |
| echo "COMMON_TAG=$GITHUB_REF_SLUG" >> $GITHUB_ENV | |
| - uses: docker/setup-buildx-action@v1 | |
| - uses: crazy-max/ghaction-docker-meta@v1 | |
| name: Labels | |
| id: labels | |
| with: | |
| images: ${{ matrix.image }} | |
| - uses: docker/login-action@v1 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| tags: ${{ matrix.image }}:${{ steps.common-tag.outputs.common-tag }} | |
| labels: ${{ steps.labels.outputs.labels }} | |
| load: true | |
| push: false | |
| file: ${{ matrix.file }} | |
| build-args: ${{ matrix.build-args }} | |
| cache-from: | | |
| type=registry,ref=${{ matrix.cache }}:${{ steps.prefix.outputs.prefix }}master | |
| type=registry,ref=${{ matrix.cache }}:${{ steps.common-tag.outputs.common-tag }} | |
| - name: Cache image build | |
| uses: docker/build-push-action@v2 | |
| continue-on-error: true # Tolerate cache upload failures - this should be handled better | |
| with: | |
| context: . | |
| file: ${{ matrix.file }} | |
| build-args: ${{ matrix.build-args }} | |
| cache-to: type=registry,ref=${{ matrix.cache }}:${{ steps.common-tag.outputs.common-tag }},mode=max | |
| - if: needs.config.outputs.event-schedule == 'true' | |
| name: ${{ matrix.image }}:nightly | |
| run: | | |
| docker tag ${{ matrix.image }}:$COMMON_TAG ${{ matrix.image }}:nightly | |
| docker push ${{ matrix.image }}:nightly | |
| - if: needs.config.outputs.release == 'true' | |
| name: ${{ matrix.image }}:${{ needs.config.outputs.crux-llvm-version }} | |
| run: | | |
| docker tag ${{ matrix.image }}:$COMMON_TAG ${{ matrix.image }}:${{ needs.config.outputs.crux-llvm-version }} | |
| docker push ${{ matrix.image }}:${{ needs.config.outputs.crux-llvm-version }} | |
| docker tag ${{ matrix.image }}:$COMMON_TAG ${{ matrix.image }}:latest | |
| docker push ${{ matrix.image }}:latest |