Repository navigation
ci: run the test suite under valgrind - #26
Merged
Merged
Conversation
Adds a nimble valgrind task (orc + -d:useMalloc so valgrind sees Nim's allocations, native debug info for usable traces) gating on memory errors and definite leaks, and a CI job that runs it. Backs the memory-safety claims with an actual memory checker.
The valgrind job becomes a two-job matrix. The nimble task stays the single source of truth: it runs both memory managers by default and honors VALGRIND_MM=arc|orc to run one, which is what each matrix job sets.
Verified empirically that nimble exits 0 both when a task's exec fails and when nimble test runs a failing suite, so the nimble-invoked steps were decorative gates: a regression would have shown green. The test job's orc step and both valgrind jobs now run nim/valgrind directly (direct nim c -r propagates exit code 1, also verified). The nimble valgrind task remains for local use with a comment warning it cannot gate.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds memory-checker coverage to back the library's memory-safety claims (DESIGN.md §7's memory-manager emphasis, the closure-free interpreter):
nimble valgrindtask: compiles the suite with--mm:orc -d:useMalloc --debugger:nativeand runs it undervalgrind --leak-check=full --errors-for-leak-kinds=definite --error-exitcode=1.-d:useMallocis the essential flag: it routes Nim's allocations through malloc/free so valgrind can actually observe them; without it Nim's pooled allocator hides both errors and leaks. Gating ondefiniteleaks (notstill reachable) avoids false failures from module-level globals alive at exit.valgrindCI job that installs valgrind and runs the task on every PR/push.The task lives in the nimble file so it's runnable locally on any Linux box, not just in CI. The build half (exact flags, suite passes under the malloc allocator) is verified locally; valgrind itself can only run in CI on this macOS-arm64 dev machine, so this PR's own run is the proof.