From ffaed794ee36b0e834bc994cf09d4c1e280dd48e Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Wed, 5 Jun 2024 10:25:24 +0000 Subject: [PATCH] Remove Kani Docker setup Signed-off-by: Nick Spinale --- hacking/kani/.gitignore | 7 ---- hacking/kani/Makefile | 20 ------------ hacking/kani/docker/Dockerfile | 48 --------------------------- hacking/kani/docker/Makefile | 59 ---------------------------------- 4 files changed, 134 deletions(-) delete mode 100644 hacking/kani/.gitignore delete mode 100644 hacking/kani/Makefile delete mode 100644 hacking/kani/docker/Dockerfile delete mode 100644 hacking/kani/docker/Makefile diff --git a/hacking/kani/.gitignore b/hacking/kani/.gitignore deleted file mode 100644 index 3846a5860..000000000 --- a/hacking/kani/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# -# Copyright 2023, Colias Group, LLC -# -# SPDX-License-Identifier: BSD-2-Clause -# - -/target/ diff --git a/hacking/kani/Makefile b/hacking/kani/Makefile deleted file mode 100644 index d7fcb30bf..000000000 --- a/hacking/kani/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright 2023, Colias Group, LLC -# -# SPDX-License-Identifier: BSD-2-Clause -# - -BUILD ?= . - -build_dir := $(BUILD) -target_dir := $(build_dir)/target - -crates := \ - sel4-bitfield-ops - -.PHONY: none -none: - -.PHONY: check -check: - cargo kani --target-dir=$(abspath $(target_dir)) $(addprefix -p,$(crates)) diff --git a/hacking/kani/docker/Dockerfile b/hacking/kani/docker/Dockerfile deleted file mode 100644 index dbb531467..000000000 --- a/hacking/kani/docker/Dockerfile +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright 2023, Colias Group, LLC -# -# SPDX-License-Identifier: BSD-2-Clause -# - -FROM debian:bookworm - -RUN apt-get update && apt-get install -y \ - build-essential \ - curl \ - python3-pip \ - bash-completion \ - man \ - sudo \ - && rm -rf /var/lib/apt/lists/* - -ARG UID -ARG GID - -RUN set -eux; \ - if [ $UID -eq 0 ]; then \ - [ $GID -eq 0 ]; \ - else \ - ! getent passwd $UID; \ - if ! getent group $GID; then \ - groupadd --gid $GID x; \ - fi; \ - useradd --uid $UID --gid $GID --groups sudo --create-home x; \ - fi; - -RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers - -USER $UID - -ARG TOOLCHAIN - -RUN set -eux; \ - if [ $UID -ne 0 ]; then \ - curl -sSf https://sh.rustup.rs | \ - bash -s -- -y --no-modify-path --default-toolchain $TOOLCHAIN; \ - fi; - -ENV PATH=/home/x/.cargo/bin:/root/.cargo/bin:$PATH - -RUN cargo install --locked kani-verifier@0.51.0 && cargo kani setup - -WORKDIR /work/hacking/kani diff --git a/hacking/kani/docker/Makefile b/hacking/kani/docker/Makefile deleted file mode 100644 index 79fa61028..000000000 --- a/hacking/kani/docker/Makefile +++ /dev/null @@ -1,59 +0,0 @@ -# -# Copyright 2023, Colias Group, LLC -# -# SPDX-License-Identifier: BSD-2-Clause -# - -work_root := ../../.. - -id := rust-sel4-kani -image_tag := $(id) -container_name := $(id) - -mount_params := type=bind,src=$(abspath $(work_root)),dst=/work - -.PHONY: none -none: - -.PHONY: build -build: - docker build \ - --build-arg UID=$$(id -u) \ - --build-arg GID=$$(id -g) \ - --build-arg TOOLCHAIN=$$(sed -rn 's,channel = "(.*)",\1,p' $(work_root)/rust-toolchain.toml) \ - -t $(image_tag) . - -.PHONY: runi -runi: build - docker run --rm -it \ - --mount $(mount_params) \ - $(image_tag) bash - -.PHONY: run -run: build - docker run -d \ - --mount $(mount_params) \ - --name $(container_name) \ - $(image_tag) sleep inf - -.PHONY: exec -exec: - docker exec -it $(container_name) bash - -.PHONY: rm-container -rm-container: - set -e; \ - for id in $$(docker ps -aq -f "name=^$(container_name)$$"); do \ - docker rm -f $$id; \ - done - -.PHONY: check -check: build - set -e; \ - if [ -t 0 ]; then \ - tty_args="-it"; \ - fi; \ - docker run --rm $$tty_args \ - --mount $(mount_params),readonly \ - $(image_tag) \ - make check BUILD=/tmp/build