fix(nix): anchor result* source filter so result_xdr.py is packaged - #51
Merged
Merged
Conversation
The uv2nix workspace source is filtered through
`nix-gitignore.gitignoreSourcePure` to drop the `./result` nix build
symlink. The pattern was written as `result*` with no leading slash, so
by gitignore semantics it matched a path component named `result…` at
ANY depth — including `src/komet_node/result_xdr.py`.
That file was therefore stripped from the packaged source on every build
(cachix included), while `server.py` imports it unconditionally, so the
installed `komet-node` crashed on startup with:
ModuleNotFoundError: No module named 'komet_node.result_xdr'
Anchoring the pattern to the workspace root (`/result*`) still excludes
the top-level build symlinks (`result`, `result-1`, …) without matching
nested source files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The prebuilt
komet-nodeonk-framework.cachix.orgcrashes on startup:src/komet_node/server.pyimportskomet_node.result_xdrunconditionally, and the module is committed — but it is missing from the built package on every build (cachix included), sokup install komet-nodeyields a node that dies before serving any request. Republishing new commits does not help, because the file is dropped again each build.Root cause
In
nix/komet-node-pyk/default.nix, the uv2nix workspace source is filtered throughnix-gitignore.gitignoreSourcePureto drop the./resultnix build symlink:result*has no leading slash, so by gitignore semantics it matches a path component namedresult…at any depth — includingsrc/komet_node/result_xdr.py. The file is stripped from the source tree before the wheel is built. (The comment just below this list even warns that source filtering here can make cachix builds diverge from whatkuprequests.)Fix
Anchor the pattern to the workspace root so it only matches the top-level build symlinks:
/result*still excludes./result,./result-1, … but no longer matches nested source files.result_xdr.pyis the only source file whose name starts withresult, so this fully resolves the crash.Verification
git ls-tree -r HEAD -- src/komet_node/result_xdr.py— file is tracked.komet-node-envsite-packages contains everykomet_nodemodule exceptresult_xdr.py.komet-node --host localhost --port <p>starts without the import error (a--helpsmoke test alone does not catch this — the failing import runs before argument handling).