Skip to content

Commit 4d8b1ac

Browse files
committed
More fixes to CI
1 parent 2b2f055 commit 4d8b1ac

8 files changed

Lines changed: 71 additions & 23 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "llvm-dsdl (toolshed ts26.4.1)",
3-
"image": "ghcr.io/opencyphal/toolshed:ts26.4.1",
2+
"name": "llvm-dsdl (toolshed ts26.4.2)",
3+
"image": "ghcr.io/opencyphal/toolshed:ts26.4.2",
44
"containerEnv": {
55
"LLVM_DIR": "/usr/lib/llvm-22/lib/cmake/llvm",
66
"MLIR_DIR": "/usr/lib/llvm-22/lib/cmake/mlir",

.devcontainer/post-create.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ if [[ -z "${llvm_version}" ]]; then
2222
fi
2323

2424
missing=()
25-
for tool in cmake ninja python3 git lit gzip go cargo tsc node "clang-${llvm_version}"; do
25+
for tool in cmake ninja python3 git lit gzip go cargo tsc node dafny z3 "clang-${llvm_version}"; do
2626
command -v "${tool}" >/dev/null 2>&1 || missing+=("${tool}")
2727
done
2828
for f in "/usr/lib/llvm-${llvm_version}/lib/cmake/mlir/MLIRConfig.cmake" \

.github/actions/setup-language-toolchains/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ runs:
5353
require_command tsc "TypeScript backend integration lane"
5454
require_command node "TypeScript backend integration lane"
5555
56+
# Dafny needs a solver as well as itself. Its NuGet package ships no
57+
# native binaries, so a `dafny` that launches proves nothing about
58+
# whether it can discharge an obligation -- check for z3 separately.
59+
require_command dafny "formal model check (spec/dafny)"
60+
require_command z3 "SMT solver Dafny drives"
61+
5662
require_command "clang-${llvm_version}" "sanitizer and fuzz lanes"
5763
require_file "/usr/lib/llvm-${llvm_version}/lib/cmake/mlir/MLIRConfig.cmake" \
5864
"MLIR dev libraries (libmlir-${llvm_version}-dev)"

.github/workflows/ci.yml

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@ name: CI
33
# Full, unabridged test + report run for the core tools (dsdlc, dsdl-opt, dsdld)
44
# across every supported host platform and every generated-output language.
55
#
6-
# The Linux job runs INSIDE the project's own toolshed image
7-
# (ghcr.io/opencyphal/toolshed:ts26.4.1 — the same image .devcontainer uses), so
8-
# LLVM/MLIR 22, clang, cmake and ninja are already present: no per-run toolchain
9-
# install of LLVM. The setup action only adds what the image lacks (MLIR dev libs,
10-
# Go, Rust, tsc, lit). This job runs identically under `act` locally and on
11-
# GitHub-hosted runners.
12-
#
13-
# The integration suite registers a language's tests only when its toolchain is
14-
# found at configure time, so installing the full toolchain set is what makes the
15-
# run actually unabridged.
6+
# The container jobs run INSIDE the project's own toolshed image
7+
# (ghcr.io/opencyphal/toolshed:ts26.4.2 — the same image .devcontainer uses). That
8+
# image is the single source of truth for the build environment: LLVM/MLIR 22,
9+
# clang, cmake, ninja, the generated-output language toolchains, and Dafny with
10+
# its solver all come from it. Nothing is installed per run; the setup action
11+
# asserts the toolchains are present and fails loudly if one is missing, because
12+
# the integration suite registers a language's tests only when its toolchain is
13+
# found at configure time — so a silently incomplete image sheds whole lanes
14+
# while still reporting green.
1615

1716
on:
1817
push:
@@ -36,7 +35,7 @@ jobs:
3635
name: Full suite (linux / toolshed)
3736
runs-on: ubuntu-26.04
3837
container:
39-
image: ghcr.io/opencyphal/toolshed:ts26.4.1
38+
image: ghcr.io/opencyphal/toolshed:ts26.4.2
4039
timeout-minutes: 120
4140
env:
4241
LLVM_DIR: /usr/lib/llvm-22/lib/cmake/llvm
@@ -167,7 +166,7 @@ jobs:
167166
# bounded on PRs (short -runs) and runs deep on the weekly schedule cron.
168167
runs-on: ubuntu-26.04
169168
container:
170-
image: ghcr.io/opencyphal/toolshed:ts26.4.1
169+
image: ghcr.io/opencyphal/toolshed:ts26.4.2
171170
timeout-minutes: 120
172171
env:
173172
LLVM_DIR: /usr/lib/llvm-22/lib/cmake/llvm
@@ -252,15 +251,32 @@ jobs:
252251
# LLVM/MLIR build matrix, so it is fast and cannot be skipped by a toolchain gap in
253252
# the heavy lanes.
254253
runs-on: ubuntu-26.04
254+
# Dafny and its solver come from the toolshed image rather than being fetched
255+
# per run.
256+
container:
257+
image: ghcr.io/opencyphal/toolshed:ts26.4.2
255258
timeout-minutes: 15
256259
steps:
257260
- name: Checkout
258261
uses: actions/checkout@v4
259262

260-
- name: Set up Dafny
261-
uses: dafny-lang/setup-dafny-action@v1.7.0
262-
with:
263-
dafny-version: "4.11.0"
263+
- name: Assert the Dafny toolchain
264+
# Deliberately not the shared toolchain action: this lane is independent of
265+
# the LLVM/MLIR build matrix and must not be taken down by a Go or
266+
# TypeScript gap. It needs exactly two things, and Dafny's NuGet package
267+
# ships no solver, so a `dafny` that launches proves nothing on its own.
268+
run: |
269+
set -uo pipefail
270+
missing=()
271+
for tool in dafny z3; do
272+
command -v "${tool}" >/dev/null 2>&1 || missing+=("${tool}")
273+
done
274+
if [ "${#missing[@]}" -gt 0 ]; then
275+
echo "::error::toolshed image is missing: ${missing[*]} — these belong in the image"
276+
exit 1
277+
fi
278+
dafny --version
279+
z3 --version
264280
265281
- name: Verify CyphalSerdes
266282
# `dafny verify` exits non-zero on any failed proof obligation, so a broken model
@@ -284,7 +300,7 @@ jobs:
284300
submodules: recursive
285301

286302
- name: Install LLVM/MLIR + ninja (Homebrew; links libc++)
287-
# Pin to the toolshed image's LLVM major (ts26.4.1 -> 22) so the C backend
303+
# Pin to the toolshed image's LLVM major (ts26.4.2 -> 22) so the C backend
288304
# (routed through MLIR/EmitC, whose text may vary across MLIR majors) stays
289305
# comparable. Prefer the versioned formula; fall back to `llvm` (which IS 22
290306
# while 22 is current). The assertion below is the real pin: a Homebrew

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
name: LLVM source coverage
2424
runs-on: ubuntu-26.04
2525
container:
26-
image: ghcr.io/opencyphal/toolshed:ts26.4.1
26+
image: ghcr.io/opencyphal/toolshed:ts26.4.2
2727
timeout-minutes: 120
2828
env:
2929
LLVM_DIR: /usr/lib/llvm-22/lib/cmake/llvm

CMakePresets.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,23 @@
181181
"name": "test-ci-full",
182182
"displayName": "Test (ci full)",
183183
"inherits": "test-base",
184-
"configurePreset": "ci"
184+
"configurePreset": "ci",
185+
"filter": {
186+
"exclude": {
187+
"label": "bench"
188+
}
189+
}
190+
},
191+
{
192+
"name": "test-ci-bench",
193+
"displayName": "Test (ci benchmarks)",
194+
"inherits": "test-base",
195+
"configurePreset": "ci",
196+
"filter": {
197+
"include": {
198+
"label": "bench"
199+
}
200+
}
185201
},
186202
{
187203
"name": "test-ci-release-blocking",

spec/dafny/CyphalSerdes.dfy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,9 @@ module CyphalSerdes {
884884
assert [TokScal(8, 1), TokScal(8, 9)][..2] == [TokScal(8, 1), TokScal(8, 9)];
885885
assert DeCompat(TScal(8), [TokScal(8, 1), TokScal(8, 9)])
886886
== Some((Scal(8, 1), [TokScal(8, 9)]));
887+
// The skipped-leftover case returns body[take..], not the inner reader's
888+
// remainder. Without this the outer cursor's final position is opaque.
889+
assert [TokScal(8, 1), TokScal(8, 9)][2..] == [];
887890
assert DeCompat(TScal(8), []) == Some((Scal(8, 0), []));
888891
var e: seq<Token> := [];
889892
assert [TScal(8)][1..] == [];

test/integration/RunPrimitiveEquivalence.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,17 @@ file(WRITE "${go_dir}/go.mod"
6767
"replace github.com/thirtytwobits/llvm-dsdl/runtime/go => ${runtime_go}\n")
6868
file(COPY_FILE "${driver_dir}/PrimitiveEquivalenceDriver.go" "${go_dir}/main.go")
6969
set(go_bin "${go_dir}/go_primitive_driver")
70+
# -buildvcs=false because this module is written into the build tree, which sits
71+
# inside the repository: left to itself `go build` walks up, finds .git, and
72+
# stamps the driver with commit metadata. That consults git, and git refuses a
73+
# checkout owned by another user -- the ordinary situation in a CI container,
74+
# where it exits 128 and takes the build with it. The stamp is unwanted here
75+
# regardless: this is a throwaway test driver, and baking a commit hash into it
76+
# would make the binary differ between builds of identical source.
7077
execute_process(
7178
COMMAND "${CMAKE_COMMAND}" -E env
7279
"GOFLAGS=-mod=mod" "GOCACHE=${go_dir}/.gocache" "GOMODCACHE=${go_dir}/.gomodcache"
73-
"${GO_EXECUTABLE}" build -o "${go_bin}" .
80+
"${GO_EXECUTABLE}" build -buildvcs=false -o "${go_bin}" .
7481
WORKING_DIRECTORY "${go_dir}"
7582
RESULT_VARIABLE go_build_rc OUTPUT_VARIABLE go_build_out ERROR_VARIABLE go_build_err)
7683
if(NOT go_build_rc EQUAL 0)

0 commit comments

Comments
 (0)