Repository navigation
Description
Description
Follow-up to #697. The pymarkdown pre-commit hook also fails on a NixOS host,
but it is a different failure class than the standalone Rust binaries: it is a
pure-Python tool whose dependency pyjson5 ships a C extension that needs
libstdc++.so.6 on the loader path, which a NixOS host does not provide outside
an FHS/nix develop environment.
This is split from #697 because the standalone binaries (ruff, typos) have
drop-in nixpkgs packages, whereas pymarkdown does not — so it needs its own
investigation and decision.
Evidence
$ uv run pre-commit run pymarkdown --all-files
File ".../pyjson5/__init__.py", line 1, in <module>
from .pyjson5 import *
ImportError: libstdc++.so.6: cannot open shared object file: No such file or directory
pymarkdown is not packaged in nixpkgs (pymarkdown /
python3Packages.pymarkdownlnt both absent), so the simple "add to devTools +
language: system" recipe from #697 does not apply directly.
Options to investigate
- Provide
libstdc++to the loader in the dev-shell — add
pkgs.stdenv.cc.cc.liband setLD_LIBRARY_PATH(orNIX_LD_LIBRARY_PATH)
inmkProjectShellso the existing manylinuxpyjson5wheel resolves its
C library. Smallest change; keeps the upstreamrev:pin; mildly impure. - Package
pymarkdownin the flake —buildPythonApplicationfrom the
PyPI sdist withpyjson5taken fromnixpkgs(python3Packages.pyjson5,
built against the Nixlibstdc++), exposed as apymarkdownbinary, then a
language: systemhook. Most hermetic / SSoT-aligned; most work; adds a
version to maintain. nix-ld(host-level) —programs.nix-ld.enablewith
libraries = [ pkgs.stdenv.cc.cc ]makes the wheel work unchanged. Not
repo-enforceable (per-contributor system config); document as fallback. See
the alternative discussion in [BUG] pre-commit: source binary hooks (ruff, ruff-format, typos) from the flake for NixOS compatibility #697.- Drop/replace
pymarkdown— only if markdown linting can move to a
Nix-friendly tool without losing the.pymarkdownconfig behaviour
(likely undesirable; listed for completeness).
Leaning: Option 1 as the pragmatic unblock (and it generalises to any future
C-extension Python hook), with Option 2 as the hermetic end-state if we want
pymarkdown fully off upstream wheels. Confirm during execution.
Acceptance criteria
-
pre-commit run pymarkdown --all-filespasses in the dev-shell on a NixOS
host (no--no-verify) - Chosen mechanism documented in
docs/NIX.md - CI project-checks job stays green
- If the dev-shell gains
libstdc++/LD_LIBRARY_PATH, a dev-shell parity
test asserts it (mirrors the existingUV_PYTHON/BATS_LIB_PATHtests)
Relationship
- Completes "pre-commit fully NixOS-compatible" together with [BUG] pre-commit: source binary hooks (ruff, ruff-format, typos) from the flake for NixOS compatibility #697.
- Independent of the
prekrunner migration ([DISCUSSION] Migration to prek #40).
Refs: #625
Activity
test(nix): assert dev-shell LD_LIBRARY_PATH carries libstdc++ for pym…
build(nix): expose libstdc++ in dev-shell so pymarkdown runs on NixOS
build(nix): expose libstdc++ in the dev-shell so pymarkdown runs on N…
c-vigo commentedon Jun 24, 2026
Fixed and merged into the epic branch
feature/625-nix-claude-migrationvia #700 (merge77a8f4a). Verified in the dev-shell:pre-commit run pymarkdownpasses (thepyjson5C extension resolveslibstdc++via the dev-shellLD_LIBRARY_PATH). Left open to match the epic's sub-issue convention (cf. #695).test(setup): gate dev-shell libstdc++ tests to NixOS, add FHS leak guard
fix(setup): gate dev-shell C++ runtime LD_LIBRARY_PATH injection to N…
fix(setup): gate dev-shell C++ runtime LD_LIBRARY_PATH injection to N…
revert(devshell): drop python3/pre-commit from dev-shell PATH
fix(image): provide FHS loader + lib path for manylinux wheels (#744)
fix(devshell): expose python3 + pre-commit on dev-shell PATH (CI-safe) (
docs: consolidate the migration CHANGELOG + add/ship MIGRATION.md (#751)
c-vigo commentedon Jun 30, 2026
Resolved by #700 (c59f932) on the Nix-migration branch (epic #625, PR #670). Closing as part of post-merge backlog hygiene (#677).
docs(rfc): record uv2nix/pyproject-nix evaluation and decision (#788)
chore: release 0.4.0 (#195)
chore: release 0.4.0 (#813)
fix(action): deny UV_PYTHON in the shellHook env forward (#1357)
chore: release 1.7.0 (#1385)