diff --git a/.github/workflows/kani.yml b/.github/workflows/kani.yml index 5d4b5b9a4e0d..ad2fe757dc17 100644 --- a/.github/workflows/kani.yml +++ b/.github/workflows/kani.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-13, ubuntu-20.04, ubuntu-22.04, macos-14] + os: [macos-13, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04, macos-14] steps: - name: Checkout Kani uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f31df70b3c65..4ff5fa69ea23 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -97,7 +97,7 @@ jobs: needs: [build_bundle_macos, build_bundle_linux] strategy: matrix: - os: [macos-13, ubuntu-20.04, ubuntu-22.04] + os: [macos-13, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] include: - os: macos-13 rust_target: x86_64-apple-darwin @@ -108,6 +108,9 @@ jobs: - os: ubuntu-22.04 rust_target: x86_64-unknown-linux-gnu prev_job: ${{ needs.build_bundle_linux.outputs }} + - os: ubuntu-24.04 + rust_target: x86_64-unknown-linux-gnu + prev_job: ${{ needs.build_bundle_linux.outputs }} runs-on: ${{ matrix.os }} steps: - name: Download bundle @@ -197,7 +200,7 @@ jobs: needs: [build_bundle_macos, build_bundle_linux] strategy: matrix: - os: [macos-13, ubuntu-20.04, ubuntu-22.04] + os: [macos-13, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04] include: # Stores the output of the previous job conditional to the OS - prev_job: ${{ needs.build_bundle_linux.outputs }} diff --git a/docs/src/build-from-source.md b/docs/src/build-from-source.md index 253fcf351073..e0982bf2899b 100644 --- a/docs/src/build-from-source.md +++ b/docs/src/build-from-source.md @@ -18,7 +18,7 @@ Kani has been tested in [Ubuntu](#install-dependencies-on-ubuntu) and [macOS](## ### Install dependencies on Ubuntu -Support is available for Ubuntu 18.04, 20.04 and 22.04. +Support is available for Ubuntu 20.04, 22.04, and 24.04. The simplest way to install dependencies (especially if you're using a fresh VM) is following our CI scripts: diff --git a/scripts/ci/Dockerfile.bundle-release-20-04 b/scripts/ci/Dockerfile.bundle-release-20-04 index 33baaaf04b1e..7a8b7f21b74b 100644 --- a/scripts/ci/Dockerfile.bundle-release-20-04 +++ b/scripts/ci/Dockerfile.bundle-release-20-04 @@ -17,7 +17,7 @@ COPY ./target/package/kani-verifier-*[^e] ./kani-verifier # directory. Rustup is purged for space. RUN apt-get update && \ - apt-get install -y python3 python3-pip curl ctags && \ + apt-get install -y curl && \ curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain none && \ (cd kani-verifier/; cargo) && \ rustup default $(rustup toolchain list | awk '{ print $1 }') && \ diff --git a/scripts/ci/Dockerfile.bundle-test-al2 b/scripts/ci/Dockerfile.bundle-test-al2 index ffd8244355ee..4e18f2165e90 100644 --- a/scripts/ci/Dockerfile.bundle-test-al2 +++ b/scripts/ci/Dockerfile.bundle-test-al2 @@ -4,7 +4,7 @@ # Note: this file is intended only for testing the kani release bundle FROM amazonlinux:2 -RUN yum install -y gcc python3 python3-pip curl ctags tar gzip && \ +RUN yum install -y gcc curl tar gzip && \ curl -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" diff --git a/scripts/ci/Dockerfile.bundle-test-nixos b/scripts/ci/Dockerfile.bundle-test-nixos index 90b4ec721da7..2bbeb8ceee18 100644 --- a/scripts/ci/Dockerfile.bundle-test-nixos +++ b/scripts/ci/Dockerfile.bundle-test-nixos @@ -10,12 +10,9 @@ RUN echo $' \n\ with import {}; \n\ mkShell { \n\ packages = [ \n\ - ctags \n\ curl \n\ gcc \n\ patchelf \n\ - python310 \n\ - python310Packages.pip \n\ rustup \n\ ]; \n\ }' >> ./default.nix diff --git a/scripts/ci/Dockerfile.bundle-test-ubuntu-20-04 b/scripts/ci/Dockerfile.bundle-test-ubuntu-20-04 index 0335d8a5036d..44084606f98d 100644 --- a/scripts/ci/Dockerfile.bundle-test-ubuntu-20-04 +++ b/scripts/ci/Dockerfile.bundle-test-ubuntu-20-04 @@ -7,7 +7,7 @@ FROM ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive \ DEBCONF_NONINTERACTIVE_SEEN=true RUN apt-get update && \ - apt-get install -y python3 python3-pip curl ctags && \ + apt-get install -y curl && \ curl -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" diff --git a/scripts/ci/Dockerfile.bundle-test-ubuntu-20-04-alt b/scripts/ci/Dockerfile.bundle-test-ubuntu-20-04-alt index 53a7ab5f7667..ebba8e3a178b 100644 --- a/scripts/ci/Dockerfile.bundle-test-ubuntu-20-04-alt +++ b/scripts/ci/Dockerfile.bundle-test-ubuntu-20-04-alt @@ -9,7 +9,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ DEBCONF_NONINTERACTIVE_SEEN=true \ KANI_HOME="/tmp" RUN apt-get update && \ - apt-get install -y python3 python3-pip curl ctags && \ + apt-get install -y curl && \ curl -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" diff --git a/scripts/ci/Dockerfile.bundle-test-ubuntu-22-04 b/scripts/ci/Dockerfile.bundle-test-ubuntu-22-04 index 6f10fc394495..f53c11cf7fcb 100644 --- a/scripts/ci/Dockerfile.bundle-test-ubuntu-22-04 +++ b/scripts/ci/Dockerfile.bundle-test-ubuntu-22-04 @@ -7,7 +7,7 @@ FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive \ DEBCONF_NONINTERACTIVE_SEEN=true RUN apt-get update && \ - apt-get install -y python3 python3-pip curl universal-ctags && \ + apt-get install -y curl && \ curl -sSf https://sh.rustup.rs | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" diff --git a/scripts/ci/Dockerfile.bundle-test-ubuntu-24-04 b/scripts/ci/Dockerfile.bundle-test-ubuntu-24-04 new file mode 100644 index 000000000000..db4e8b88640d --- /dev/null +++ b/scripts/ci/Dockerfile.bundle-test-ubuntu-24-04 @@ -0,0 +1,20 @@ +# Copyright Kani Contributors +# SPDX-License-Identifier: Apache-2.0 OR MIT + +# Note: this file is intended only for testing the kani release bundle + +FROM ubuntu:24.04 +ENV DEBIAN_FRONTEND=noninteractive \ + DEBCONF_NONINTERACTIVE_SEEN=true +RUN apt-get update && \ + apt-get install -y curl && \ + curl -sSf https://sh.rustup.rs | sh -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + +WORKDIR /tmp/kani +COPY ./tests ./tests +COPY ./kani-latest-x86_64-unknown-linux-gnu.tar.gz ./ +# Very awkward glob (not regex!) to get `kani-verifier-*` and not `kani-verifier-*.crate` +COPY ./target/package/kani-verifier-*[^e] ./kani-verifier +RUN cargo install --path ./kani-verifier +RUN cargo-kani setup --use-local-bundle ./kani-latest-x86_64-unknown-linux-gnu.tar.gz diff --git a/scripts/setup/al2/install_deps.sh b/scripts/setup/al2/install_deps.sh index 648715e9b055..0fab43044b9c 100755 --- a/scripts/setup/al2/install_deps.sh +++ b/scripts/setup/al2/install_deps.sh @@ -14,7 +14,6 @@ DEPS=( gcc10-c++ git openssl-devel - python3-pip wget ) @@ -24,9 +23,6 @@ sudo yum -y update sudo yum -y groupinstall "Development Tools" sudo yum -y install "${DEPS[@]}" -# Add Python package dependencies -python3 -m pip install autopep8 - # Get the directory containing this script SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" diff --git a/scripts/setup/macos/install_deps.sh b/scripts/setup/macos/install_deps.sh index 112e34680b11..e7f26b05f2a7 100755 --- a/scripts/setup/macos/install_deps.sh +++ b/scripts/setup/macos/install_deps.sh @@ -14,9 +14,6 @@ brew update brew install python@3 || true brew link --overwrite python@3 -# Install dependencies via `brew` -brew install universal-ctags wget jq - # Get the directory containing this script SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" diff --git a/scripts/setup/ubuntu-18.04 b/scripts/setup/ubuntu-24.04 similarity index 100% rename from scripts/setup/ubuntu-18.04 rename to scripts/setup/ubuntu-24.04 diff --git a/scripts/setup/ubuntu/install_cbmc.sh b/scripts/setup/ubuntu/install_cbmc.sh index 31015ab9de7a..5037a545dc31 100755 --- a/scripts/setup/ubuntu/install_cbmc.sh +++ b/scripts/setup/ubuntu/install_cbmc.sh @@ -15,7 +15,7 @@ fi UBUNTU_VERSION=$(lsb_release -rs) MAJOR=${UBUNTU_VERSION%.*} -if [[ "${MAJOR}" -gt "18" ]] && [[ $(dpkg --print-architecture) = "amd64" ]] +if [[ "${MAJOR}" -ge "20" ]] && [[ $(dpkg --print-architecture) = "amd64" ]] then FILE="ubuntu-${UBUNTU_VERSION}-cbmc-${CBMC_VERSION}-Linux.deb" URL="https://github.com/diffblue/cbmc/releases/download/cbmc-${CBMC_VERSION}/$FILE" @@ -29,7 +29,7 @@ then exit 0 fi -# There are no binaries for 18.04 or for non-x86_64, so build from source +# There are no binaries for Ubuntu before 20.04 or for non-x86_64, so build from source WORK_DIR=$(mktemp -d) git clone \ diff --git a/scripts/setup/ubuntu/install_deps.sh b/scripts/setup/ubuntu/install_deps.sh index 2633607744c5..f44de0bf53b5 100755 --- a/scripts/setup/ubuntu/install_deps.sh +++ b/scripts/setup/ubuntu/install_deps.sh @@ -14,30 +14,13 @@ DEPS=( gcc git gpg-agent - jq - libssl-dev - lld - lsb-release make - ninja-build patch - pkg-config - python3-pip # Default in CI, but missing in AWS AMI - python3-setuptools - software-properties-common wget zlib1g zlib1g-dev ) -# Version specific dependencies. -declare -A VERSION_DEPS -VERSION_DEPS["20.04"]="universal-ctags python-is-python3 python3-autopep8" -VERSION_DEPS["18.04"]="exuberant-ctags" - -UBUNTU_VERSION=$(lsb_release -rs) -OTHER_DEPS="${VERSION_DEPS[${UBUNTU_VERSION}]:-""}" - set -x # Github promises weekly build image updates, but recommends running @@ -46,12 +29,7 @@ set -x # https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners#installing-software-on-ubuntu-runners sudo apt-get --yes update -sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes "${DEPS[@]}" ${OTHER_DEPS[@]} - -# Add Python package dependencies -if [[ "x$UBUNTU_VERSION" == "x18.04" ]] ; then - python3 -m pip install autopep8 -fi +sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes "${DEPS[@]}" # Get the directory containing this script SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"