From ffd95cf6568ee9efb584771999865aa6d53bb80b Mon Sep 17 00:00:00 2001 From: Kevin Zakka Date: Tue, 16 Jun 2026 23:45:18 -0700 Subject: [PATCH] CI: drop system_headers from Python-binding ccache sloppiness CMake adds the imported mujoco target's include dir as -isystem, so with system_headers sloppiness ccache stopped hashing the public MuJoCo headers. A header-only change (new mjData field, new enum value) then went undetected and ccache reused objects compiled against the old struct layout, yielding an ABI-mismatched binding: wrong field offsets (garbage in struct/pickle tests), stale mjENABLESTRING/mjNENABLE, and mjSpec-vs-mjData signature mismatches. Removing system_headers makes ccache hash these headers and recompile on change. The mtime/ctime flags stay (they absorb pip's per-run temp-dir churn without affecting content detection). --- .github/workflows/build_steps.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_steps.sh b/.github/workflows/build_steps.sh index aab742a3..f10cebe4 100755 --- a/.github/workflows/build_steps.sh +++ b/.github/workflows/build_steps.sh @@ -254,8 +254,17 @@ build_python_bindings() { # recompile). CCACHE_BASEDIR rewrites absolute paths under it to paths relative # to the (also-in-temp) build cwd, cancelling the random component so objects # hash identically across runs. CCACHE_SLOPPINESS ignores timestamp/path noise. + # + # Do NOT add system_headers here: CMake adds the imported mujoco target's + # include dir (MUJOCO_PATH/include) as -isystem, so ccache would treat the + # public MuJoCo headers as system headers and skip hashing them. A change that + # lives only in those headers (a new mjData field, a new enum value) would then + # go undetected and ccache would reuse an object compiled against the old struct + # layout, producing an ABI-mismatched binding (wrong field offsets, stale + # mjNENABLE, signature mismatch). The mtime/ctime flags are kept: they handle the + # temp-dir churn without affecting header content detection. export CCACHE_BASEDIR="${TMPDIR}" - export CCACHE_SLOPPINESS="time_macros,include_file_mtime,include_file_ctime,pch_defines,locale,system_headers" + export CCACHE_SLOPPINESS="time_macros,include_file_mtime,include_file_ctime,pch_defines,locale" MUJOCO_PATH="${TMPDIR}/mujoco_install" \ MUJOCO_PLUGIN_PATH="${TMPDIR}/mujoco_install/mujoco_plugin" \ MUJOCO_CMAKE_ARGS="-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF ${CCACHE_ARGS} ${CMAKE_ARGS}" \