Repository navigation
Closed
Labels
0.kind: questionRequests for a specific question to be answered
Description
Describe the bug
The wrapper introduced in #240246 is supposed to accept code like: xonsh.override { extraPackages = ps: [ ps.psutil ] }, and then psutil should be importable in the resulting Xonsh package. However, when building this package, I am met with:
error: function 'anonymous lambda' called with unexpected argument 'extraPackages'
at /nix/store/nm7g9fgcffl6nar6vpib220b51dyv0fl-source/pkgs/by-name/xo/xonsh/package.nix:1:1:
Details
error: … while calling a functor (an attribute set with a '__functor' attribute) at /nix/store/81ai25ifhr0l8rryf83h4pj8k0q2pjaj-source/flake.nix:4:37: 3| outputs = { self, nixpkgs }: { 4| packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.xonsh.override { | ^ 5| extraPackages = ps: [ ps.psutil ];… from call site at /nix/store/nm7g9fgcffl6nar6vpib220b51dyv0fl-source/lib/trivial.nix:955:7: 954| { # TODO: Should we add call-time "type" checking like built in? 955| __functor = self: f; | ^ 956| __functionArgs = args; … while calling anonymous lambda at /nix/store/nm7g9fgcffl6nar6vpib220b51dyv0fl-source/lib/customisation.nix:144:34: 143| # Re-call the function but with different arguments 144| overrideArgs = mirrorArgs (newArgs: makeOverridable f (overrideWith newArgs)); | ^ 145| # Change the result of the function call by applying g to it … while calling a functor (an attribute set with a '__functor' attribute) at /nix/store/nm7g9fgcffl6nar6vpib220b51dyv0fl-source/lib/customisation.nix:144:43: 143| # Re-call the function but with different arguments 144| overrideArgs = mirrorArgs (newArgs: makeOverridable f (overrideWith newArgs)); | ^ 145| # Change the result of the function call by applying g to it … from call site at /nix/store/nm7g9fgcffl6nar6vpib220b51dyv0fl-source/lib/trivial.nix:955:7: 954| { # TODO: Should we add call-time "type" checking like built in? 955| __functor = self: f; | ^ 956| __functionArgs = args; … while calling anonymous lambda at /nix/store/nm7g9fgcffl6nar6vpib220b51dyv0fl-source/lib/customisation.nix:136:17: 135| in 136| mirrorArgs (origArgs: | ^ 137| let … while evaluating a branch condition at /nix/store/nm7g9fgcffl6nar6vpib220b51dyv0fl-source/lib/customisation.nix:148:7: 147| in 148| if isAttrs result then | ^ 149| result // { … while calling the 'isAttrs' builtin at /nix/store/nm7g9fgcffl6nar6vpib220b51dyv0fl-source/lib/customisation.nix:148:10: 147| in 148| if isAttrs result then | ^ 149| result // { … from call site at /nix/store/nm7g9fgcffl6nar6vpib220b51dyv0fl-source/lib/customisation.nix:138:16: 137| let 138| result = f origArgs; | ^ 139| error: function 'anonymous lambda' called with unexpected argument 'extraPackages' at /nix/store/nm7g9fgcffl6nar6vpib220b51dyv0fl-source/pkgs/by-name/xo/xonsh/package.nix:1:1: 1| { | ^ 2| lib,
Is there a different way of getting to the wrapped Xonsh?
Steps To Reproduce
To reproduce:
$ cat <<EOF > flake.lockb
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1720712503,
"narHash": "sha256-1u2FWxVZfuoMe8mfRvXBuZq6+DrEqeBT8A4uFOV+my8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "69214562aeca0d6b28f8a233748bbd6f32a52a3f",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
EOF
$ cat <<EOF > flake.nix
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/";
outputs = { self, nixpkgs }: {
packages.x86_64-linux.default = self.packages.x86_64-linux.xonsh.override {
extraPackages = ps: [ ps.psutil ];
};
};
}
EOF
$ nix build
Expected behavior
Xonsh should build.
Additional context
Possibly relevant issues:
- 2023-07-07 xonsh: Add wrapper #240246
- 2023-03-08 xonsh: 0.14.4 -> 0.15.1, set dontWrapPythonPrograms #294328
- 2023-03-22 Fix venv creation in Python environments #297628
- 2023-04-04 Xonsh no longer start #301444 ("likely caused by Fix venv creation in Python environments #297628")
- 2023-04-05 Revert "xonsh: set dontWrapPythonPrograms" #301449 (resolves Xonsh no longer start #301444)
Notify maintainers
@samlukeyes123
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
- system: `"x86_64-linux"`
- host os: `Linux 6.6.37, NixOS, 24.11 (Vicuna), 24.11.20240709.feb2849`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.24.0pre20240627_b44909ac`
- nixpkgs: `/home/sam/.nix-defexpr/channels/nixpkgs`Add a 👍 reaction to issues you find important.
Reacted by midischwarz12
Metadata
Metadata
Assignees
Labels
0.kind: questionRequests for a specific question to be answered
Activity
eclairevoyant commentedon Jul 11, 2024
use
xonsh.wrapperinstead ofxonshThis is documented in the option search: https://search.nixos.org/options?channel=unstable&show=programs.xonsh.package&from=0&size=50&sort=relevance&type=packages&query=xonsh
SamLukeYes commentedon Jul 18, 2024
This behavior was changed in #314728, which includes a refactor, and the top-level xonsh package is not the wrapper now. I'm restoring the original behavior in #325813.