8000 tests: the fetch-scope override test fails on Nix 2.31, and CI never ran it · Issue #60 · nixidae/nixidae · GitHub
[go: up one dir, main page]

Skip to content

tests: the fetch-scope override test fails on Nix 2.31, and CI never ran it #60

Closed

Description

@Lillecarl

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.

Reproduce

nix develop --file . nanopynixVersions.nix_2_31.shell \
  --command pytest tests/nanopynix/test_config_flow.py::test_a_per_call_setting_beats_the_session_default

2 failed, both parameters.

What to decide

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.

Activity

  1. Lillecarl commented on Jul 30, 2026

    @Lillecarl
    ContributorAuthor

    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.

  2. added
    source: nanopynix
    on Oct 19, 2026
  3. added theissue type on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source: nanopynix

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0