You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pysimlin: rebuilding the extension by hand can keep a stale libsimlin.a #682
After a Rust-only change rebuilds libsimlin.a, rebuilding the pysimlin extension with python setup.py build_ext --inplace can report it is up to date and keep the extension linked against the old archive.
Python tests then run against the old engine, with no error.
The extension should relink whenever libsimlin.a changes.
Example
Change engine behavior, run cargo build --release in src/libsimlin.
In src/pysimlin: rm -f simlin/_clib.abi3.so && uv run python setup.py build_ext --inplace.
Tests still show the old behavior; only build_ext --force picks up the change.
Seen by hand while validating an engine change through pysimlin.
Why it matters
The pre-commit hook and CI are not affected: scripts/pysimlin-tests.sh compares the archive's mtime with the .so, deletes build/, and pins the archive with SIMLIN_STATIC_LIB.
The hazard is the manual flow (DEVELOPMENT.md, make dev), where a developer can believe an engine change was checked through Python when it was not.
Fix
The archive is passed to cffi as extra_objects, which setuptools does not treat as a dependency of the extension.
Also pass it as depends=[...] in ffibuilder.set_source (a standard setuptools Extension argument) so setuptools relinks when the archive is newer.
Whether uv sync reuses a cached build in the same way is unverified; if it does, [tool.uv] cache-keys in pyproject.toml can name the archive.
changed the title [-]build/pysimlin: CFFI extension rebuild silently reuses a stale libsimlin.a (no static-lib dependency tracking)[/-][+]pysimlin: rebuilding the extension by hand can keep a stale libsimlin.a[/+]on Oct 12, 2026
Activity
notebooks: rebuild the C-LEARN LTM experience notebook from scratch
engine: make the harness allocator claim true, and pin the pysimlin a…
[-]build/pysimlin: CFFI extension rebuild silently reuses a stale libsimlin.a (no static-lib dependency tracking)[/-][+]pysimlin: rebuilding the extension by hand can keep a stale libsimlin.a[/+]