)]}'
{
  "commit": "c430b5c383e0c0a64a69676d5ae2106912908171",
  "tree": "49be50ba80fe6e92be65578b2522ae0f12a8032d",
  "parents": [
    "b09c59e963b6a517f67832c5247c9829399b3725"
  ],
  "author": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Tue Nov 17 16:54:26 2026 -0500"
  },
  "committer": {
    "name": "Ben Collins",
    "email": "bcollins@libjwt.io",
    "time": "Tue Nov 17 16:54:26 2026 -0500"
  },
  "message": "ci: fail memcheck when valgrind finds a definite leak\n\nThe \"Combo / all\" job runs `ctest -T memcheck` to catch leaks before a\nmerge, but valgrind findings never failed it. MEMORYCHECK_COMMAND_OPTIONS\nhad no --error-exitcode, so a leaking test process still exits 0; ctest\nthen lists the defects after the run and exits 0 itself, and the workflow\nstep only sees ctest\u0027s exit status. The jwe_gcm leak fixed in v3.6.2\n(#347) went through CI this way. The jwt_cli count is unreliable for a\nsecond reason: ctest gives valgrind one --log-file with no %p, so every\nchild started under --trace-children truncates it.\n\nFail the test when valgrind finds an error, which works per process and\nso does not depend on the shared log:\n\n  * Add --error-exitcode\u003d1 --errors-for-leak-kinds\u003ddefinite to\n    MEMORYCHECK_COMMAND_OPTIONS. valgrind now exits non-zero on a\n    definite leak (not the noisier \"possible\" kind), failing that test.\n\n  * Add tests/valgrind-bats.supp and point MEMORYCHECK_SUPPRESSIONS_FILE\n    at it. The bats CLI test runs bash, mktemp, jq and other /usr/bin\n    programs under --trace-children, and those leak definitely in the CI\n    image; without the suppression jwt_cli would fail before any case\n    runs. The suppression is scoped to obj:/usr/bin/* so it can only\n    match the system programs installed there. libjwt\u0027s library, tools\n    and test binaries live in the build tree, never under /usr/bin, so a\n    leak in libjwt\u0027s own code can never match it and is still reported.\n\nThe suppressions path is seeded as a cache entry because include(CTest)\ndeclares MEMORYCHECK_SUPPRESSIONS_FILE with an empty default; a plain\nvariable is dropped when CTest.cmake creates the cache entry and the\nfield would configure out empty.\n\nVerified in the CI image (issue #366): with these options v3.6.1 jwe_gcm\nfails on each backend with \"Early exit with return value 1\" and ctest\nexits non-zero, v3.6.2 passes all unit-test suites, and jwt_cli passes\nonly with the suppressions file. CMake wiring confirmed locally under\nboth JSON backends (the generated DartConfiguration.tcl carries the new\noptions and the absolute suppressions path); valgrind itself cannot run\non the local macOS host, so the memcheck run is left to CI.\n\nCo-Authored-By: Claude Opus 4.8 \u003cnoreply@anthropic.com\u003e\nSigned-off-by: Ben Collins \u003cbcollins@libjwt.io\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b3bd62348f92576160289c2c2ca38e703064bdf1",
      "old_mode": 33188,
      "old_path": "CMakeLists.txt",
      "new_id": "5fb4b3d0e520f50a68fcc239f55e709631115b02",
      "new_mode": 33188,
      "new_path": "CMakeLists.txt"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "26086566985ac6637845f8f492c50ce07ba8e00f",
      "new_mode": 33188,
      "new_path": "tests/valgrind-bats.supp"
    }
  ]
}
