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

failure to build lazy-options.json on the main branch on x86_64-linux #169157

Closed
fabianhjr opened this issue Apr 18, 2022 · 5 comments · Fixed by #169196
Closed

failure to build lazy-options.json on the main branch on x86_64-linux #169157

fabianhjr opened this issue Apr 18, 2022 · 5 comments · Fixed by #169196

Comments

@fabianhjr
Copy link
Member

Describe the bug

Build failure

Steps To Reproduce

On 6d21daa, do a nixos-rebuild

Expected behavior

Build

Additional context

building '/nix/store/4ljfw24cysbshllrvb5rm2ygndvf6pwz-lazy-options.json.drv'...
error: attribute 'stdenv' missing

       at /nix/store/5rid53r50kj9iai1f880vccndyspay8g-nixos/modules/services/system/nscd.nix:38:22:

           37|         type = types.package;
           38|         default = if pkgs.stdenv.hostPlatform.libc == "glibc"
             |                      ^
           39|           then pkgs.stdenv.cc.libc.bin

       … while evaluating the attribute 'default'

       at /nix/store/5rid53r50kj9iai1f880vccndyspay8g-nixos/modules/services/system/nscd.nix:38:9:

           37|         type = types.package;
           38|         default = if pkgs.stdenv.hostPlatform.libc == "glibc"
             |         ^
           39|           then pkgs.stdenv.cc.libc.bin

       … while evaluating 'isDerivation'

       at /nix/store/r40kv5ppdkqkgalimszl7hsvhz8csq1c-lib/attrsets.nix:427:18:

          426|   */
          427|   isDerivation = x: x.type or null == "derivation";
             |                  ^
          428|

       … from call site

       at /nix/store/r40kv5ppdkqkgalimszl7hsvhz8csq1c-lib/options.nix:256:8:

          255|   scrubOptionValue = x:
          256|     if isDerivation x then
             |        ^
          257|       { type = "derivation"; drvPath = x.name; outPath = x.name; name = x.name; }

       … while evaluating 'scrubOptionValue'

       at /nix/store/r40kv5ppdkqkgalimszl7hsvhz8csq1c-lib/options.nix:255:22:

          254|   */
          255|   scrubOptionValue = x:
             |                      ^
          256|     if isDerivation x then

       … from call site

       at /nix/store/r40kv5ppdkqkgalimszl7hsvhz8csq1c-lib/options.nix:235:54:

          234|         // optionalAttrs (opt ? example) { example = scrubOptionValue opt.example; }
          235|         // optionalAttrs (opt ? default) { default = scrubOptionValue opt.default; }
             |                                                      ^
          236|         // optionalAttrs (opt ? defaultText) { default = opt.defaultText; }

       … while evaluating the attribute 'default'

       at /nix/store/r40kv5ppdkqkgalimszl7hsvhz8csq1c-lib/options.nix:235:44:

          234|         // optionalAttrs (opt ? example) { example = scrubOptionValue opt.example; }
          235|         // optionalAttrs (opt ? default) { default = scrubOptionValue opt.default; }
             |                                            ^
          236|         // optionalAttrs (opt ? defaultText) { default = opt.defaultText; }

       … while evaluating 'isDerivation'

       at /nix/store/r40kv5ppdkqkgalimszl7hsvhz8csq1c-lib/attrsets.nix:427:18:

          426|   */
          427|   isDerivation = x: x.type or null == "derivation";
             |                  ^
          428|

       … from call site

       at /nix/store/5rid53r50kj9iai1f880vccndyspay8g-nixos/lib/make-options-doc/default.nix:42:8:

           41|   substSpecial = x:
           42|     if lib.isDerivation x then { _type = "derivation"; name = x.name; }
             |        ^
           43|     else if builtins.isAttrs x then lib.mapAttrs (name: substSpecial) x

       … while evaluating 'substSpecial'

       at /nix/store/5rid53r50kj9iai1f880vccndyspay8g-nixos/lib/make-options-doc/default.nix:41:18:

           40|   # effect, since _type is already used by the module system.
           41|   substSpecial = x:
             |                  ^
           42|     if lib.isDerivation x then { _type = "derivation"; name = x.name; }

       … from call site

       at /nix/store/5rid53r50kj9iai1f880vccndyspay8g-nixos/lib/make-options-doc/default.nix:51:54:

           50|     // lib.optionalAttrs (opt ? example) { example = substSpecial opt.example; }
           51|     // lib.optionalAttrs (opt ? default) { default = substSpecial opt.default; }
             |                                                      ^
           52|     // lib.optionalAttrs (opt ? type) { type = substSpecial opt.type; }
Cacheable portion of option doc build failed.
Usually this means that an option attribute that ends up in documentation (eg `default` or `description`) depends on the restricted module arguments `config` or `pkgs`.

