Repository navigation
fix: resolve positional functions in includes with scope context - #578
Merged
Merged
Conversation
sini
force-pushed
the
fix/575-dynamic-forward
branch
2 times, most recently
from
May 30, 2026 20:45
a37de42 to
9dc94f0
Compare
…ful#575) Positional functions (ctx: ...) in includes were silently dropped: the compile router sent them to compile-static (because __args == {}), which stripped __fn as a structural key. The function was never called. Route aspects with __fn to compile-parametric regardless of __args. In prepareParametricFn, detect positional functions and call them directly with ctxFromHandlers(scopeHandlers) instead of fx.bind.fn which would pass {}.
sini
force-pushed
the
fix/575-dynamic-forward
branch
from
May 31, 2026 13:48
9dc94f0 to
4f517e7
Compare
theutz
enabled auto-merge (squash)
May 31, 2026 23:33
sini
disabled auto-merge
May 31, 2026 23:40
theutz
enabled auto-merge (squash)
May 31, 2026 23:41
theutz
approved these changes
May 31, 2026
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.
Closes #575
Summary
Positional functions (
ctx: ...) inincludeswere silently dropped by the pipeline. The compile router sent them tocompile-static(because__args == {}), which stripped__fnas a structural key — the function was never called.Root cause
The compile shape router at
compile.nixdispatched tocompile-parametriconly when__args != {}. Positional functions have__args = {}(no named args fromlib.functionArgs), so they fell through tocompile-staticwhere__fnis a structural key and gets stripped. The function body was discarded.Changes
compile.nix: Route aspects with__fntocompile-parametricregardless of__argsemptiness.aspect.nix: InprepareParametricFn, detect positional functions (empty args + bare lambda) and call them directly withctxFromHandlers(scopeHandlers)instead offx.bind.fnwhich would pass{}.host-propagation.nix: Updatedctx-transformation.test-hostexpected output — positionalctx:functions in includes now correctly receive scope context and produce output instead of being silently dropped.dynamic-forward.nix: Regression test reproducing BUG: Dynamic home/host forwarding no longer work #575 — nixpkgs overlay forwarding via positional context function.Test plan