# Function called without the required argument

**URL:** <https://discourse.flox.dev/t/function-called-without-the-required-argument/581>\
**Category:** Developing with flox\
**Created:** [December 19, 2022, 6:04pm UTC](https://discourse.flox.dev/t/function-called-without-the-required-argument/581 "2022-12-19T18:04:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 19, 2022, 6:04pm UTC](https://discourse.flox.dev/t/function-called-without-the-required-argument/581/1 "2022-12-19T18:04:14Z")

</div>

I am using flox r98 (from the prerelease environment) and I specified `export FLOX_STABILITY=unstable` in order to access the latest rust compiler (`1_65`).

However when I executed `flox develop` I got this error:

```auto
± flox develop prerelease etorreborre/ockam etorreborre/default
warning: not writing modified lock file of flake 'git+file:///Users/etorreborre/projects/rust/ockam':
• Updated input 'flox-floxpkgs/nixpkgs/nixpkgs':
    'github:flox/nixpkgs/2788904d26dda6cfa1921c5abb7a2466ffe3cb8c' (2022-11-22)
  → 'github:flox/nixpkgs/40f79f003b6377bd2f4ed4027dde1f8f922995dd' (2022-12-17)
error: 'buildVscodeExtension' at /nix/store/5nl9sdpbqcgiq4qjd6ah5hms5kh6j4x3-source/pkgs/applications/editors/vscode/extensions/vscode-utils.nix:3:26 called without required argument 'vscodeExtPublisher'

       at /nix/store/wjm4yy93cbn06micyn3g1yd1as0w98l1-source/default.nix:186:5:

          185| in
          186| pkgs.vscode-utils.buildVscodeExtension {
             | ^
          187| name = "rust-analyzer-${rust-analyzer-rev}";
(use '--show-trace' to show detailed location information)

```

My workaround was to use `export FLOX_STABILITY=staging` and I was lucky enough that `rust 1_65` moved there. But if that hadn’t been the case, how could have had fixed this issue?

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 19, 2022, 6:53pm UTC](https://discourse.flox.dev/t/function-called-without-the-required-argument/581/2 "2022-12-19T18:53:00Z")

</div>

Looks like there might have been a change upstream: [vscode-with-extensions: define extensions.json · NixOS/nixpkgs@66a6cd1 · GitHub](https://github.com/nixos/nixpkgs/commit/66a6cd1d5191af8d3ad3dfd7c31f49d930696b68). Not sure if that caused a regression or not. Are you calling buildVscodeExtension directly or did someone else craft that call?

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 19, 2022, 8:33pm UTC](https://discourse.flox.dev/t/function-called-without-the-required-argument/581/3 "2022-12-19T20:33:18Z")

</div>

I am using the `rustPlatform` so I guess it comes from a transitive dependency. Is there a command I can run to trace the dependencies?

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 19, 2022, 8:37pm UTC](https://discourse.flox.dev/t/function-called-without-the-required-argument/581/4 "2022-12-19T20:37:48Z")

</div>

Hmm maybe there is a regression then. What do you get if you run `flox develop --show-trace`?

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 19, 2022, 8:52pm UTC](https://discourse.flox.dev/t/function-called-without-the-required-argument/581/5 "2022-12-19T20:52:38Z")

</div>

I was exactly doing that :-).

```auto

       at /nix/store/wjm4yy93cbn06micyn3g1yd1as0w98l1-source/default.nix:186:5:

          185| in
          186| pkgs.vscode-utils.buildVscodeExtension {
             | ^
          187| name = "rust-analyzer-${rust-analyzer-rev}";

       … while evaluating the attribute 'rust-analyzer-vscode-extension'

       at /nix/store/wjm4yy93cbn06micyn3g1yd1as0w98l1-source/default.nix:180:3:

          179|
          180| rust-analyzer-vscode-extension =
             | ^
          181| let

       … while evaluating 'isDerivation'

       at /nix/store/nv78zywp4j59l8lkmzbw881i5r3swwda-source/lib/attrsets.nix:446:18:

          445| */
          446| isDerivation = x: x.type or null == "derivation";
             | ^
          447|

       … from call site

       at /nix/store/wjm4yy93cbn06micyn3g1yd1as0w98l1-source/flake.nix:42:16:

           41| (k: v:
           42| if isDerivation v then
             | ^
           43| [(nameValuePair k v)]

       … while evaluating anonymous lambda

       at /nix/store/wjm4yy93cbn06micyn3g1yd1as0w98l1-source/flake.nix:41:15:

           40| (system: listToAttrs (concatLists (mapAttrsToList
           41| (k: v:
             | ^
           42| if isDerivation v then

       … from call site

       at /nix/store/nv78zywp4j59l8lkmzbw881i5r3swwda-source/lib/attrsets.nix:375:16:

          374| mapAttrsToList = f: attrs:
          375| map (name: f name attrs.${name}) (attrNames attrs);
             | ^
          376|

       … while evaluating anonymous lambda

       at /nix/store/nv78zywp4j59l8lkmzbw881i5r3swwda-source/lib/attrsets.nix:375:10:

          374| mapAttrsToList = f: attrs:
          375| map (name: f name attrs.${name}) (attrNames attrs);
             | ^
          376|

       … from call site

       … while evaluating anonymous lambda

       at /nix/store/wjm4yy93cbn06micyn3g1yd1as0w98l1-source/flake.nix:40:10:

           39| ]
           40| (system: listToAttrs (concatLists (mapAttrsToList
             | ^
           41| (k: v:

       … from call site

       at /nix/store/nv78zywp4j59l8lkmzbw881i5r3swwda-source/lib/attrsets.nix:433:43:

          432| genAttrs = names: f:
          433| listToAttrs (map (n: nameValuePair n (f n)) names);
             | ^
          434|

       … while evaluating the attribute 'x86_64-darwin'

       at /nix/store/nv78zywp4j59l8lkmzbw881i5r3swwda-source/lib/attrsets.nix:331:41:

          330| */
          331| nameValuePair = name: value: { inherit name value; };
             | ^
          332|

       … while evaluating anonymous lambda

       at /nix/store/l9sc7vqyq6b2glrp2rksps23vzbbwzvf-source/lib/capacitate/capacitate.nix:200:12:

          199| lib.mapAttrs (
          200| _: flakeInput:
             | ^
          201| flakeInput.${system} or flakeInput

       … from call site

       … while evaluating 'optionalString'

       at /nix/store/nv78zywp4j59l8lkmzbw881i5r3swwda-source/lib/strings.nix:213:5:

          212| # String to return if condition is true
          213| string: if cond then string else "";
             | ^
          214|

       … from call site

       at /nix/store/pkwm4cr2j0y6r58i6nbpk88p7d9421ix-source/pkgs/ockam/cargo-tarpaulin-darwin.nix:24:18:

           23|
           24| postInstall = lib.optionalString stdenv.isDarwin ''
             | ^
           25| wrapProgram $out/bin/cargo-tarpaulin --set PATH "${inputs.fenix.packages.latest.cargo}/bin:${inputs.fenix.packages.latest.rustc}/bin:$PATH"

       … while evaluating the attribute 'postInstall' of the derivation 'cargo-tarpaulin-develop'

       at /nix/store/5nl9sdpbqcgiq4qjd6ah5hms5kh6j4x3-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270| name =
             | ^
          271| let

       … while evaluating the attribute 'nativeBuildInputs' of the derivation 'ockam-0.77.0'

       at /nix/store/5nl9sdpbqcgiq4qjd6ah5hms5kh6j4x3-source/pkgs/stdenv/generic/make-derivation.nix:270:7:

          269| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          270| name =
             | ^

```

[This file](https://github.com/etorreborre/ockam/blob/ockam-exploration/pkgs/ockam/cargo-tarpaulin-darwin.nix) seems to be involved, so probably not a flox regression but some incorrect following of dependencies?

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 21, 2022, 4:54am UTC](https://discourse.flox.dev/t/function-called-without-the-required-argument/581/6 "2022-12-21T04:54:25Z")

</div>

Yep so you use fenix which builds a VSCode extension. There was a change in nixpkgs which I linked earlier which changed the API for buildVscodeExtension. Fortunately it appears fenix fixed that a few days ago with [Specify name and publisher when building VS Code extension · nix-community/fenix@d6ea240 · GitHub](https://github.com/nix-community/fenix/commit/d6ea240d9b44ad684b6cbd31b3bb99f4a86ee403). So if I had to guess you should be able to fix it on your end with a `flox flake update`

Let me know if that does it!

---

<div class="post-metadata">

**Author:** ![mkenigs](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/mkenigs/32/520_2.png) [@mkenigs](https://discourse.flox.dev/u/mkenigs)\
**Post date:** [December 28, 2022, 6:10pm UTC](https://discourse.flox.dev/t/function-called-without-the-required-argument/581/7 "2022-12-28T18:10:49Z")

</div>

Marking as solved but feel free to re-open if there’s still an issue. Thanks for the report!

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [December 28, 2022, 6:17pm UTC](https://discourse.flox.dev/t/function-called-without-the-required-argument/581/8 "2022-12-28T18:17:31Z")

</div>

Sorry I forgot to update you. Yes it works fine now, thanks.
