Skip to content

fix(docker): build Clam with clang-16, and validate Dockerfile.dev on PRs - #58

Merged
GuilhermeBn198 merged 1 commit into
developfrom
fix/clam-image-build
Aug 22, 2026
Merged

fix(docker): build Clam with clang-16, and validate Dockerfile.dev on PRs#58
GuilhermeBn198 merged 1 commit into
developfrom
fix/clam-image-build

Conversation

@GuilhermeBn198

Copy link
Copy Markdown
Collaborator

What broke

The Publish Docker Image workflow has failed on develop since #57 merged (run 32551799773). The CI workflow is green — only the image build is red.

/tmp/clam/sea-dsa/lib/seadsa/SeaDsaAnalysis.cc:19:25: error: explicit qualification
in declaration of 'seadsa::TargetLibraryInfoGetter seadsa::mkTLIGetter(...)'
gmake: *** [Makefile:156: all] Error 2

Root cause

sea-dsa defines mkTLIGetter with a redundant seadsa:: qualification inside namespace seadsa. Reproduced both ways in the image:

compiler result
c++ (GCC 11.4.0, Ubuntu 22.04 default) error: explicit qualification in declaration
clang++-16 warning: -Wextra-qualification

The Clam RUN was getting GCC because ENV CC=/usr/bin/clang-16 / ENV CXX=... live in section 11 of Dockerfile.dev, 88 lines below the Clam build in section 7b — and a Docker ENV only applies to later instructions. Upstream's own docker/clam.Dockerfile passes -DCMAKE_C_COMPILER=clang-16 -DCMAKE_CXX_COMPILER=clang++-16 explicitly; clang is the toolchain Clam is built against.

This is not upstream drift. seahorn/clam dev16 is at 302bf49a (2026-08-07) and seahorn/sea-dsa dev16 at 661855a3 (2026-08-12) — both older than the recipe that references them. The section never built; it was merged without ever being compiled.

The fix

  1. Name the compilers in CLAM_CFG, so the build no longer depends on instruction ordering.
  2. Run the publish workflow on pull requests that touch Dockerfile.dev, with push: false.

(2) is the durable half. The workflow only ever ran after a merge to develop, so no PR could have caught an unbuildable Dockerfile — which is exactly how this reached the default development branch. It is paths-filtered, so PRs that don't touch the Dockerfile pay nothing, and GHCR login is skipped on PRs (no packages: write from forks, and nothing to push anyway).

Because this PR touches Dockerfile.dev, the new job builds the image here — the green check on this PR is the validation of the fix, pre-merge.

Why it matters beyond CI

--add-invariants is refused with exit code 3 unless the build ships Clam (#54). Until this image publishes, the Invariants (Clam) CI job stays at CAPABILITY: ABSENT. Merging this is what flips it to PRESENT.

Known follow-up (not in scope here)

Dockerfile.dev clones clam at branch dev16 and Clam's extra target clones sea-dsa/llvm-seahorn at dev16 too — all unpinned moving branches. Not the cause of this failure, but it means a future upstream commit can break the image with no change on our side. Worth pinning to SHAs separately.

Refs #54

The image build has been failing on develop since #57 merged. Clam's
sea-dsa dependency defines seadsa::mkTLIGetter with a redundant namespace
qualification inside its own namespace; clang reports that as
-Wextra-qualification, GCC rejects it outright, and the build died at 34%.

The Clam RUN was picking up GCC 11 because the ENV CC/CXX=clang-16 that the
rest of the image relies on is declared in section 11, 88 lines *below* it,
and a Docker ENV only applies to later instructions. Naming the compilers in
CLAM_CFG fixes it without depending on instruction order, and matches what
upstream's own docker/clam.Dockerfile passes.

Neither dependency drifted: clam dev16 is at 302bf49a (2026-08-07) and
sea-dsa dev16 at 661855a3 (2026-08-12), both older than the recipe. This
never built -- it was written and merged without ever being compiled.

That is the second defect, and the one worth fixing properly: the publish
workflow only ran after a merge to develop, so no PR could have caught an
unbuildable Dockerfile. It now also runs on pull requests that touch
Dockerfile.dev, with push disabled so a branch never overwrites :latest.
This PR touches Dockerfile.dev, so that new job validates the fix here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant