Skip to content

ci(cflite): add the Dockerfile ClusterFuzzLite needs and fix the fuzz build - #170

Merged
hyperpolymath merged 3 commits into
mainfrom
ci/cflite-dockerfile
Nov 5, 2026
Merged

hyperpolymath merged 3 commits into
mainfrom
ci/cflite-dockerfile

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

ClusterFuzzLite PR fuzzing / PR (address) fails on every PR, including #168. This PR fixes the three causes, in the order they surface.

Changes

  • .clusterfuzzlite/Dockerfile (new). build_fuzzers runs docker build -f .clusterfuzzlite/Dockerfile, but the directory only had a Containerfile.
    • The new file mirrors the Containerfile, using the same pinned base-builder-rust digest. This is the estate convention betlang and jtv-lang already follow.
    • The Containerfile stays for podman-first local builds.
  • .clusterfuzzlite/build.sh.
    • Copies the targets from ./fuzz/target/x86_64-unknown-linux-gnu/release/, where cargo-fuzz writes them. The old path ./target/... failed with cannot stat.
    • Also copies each target's .options file to $OUT.
  • .clusterfuzzlite/fuzz_parser.options (new). Turns off leak detection for libFuzzer and ASan.
    • Once built, fuzz_parser reported a leak on its first input, a single newline.
    • The leak comes from nickel-lang-parser 0.4.0. It allocates AST nodes in a bumpalo arena, which never runs destructors (see the AstAlloc docs in src/ast/alloc.rs), so strings in parsed literals always leak.
    • Without this file, every fuzz run would report that upstream leak as a crash. AddressSanitizer still reports memory-safety errors.

Testing

I ran the compile locally in the same base image with FUZZING_LANGUAGE=rust and SANITIZER=address:

  • The build finished and $OUT contained fuzz_parser.
  • A 90-second fuzz run (615 executions, about 13.4k coverage edges) produced no crashes.
  • With both leak switches off, the run exited 0 and wrote no artifacts.
  • bash -n build.sh passes, and the options file parses as INI.

One thing to watch: the PR job has a 15-minute timeout. Locally the compile took about 6 minutes and the run step fuzzes for 300 seconds, so the margin is small.


Generated by Claude Code

… build

ClusterFuzzLite fails in build_fuzzers on every PR, for three reasons:

- It runs `docker build -f .clusterfuzzlite/Dockerfile`, but the directory
  only had a Containerfile. Add a Dockerfile that mirrors it (same pinned
  base-builder-rust digest). The Containerfile stays for podman-first
  local builds.
- build.sh copied targets from ./target/..., but cargo-fuzz writes them
  to ./fuzz/target/x86_64-unknown-linux-gnu/release/. The copy failed with
  "cannot stat".
- Once built, fuzz_parser reported a leak on its first input (a single
  newline). The leak comes from nickel-lang-parser, which allocates AST
  nodes in a bumpalo arena that never runs destructors, so strings in
  those nodes always leak. Add fuzz_parser.options turning off leak
  detection for libFuzzer and ASan, and have build.sh copy each target's
  .options file to $OUT. ASan still reports memory-safety errors.

Verified locally with the same base image:
- The compile finishes and $OUT contains fuzz_parser.
- A 90-second fuzz run (615 executions) produced no crashes.
- With both leak switches off, the run exits 0 with no artifacts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0132Cdz3iwk2QGKv2sUhhsye
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c11a7feb-95e9-4fd3-ae71-563ba0e68157
Commits

Reviewing files that changed from the base of the PR and between e436fd4 and 91d8388.

Files selected for processing: 7

  • .clusterfuzzlite/Containerfile
  • .clusterfuzzlite/Dockerfile
  • .clusterfuzzlite/build.sh
  • .clusterfuzzlite/fuzz_parser.options
  • config/build.k9.ncl
  • config/rust-fmt.k9.ncl
  • setup-dev-env.k9.ncl
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 5, 2026 00:15
@hyperpolymath
hyperpolymath enabled auto-merge (squash) November 5, 2026 00:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T00:26:35.949930Z 91d8388 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

SonarCloud failed this PR on a D security rating for new code:
- Dockerfile:10 "Copying recursively might inadvertently add sensitive
  data to the container." `COPY . $SRC/bunsenite` sent the whole
  checkout, .git included, into the build image.
- build.sh:13 "Use '[[' instead of '['".

The image now copies only what the fuzz build reads:
- Cargo.toml and Cargo.lock
- src/
- benches/ (declared as [[bench]] targets)
- crates/ (the patched nickel-lang-vector)
- fuzz/
- .clusterfuzzlite/ (build.sh reads the per-target .options from there)

The Containerfile gets the same change, to stay in sync. Nothing in
these paths uses include_str!/include_bytes! on files outside them, and
`cargo metadata` resolves both manifests from that subset.

The "runs as root" warning stays as it is: the OSS-Fuzz base-builder
image needs root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0132Cdz3iwk2QGKv2sUhhsye
The Dogfood Gate's "Validate K9 contracts" job (k9-ecosystem/validate-action)
fails on main with four errors:

- config/build.k9.ncl, config/rust-fmt.k9.ncl: "Missing K9 format marker".
  The K9! preamble sat on line 2, under the SPDX comment; the validator
  requires it as the first non-empty line, which is how the contractiles
  templates lay it out. K9! now comes first, SPDX second.
- config/rust-fmt.k9.ncl: "Pedigree block missing 'name' field". Both config
  contracts now carry a pedigree name.
- setup-dev-env.k9.ncl: "Hunt-level K9 file must include a 'signature' or
  'signature_required' field". It is a Hunt component (it runs installers
  and shell commands), so its pedigree now declares signature_required =
  true, as contractiles/self-validating/template-hunt.k9.ncl does.

The validator now reports 10 files scanned, 0 errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0132Cdz3iwk2QGKv2sUhhsye
(cherry picked from commit a94f3ea)
@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
B Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Copy Markdown
Owner Author

Status at head 91d8388: ClusterFuzzLite PR (address), Validate K9 contracts and Validate DEED manifests all pass.

  • K9 fix ported in. Validate K9 contracts also fails on main. #169 fixes it, so I cherry-picked its commit (a94f3ea → 91d8388) here. Git will drop the duplicate change when fix(k9): satisfy the K9 validator in three contracts #169 merges first.
  • SonarCloud. bb33a7e took the security rating on new code from D to B:
    • The Dockerfile and Containerfile now copy only Cargo.toml, Cargo.lock, src/, benches/, crates/, fuzz/ and .clusterfuzzlite/, instead of the whole checkout (.git included).
    • build.sh uses [[ instead of [.
    • I rebuilt the image locally with these changes and the fuzz compile still produces fuzz_parser and fuzz_parser.options.
  • Remaining SonarCloud item. The one finding left is the hotspot on Dockerfile:8, "might run with root". It can't be fixed in code: the OSS-Fuzz base-builder-rust image compiles into $OUT as root, so adding a USER line would break the build. It needs to be marked "Safe" in SonarCloud, which needs a maintainer.

Generated by Claude Code

@hyperpolymath
hyperpolymath merged commit 1d09c0a into main Nov 5, 2026
15 of 16 checks passed
@hyperpolymath
hyperpolymath deleted the ci/cflite-dockerfile branch November 5, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants