File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # Validate devcontainer.json syntax
1+ # Generate per-OS devcontainer.json from the default (debian) template
2+ devcontainer-generate :
3+ #!/ bin/ bash
4+ set -euo pipefail
5+ template=common/ .devcontainer/ devcontainer.json
6+ for os in debian ubuntu; do
7+ mkdir -p " common/.devcontainer/${os}"
8+ sed -e " s/devenv-debian/devenv-${os}/g" " $template" > " common/.devcontainer/${os}/devcontainer.json"
9+ done
10+
11+ # Validate devcontainer.json syntax and that per-OS configs are in sync
212devcontainer-validate :
13+ #!/ bin/ bash
14+ set -euo pipefail
15+ template=common/ .devcontainer/ devcontainer.json
16+ rc=0
17+ for os in debian ubuntu; do
18+ expected=$(sed " s/devenv-debian/devenv-${os}/g" " $template" )
19+ actual=$(cat " common/.devcontainer/${os}/devcontainer.json" )
20+ if [ " $expected" != " $actual" ]; then
21+ echo " ERROR: common/.devcontainer/${os}/devcontainer.json is out of sync with template"
22+ echo " Run 'just devcontainer-generate' to fix"
23+ rc=1
24+ fi
25+ done
26+ if [ $rc -ne 0 ]; then
27+ exit $rc
28+ fi
29+ echo " All devcontainer configs are in sync"
330 npx --yes @devcontainers/ cli read -configuration --workspace-folder .
431
532# Build devenv Debian image with local tag
Original file line number Diff line number Diff line change @@ -42,7 +42,6 @@ RUN rust_nightly=$rust_nightly /run/src/install-rust.sh
4242FROM rust as kani
4343# renovate: datasource=crate depName=kani-verifier
4444ARG kaniversion=0.67.0
45- RUN dnf install -y gcc && dnf clean all
4645COPY install-kani.sh /run/src/
4746RUN kaniversion=$kaniversion /run/src/install-kani.sh
4847
Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ RUN rust_nightly=$rust_nightly /run/src/install-rust.sh
4545FROM rust AS kani
4646# renovate: datasource=crate depName=kani-verifier
4747ARG kaniversion=0.67.0
48- RUN apt-get update && apt-get install -y --no-install-recommends gcc libc6-dev && rm -rf /var/lib/apt/lists/*
4948COPY install-kani.sh /run/src/
5049RUN kaniversion=$kaniversion /run/src/install-kani.sh
5150
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ RUN rust_nightly=$rust_nightly /run/src/install-rust.sh
5757FROM rust AS kani
5858# renovate: datasource=crate depName=kani-verifier
5959ARG kaniversion=0.67.0
60- RUN apt-get update && apt-get install -y --no-install-recommends gcc libc6-dev && rm -rf /var/lib/apt/lists/*
6160COPY install-kani.sh /run/src/
6261RUN kaniversion=$kaniversion /run/src/install-kani.sh
6362
Original file line number Diff line number Diff line change 11#! /bin/bash
22# Install Kani formal verification tool
3- # This script is shared between c10s and debian container builds.
3+ # This script is shared between c10s, debian, and ubuntu container builds.
44# Prerequisites: rustup must already be installed (via install-rust.sh)
55set -xeuo pipefail
66
77# Required environment variable (passed as build ARG)
88: " ${kaniversion:? kaniversion is required} "
99
10+ # Install gcc (required to compile Kani's C stubs)
11+ if command -v dnf > /dev/null; then
12+ dnf install -y gcc && dnf clean all
13+ elif command -v apt-get > /dev/null; then
14+ apt-get update && apt-get install -y --no-install-recommends gcc libc6-dev && rm -rf /var/lib/apt/lists/*
15+ fi
16+
1017export RUSTUP_HOME=/usr/local/rustup
1118export CARGO_HOME=/usr/local/cargo
1219export PATH=" /usr/local/bin:$PATH "
You can’t perform that action at this time.
0 commit comments