Y
8000
ou 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
tests: the fetch-scope override test fails on Nix 2.31, and CI never ran it #60
test_a_per_call_setting_beats_the_session_default fails on Nix 2.31, on both
engines and both backends. It passes on 2.34, 2.35 and git.
E AssertionError: fetch_settings must beat the session default
E assert 'refused' == 'accepted'
_fetch_scope_holds (tests/nanopynix/test_config_flow.py:671) reports
"accepted" when lock_flake succeeds on a dirty git tree, and "refused" when
it raises. The test passes a per-call fetch_settings that must beat the
session default. On 2.31 the fetcher still refuses.
Why nobody saw it
The commit that added these tests, "feat(nanopynix): express Nix configuration
by the scope Nix gives it", is also the commit that turned CI red at collection — every job stopped on ModuleNotFoundError: No module named 'pytest_agent', so no test in the suite
ran on any version. Collection is fixed now (tests/support/notes.py and the
gate beside it), and this is the first thing the green jobs surfaced. The test
went to CI unrun, and it has never passed there on 2.31.
Either 2.31 genuinely cannot route a per-call fetch setting, in which case the
test needs a nix_version(minimum=...) gate and the limitation belongs in the
settings documentation; or the routing is wrong on 2.31 and the library needs
the fix. Read which fetchers::Settings 2.31 consults before choosing — do not
gate the test until that question is answered, because a gate on a real defect
hides it.
Not caused by the lifetime work
Proven four ways: the test exists at that work's baseline commit; the only
change to the file since is the note import and a ruff format
reparenthesisation of an async with; no settings code was touched; and the
identical code passes on 2.34, 2.35 and git in the same CI run.
Answered: 2.31 can route a per-call fetch setting. The routing is wrong, and the cause is a use-after-free in the bindings, not a limitation of 2.31.
parse_flake_ref (nanopynix-bindings/src/nix_flake.cpp:98) builds the FlakeRef against a stack-local nix::fetchers::Settings. Nix 2.31 keeps a pointer to it in fetchers::Input (fetchers.hh:39) and its git fetcher reads through that pointer. Nix 2.34 and 2.35 removed the stored pointer and pass state.fetchSettings instead, which is why only 2.31 fails.
Details, the gdb frames and the proof are in #63. Do not gate this test on a version: the gate would hide the use-after-free.
Activity
Lillecarl commentedon Jul 30, 2026
Answered: 2.31 can route a per-call fetch setting. The routing is wrong, and the cause is a use-after-free in the bindings, not a limitation of 2.31.
parse_flake_ref(nanopynix-bindings/src/nix_flake.cpp:98) builds theFlakeRefagainst a stack-localnix::fetchers::Settings. Nix 2.31 keeps a pointer to it infetchers::Input(fetchers.hh:39) and its git fetcher reads through that pointer. Nix 2.34 and 2.35 removed the stored pointer and passstate.fetchSettingsinstead, which is why only 2.31 fails.Details, the gdb frames and the proof are in #63. Do not gate this test on a version: the gate would hide the use-after-free.
fix(bindings): let a flake reference own the fetch settings it points at