-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add scripts in hacking/ - Add harness for sel4-bitfield-ops Signed-off-by: Nick Spinale <[email protected]>
- Loading branch information
Showing
5 changed files
with
183 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
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)) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM debian:bookworm | ||
|
||
RUN apt-get update -q && apt-get install -y --no-install-recommends \ | ||
bash-completion \ | ||
build-essential \ | ||
ca-certificates \ | ||
curl \ | ||
make \ | ||
man \ | ||
procps \ | ||
python3-pip \ | ||
sudo \ | ||
vim \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG UID | ||
ARG GID | ||
|
||
RUN groupadd -f -g $GID x && useradd -u $UID -g $GID -G sudo -m -p x x | ||
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # for convenience | ||
|
||
USER x | ||
|
||
# Optimize by matching rust-toolchain.toml | ||
ENV DEFAULT_TOOLCHAIN=nightly-2023-08-02 | ||
|
||
RUN curl -sSf https://sh.rustup.rs | \ | ||
bash -s -- -y --no-modify-path --default-toolchain $DEFAULT_TOOLCHAIN | ||
|
||
ENV PATH=/home/x/.cargo/bin:$PATH | ||
|
||
RUN cargo install --locked kani-verifier && cargo kani setup | ||
|
||
WORKDIR /work |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
work_root := ../../.. | ||
here_relative := hacking/kani | ||
|
||
id := rust-sel4-kani | ||
image_tag := $(id) | ||
container_name := $(id) | ||
|
||
uid := $(shell id -u) | ||
gid := $(shell id -g) | ||
|
||
mount_params := type=bind,src=$(abspath $(work_root)),dst=/work | ||
|
||
.PHONY: none | ||
none: | ||
|
||
.PHONY: build | ||
build: | ||
docker build \ | ||
--build-arg UID=$(uid) --build-arg GID=$(gid) \ | ||
-t $(image_tag) . | ||
|
||
.PHONY: run | ||
run: build | ||
docker run -d --name $(container_name) \ | ||
--mount $(mount_params) \ | ||
$(image_tag) sleep inf | ||
|
||
.PHONY: runi | ||
runi: build | ||
docker run --rm \ | ||
--mount $(mount_params) \ | ||
-it $(image_tag) bash | ||
|
||
.PHONY: exec | ||
exec: | ||
docker exec -it $(container_name) bash | ||
|
||
.PHONY: rm-container | ||
rm-container: | ||
for id in $$(docker ps -aq -f "name=^$(container_name)$$"); do \ | ||
docker rm -f $$id; \ | ||
done | ||
|
||
.PHONY: check | ||
check: build | ||
docker run --rm \ | ||
--mount $(mount_params),readonly \ | ||
-i $(image_tag) \ | ||
make -C $(here_relative) check BUILD=/tmp/build |