Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The exports option can only be set when binary is set to bash #1744

Closed
jcf opened this issue Feb 22, 2025 · 3 comments
Closed

The exports option can only be set when binary is set to bash #1744

jcf opened this issue Feb 22, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@jcf
Copy link

jcf commented Feb 22, 2025

Describe the bug

I updated devenv and my flake inputs and ran into this error I've never seen before:

       error: Failed assertions:
       - The 'exports' option can only be set when 'binary' is set to 'bash'.
✖ Building shell in 741ms
Error:   × Command `/nix/store/13aiq5113vphpn4j8rrhp60srw2kxqrr-nix-2.24-devenv/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --keep-going
  │ --max-jobs 5 --option eval-cache false --option extra-substituters https://devenv.cachix.org --option extra-trusted-public-keys devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw= print-dev-env
  │ --profile /Users/jcf/.config/setup/.devenv/gc/shell -vv --log-format internal-json` failed with with exit code 1

direnv: failed to build the devenv environment. devenv.nix may contain errors. see above.

I don't set any exports or shell so suspect this issue comes from outside of my configuration.

To reproduce

https://gist.github.com/jcf/bb673bef459e72d3459d4b9a6ade1aca

direnv reload
direnv: loading ~/.config/setup/.envrc
direnv: loading https://raw.githubusercontent.com/cachix/devenv/ee1b50e916819cfa82624df3787a7d04151bcc63/direnvrc (sha256-+tK7sFBNn+c1Zgr10WcUvCzSTp+Hhn/0m3E2FW/DA1Y=)
direnv: using devenv
• Building shell ...
• Using Cachix: devenv
error:
       … from call site
         at /Users/jcf/.config/setup/.devenv.flake.nix:155:34:
          154|           build = build project.options project.config;
          155|           devShell."${system}" = config.shell;
             |                                  ^
          156|         };

       … while calling anonymous lambda
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/attrsets.nix:1204:18:
         1203|         mapAttrs
         1204|           (name: value:
             |                  ^
         1205|             if isAttrs value && cond value

       … from call site
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/attrsets.nix:1207:18:
         1206|             then recurse (path ++ [ name ]) value
         1207|             else f (path ++ [ name ]) value);
             |                  ^
         1208|     in

       … while calling anonymous lambda
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:256:72:
          255|           # For definitions that have an associated option
          256|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          257|

       … while evaluating the attribute 'value'
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:927:9:
          926|     in warnDeprecation opt //
          927|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          928|         inherit (res.defsFinal') highestPrio;

       … while evaluating the option `shell':

       … while evaluating the attribute 'mergedValue'
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:962:5:
          961|     # Type-check the remaining definitions, and merge them. Or throw if no definitions.
          962|     mergedValue =
             |     ^
          963|       if isDefined then

       … while evaluating a branch condition
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:963:7:
          962|     mergedValue =
          963|       if isDefined then
             |       ^
          964|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal

       … while evaluating the attribute 'values'
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:956:9:
          955|       in {
          956|         values = defs''';
             |         ^
          957|         inherit (defs'') highestPrio;

       … while evaluating a branch condition
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:952:11:
          951|           # Avoid sorting if we don't have to.
          952|           if any (def: def.value._type or "" == "order") defs''.values
             |           ^
          953|           then sortProperties defs''.values

       … while calling the 'any' builtin
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:952:14:
          951|           # Avoid sorting if we don't have to.
          952|           if any (def: def.value._type or "" == "order") defs''.values
             |              ^
          953|           then sortProperties defs''.values

       … while evaluating the attribute 'values'
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:1079:7:
         1078|     in {
         1079|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |       ^
         1080|       inherit highestPrio;

       … while calling the 'concatMap' builtin
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:1079:16:
         1078|     in {
         1079|       values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
             |                ^
         1080|       inherit highestPrio;

       … while calling the 'concatMap' builtin
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:942:17:
          941|         # Process mkMerge and mkIf properties.
          942|         defs' = concatMap (m:
             |                 ^
          943|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while calling anonymous lambda
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:942:28:
          941|         # Process mkMerge and mkIf properties.
          942|         defs' = concatMap (m:
             |                            ^
          943|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while calling the 'map' builtin
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:943:11:
          942|         defs' = concatMap (m:
          943|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |           ^
          944|         ) defs;

       … while evaluating definitions from `«github:cachix/devenv/8ebde3cd7f36655cd75bb5eb5702f6fb6bf2f915»/src/modules/top-level.nix':

       … from call site
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:943:128:
          942|         defs' = concatMap (m:
          943|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                ^
          944|         ) defs;

       … while calling 'dischargeProperties'
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:1030:25:
         1029|   */
         1030|   dischargeProperties = def:
             |                         ^
         1031|     if def._type or "" == "merge" then

       … while evaluating a branch condition
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:1031:5:
         1030|   dischargeProperties = def:
         1031|     if def._type or "" == "merge" then
             |     ^
         1032|       concatMap dischargeProperties def.contents

       … while evaluating the attribute 'value'
         at «github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93»/lib/modules.nix:665:53:
          664|                 (n: value:
          665|                   [{ inherit (module) file; inherit value; }]
             |                                                     ^
          666|                 )

       … while calling the 'throw' builtin
         at «github:cachix/devenv/8ebde3cd7f36655cd75bb5eb5702f6fb6bf2f915»/src/modules/top-level.nix:31:7:
           30|     then
           31|       throw ''
             |       ^
           32|         Failed assertions:

       error:
       error: Failed assertions:
       - The 'exports' option can only be set when 'binary' is set to 'bash'.
✖ Building shell in 741ms
Error:   × Command `/nix/store/13aiq5113vphpn4j8rrhp60srw2kxqrr-nix-2.24-devenv/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option warn-dirty false --keep-going
  │ --max-jobs 5 --option eval-cache false --option extra-substituters https://devenv.cachix.org --option extra-trusted-public-keys devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw= print-dev-env
  │ --profile /Users/jcf/.config/setup/.devenv/gc/shell -vv --log-format internal-json` failed with with exit code 1

direnv: failed to build the devenv environment. devenv.nix may contain errors. see above.
direnv: export +DEVENV_DIRENVRC_ROLLING_UPGRADE +DEVENV_DIRENVRC_VERSION

Version

$ devenv version
devenv 1.4.1 (aarch64-darwin)
@jcf jcf added the bug Something isn't working label Feb 22, 2025
@jcf
Copy link
Author

jcf commented Feb 22, 2025

Rolling nixpkgs back to the rolling cachix release fixes the above issue.

inputs:
  nixpkgs:
    url: "github:cachix/devenv-nixpkgs/rolling"
  devenv:
    url: "github:cachix/devenv"

Unfortunately, I need newer packages in a number of projects, which precludes me from using December 2024 nixpkgs.

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c414ff73140fe4398d3d7752a9f18e65ef89fc93' (2025-02-22)
  → 'github:cachix/devenv-nixpkgs/7bd9e84d0452f6d2e63b6e6da29fe73fac951857' (2024-12-06)

@sandydoo
Copy link
Member

Thanks!

@sandydoo
Copy link
Member

More fixes are needed for nixpkgs/master: #1745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants