Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup/CI: cleanup Ubuntu 18.04 and cbmc-viewer left-overs and enable 24.04 #3758

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/kani.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/build-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/Dockerfile.bundle-release-20-04
Original file line number Diff line number Diff line change
Expand Up @@ -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 }') && \
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/Dockerfile.bundle-test-al2
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
3 changes: 0 additions & 3 deletions scripts/ci/Dockerfile.bundle-test-nixos
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ RUN echo $' \n\
with import <nixpkgs> {}; \n\
mkShell { \n\
packages = [ \n\
ctags \n\
curl \n\
gcc \n\
patchelf \n\
python310 \n\
python310Packages.pip \n\
rustup \n\
]; \n\
}' >> ./default.nix
Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/Dockerfile.bundle-test-ubuntu-20-04
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/Dockerfile.bundle-test-ubuntu-20-04-alt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
2 changes: 1 addition & 1 deletion scripts/ci/Dockerfile.bundle-test-ubuntu-22-04
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
20 changes: 20 additions & 0 deletions scripts/ci/Dockerfile.bundle-test-ubuntu-24-04
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions scripts/setup/al2/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ DEPS=(
gcc10-c++
git
openssl-devel
python3-pip
wget
)

Expand All @@ -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 )"

Expand Down
3 changes: 0 additions & 3 deletions scripts/setup/macos/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 )"

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/setup/ubuntu/install_cbmc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 \
Expand Down
24 changes: 1 addition & 23 deletions scripts/setup/ubuntu/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 )"
Expand Down
Loading