Rebuild your configuration with `--show-trace` to find the offending location. Remove the references to restricted arguments (eg by escaping their antiquotations or adding a `defaultText`) or disable the sandboxed build for the failing module by setting `meta.buildDocsInSandbox = false`.

error: builder for '/nix/store/4ljfw24cysbshllrvb5rm2ygndvf6pwz-lazy-options.json.drv' failed with exit code 1

Notify maintainers

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.17.3, NixOS, 22.05 (Quokka), 22.05.git.4cea7a03db4`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.7.0`
 - channels(root): `"nixos, nixos-small"`
 - channels(fabian): `"home-manager, nixos-19.03-19.03, nixos-19.09-19.09, nixos-20.03-20.03, nixos-20.09-20.09, nixos-21.05-21.05, nixos-21.11-21.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@fabianhjr fabianhjr changed the title failure to build lazy-options on the main branch on x86_64-linux failure to build lazy-options.json on the main branch on x86_64-linux Apr 18, 2022
@fabianhjr fabianhjr mentioned this issue Apr 18, 2022
9 tasks
@fabianhjr
Copy link
Member Author

Issue is fixed by reverting the merge of #124019 (git revert b6f5bf2cf0393193529b717772684216407b9896 -m 1)

Unsure what went wrong with the merge commit or merge request: b6f5bf2

@fabianhjr
Copy link
Member Author

Fixed by revert on a997762980411531057216c32f6b996737159df1

@fabianhjr fabianhjr reopened this Apr 18, 2022
@fabianhjr
Copy link
Member Author

Woops not on the main branch.

@zowoq zowoq linked a pull request Apr 18, 2022 that will close this issue
@alyssais
Copy link
Member

Unsure what went wrong with the merge commit or merge request: b6f5bf2

I'm guessing it would be the missing defaultText.

@mweinelt mweinelt linked a pull request Apr 18, 2022 that will close this issue
13 tasks
@zoedsoupe
Copy link

I'm kinda having a similar issue:

error: getting status of '/nix/store/x8agwrqz5cady34y537432xscifm70y6-nixos/modules/programs/clickshare.nix': No such file or directory

       … while evaluating 'isFunction'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/trivial.nix:448:16:

          447|   */
          448|   isFunction = f: builtins.isFunction f ||
             |                ^
          449|     (f ? __functor && isFunction (f.__functor f));

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:474:78:

          473|
          474|   applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then
             |       ^
          475|     let

       … while evaluating 'applyModuleArgsIfFunction'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:474:39:

          473|
          474|   applyModuleArgsIfFunction = key: f: args@{ config, options, lib, ... }: if isFunction f then
             |                                       ^
          475|     let

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:376:59:

          375|           throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}"
          376|         else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args);
             |                                                           ^
          377|

       … while evaluating 'unifyModuleSyntax'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:443:34:

          442|      of ‘options’, ‘config’ and ‘imports’ attributes. */
          443|   unifyModuleSyntax = file: key: m:
             |                                  ^
          444|     let

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:376:14:

          375|           throw "Module imports can't be nested lists. Perhaps you meant to remove one level of lists? Definitions: ${showDefs defs}"
          376|         else unifyModuleSyntax (toString m) (toString m) (applyModuleArgsIfFunction (toString m) (import m) args);
             |              ^
          377|

       … while evaluating 'loadModule'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:370:53:

          369|       # Like unifyModuleSyntax, but also imports paths and calls functions if necessary
          370|       loadModule = args: fallbackFile: fallbackKey: m:
             |                                                     ^
          371|         if isFunction m || isAttrs m then

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:411:22:

          410|           let
          411|             module = loadModule args parentFile "${parentKey}:anon-${toString n}" x;
             |                      ^
          412|             collectedImports = collectStructuredModules module._file module.key module.imports args;

       … while evaluating anonymous lambda

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:428:31:

          427|           disabledKeys = map moduleKey disabled;
          428|           keyFilter = filter (attrs: ! elem attrs.key disabledKeys);
             |                               ^
          429|         in map (attrs: attrs.module) (builtins.genericClosure {

       … from call site

       … while evaluating 'filterModules'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:424:36:

          423|       # modules recursively. It returns the final list of unique-by-key modules
          424|       filterModules = modulesPath: { disabled, modules }:
             |                                    ^
          425|         let

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:435:7:

          434|     in modulesPath: initialModules: args:
          435|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);
             |       ^
          436|

       … while evaluating anonymous lambda

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:434:37:

          433|
          434|     in modulesPath: initialModules: args:
             |                                     ^
          435|       filterModules modulesPath (collectStructuredModules unknownModule "" initialModules args);

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:280:25:

          279|       merged =
          280|         let collected = collectModules
             |                         ^
          281|           (specialArgs.modulesPath or "")

       … while evaluating 'reverseList'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/lists.nix:394:17:

          393|   */
          394|   reverseList = xs:
             |                 ^
          395|     let l = length xs; in genList (n: elemAt xs (l - n - 1)) l;

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:284:33:

          283|           ({ inherit lib options config specialArgs; } // specialArgs);
          284|         in mergeModules prefix (reverseList collected);
             |                                 ^
          285|

       … while evaluating 'byName'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:550:25:

          549|       */
          550|       byName = attr: f: modules:
             |                         ^
          551|         zipAttrsWith (n: concatLists)

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:567:21:

          566|       # an attrset 'name' => list of submodules that declare ‘name’.
          567|       declsByName = byName "options" (module: option:
             |                     ^
          568|           [{ inherit (module) _file; options = option; }]

       … while evaluating the attribute 'matchedOptions'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:646:14:

          645|     in {
          646|       inherit matchedOptions;
             |              ^
          647|

       … while evaluating 'mapAttrsRecursiveCond'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/attrsets.nix:393:36:

          392|   */
          393|   mapAttrsRecursiveCond = cond: f: set:
             |                                    ^
          394|     let

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:292:28:

          291|           # For definitions that have an associated option
          292|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                            ^
          293|

       … while evaluating the attribute 'options'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/modules.nix:356:9:

          355|       result = withWarnings {
          356|         options = checked options;
             |         ^
          357|         config = checked (removeAttrs config [ "_module" ]);

       … while evaluating 'isType'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/types.nix:71:18:

           70| rec {
           71|   isType = type: x: (x._type or "") == type;
             |                  ^
           72|

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/attrsets.nix:279:8:

          278|   collect = pred: attrs:
          279|     if pred attrs then
             |        ^
          280|       [ attrs ]

       … while evaluating 'collect'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/attrsets.nix:278:19:

          277|   */
          278|   collect = pred: attrs:
             |                   ^
          279|     if pred attrs then

       … from call site

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/options.nix:247:67:

          246|         # builtins.trace opt.loc
          247|         [ docOption ] ++ optionals subOptionsVisible subOptions) (collect isOption options);
             |                                                                   ^
          248|

       … while evaluating 'optionAttrSetToDocList''

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/options.nix:219:37:

          218|
          219|   optionAttrSetToDocList' = prefix: options:
             |                                     ^
          220|     concatMap (opt:

       … from call site

       at /nix/store/x8agwrqz5cady34y537432xscifm70y6-nixos/lib/make-options-doc/default.nix:54:13:

           53|
           54|   rawOpts = lib.optionAttrSetToDocList options;
             |             ^
           55|   transformedOpts = map transformOptions rawOpts;

       … while evaluating 'flip'

       at /nix/store/z0hyg10hbcx1wcr7v9n8qzmmhsw0wfd4-lib/trivial.nix:138:16:

          137|   */
          138|   flip = f: a: b: f b a;
             |                ^
          139|

       … from call site

       at /nix/store/x8agwrqz5cady34y537432xscifm70y6-nixos/lib/make-options-doc/default.nix:57:17:

           56|   filteredOpts = lib.filter (opt: opt.visible && !opt.internal) transformedOpts;
           57|   optionsList = lib.flip map filteredOpts
             |                 ^
           58|    (opt: opt

       … while evaluating the attribute 'optionsNix'

       at /nix/store/x8agwrqz5cady34y537432xscifm70y6-nixos/lib/make-options-doc/default.nix:103:10:

          102| in rec {
          103|   inherit optionsNix;
             |          ^
          104|

       … while evaluating the attribute 'optionsNix'

       at /nix/store/x8agwrqz5cady34y537432xscifm70y6-nixos/doc/manual/default.nix:177:23:

          176|
          177|   inherit (optionsDoc) optionsJSON optionsNix optionsDocBook;
             |                       ^
          178|

       … while evaluating anonymous lambda

       at /nix/store/x8agwrqz5cady34y537432xscifm70y6-nixos/lib/eval-cacheable-options.nix:1:1:

            1| { libPath
             | ^
            2| , pkgsLibPath

       … from call site
Cacheable portion of option doc build failed.
Usually this means that an option attribute that ends up in documentation (eg `default` or `description`) depends on the restricted module arguments `config` or `pkgs`.

Rebuild your configuration with `--show-trace` to find the offending location. Remove the references to restricted arguments (eg by escaping their antiquotations or adding a `defaultText`) or disable the sandboxed build for the failing module by setting `meta.buildDocsInSandbox = false`.

metadata

  • system: "x86_64-linux"
  • host os: Linux 5.17.7-zen1, NixOS, 22.05 (Quokka)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.8.1
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants