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

Infinite recursion encountered after updating nixpkgs #281

Closed
basvandijk opened this issue Apr 9, 2015 · 42 comments
Closed

Infinite recursion encountered after updating nixpkgs #281

basvandijk opened this issue Apr 9, 2015 · 42 comments

Comments

@basvandijk
Copy link
Member

I just updated my nixpkgs to NixOS/nixpkgs@1035b7b and now most nixops commands detect an infinite recursion which seems to start at the nixops ec2.nix file at line 405. For example:

./nixops-HEAD show-physical -d stalling-net --show-trace
error: while evaluating the attribute ‘config.deployment’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/attrsets.nix":135:44:
while evaluating anonymous function at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/options.nix":122:41, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/attrsets.nix":135:52:
while evaluating ‘scrubOptionValue’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/options.nix":118:22, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/options.nix":122:44:
while evaluating ‘isDerivation’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/attrsets.nix":222:18, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/options.nix":119:8:
while evaluating the attribute ‘"${attr}"’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/nixos/lib/eval-config.nix":50:5:
while evaluating the attribute ‘config’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":82:25:
while evaluating ‘yieldConfig’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":69:29, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":68:16:
while evaluating the attribute ‘_module.check.value’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":266:9:
while evaluating the option `_module.check':
while evaluating ‘id’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/trivial.nix":4:8, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":264:15:
while evaluating the attribute ‘isDefined’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":298:9:
while evaluating ‘processOrder’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":284:26, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":290:11:
while evaluating ‘fold’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":20:19, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":286:16:
while evaluating ‘fold'’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":23:15, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":27:8:
while evaluating ‘processOverride’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":281:29, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":290:25:
while evaluating ‘filterOverrides’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":369:21, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":281:35:
while evaluating ‘concatMap’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":54:18, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":376:8:
while evaluating ‘processIfAndMerge’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":276:31, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":290:42:
while evaluating ‘concatMap’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":54:18, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":276:37:
while evaluating ‘concatMap’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":54:18, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":162:8:
while evaluating anonymous function at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":162:19, called from undefined position:
while evaluating ‘pushDownProperties’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":319:24, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":162:75:
while evaluating the attribute ‘config’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":111:11:
while evaluating the attribute ‘config’ at "/nix/store/n7rbrmd88qk0y5z7djg431cp9abz09zk-nixops-HEAD/share/nix/nixops/ec2.nix":405:3:
infinite recursion encountered
error: evaluation of the deployment specification failed

Note I'm also using the latest nixops (372333a).

@rbvermaa Could it have something todo with: NixOS/nixpkgs@824fccd ?

@aszlig
Copy link
Member

aszlig commented Apr 9, 2015

Can you please have a look at #280 and check whether it fixes your issue?

@basvandijk
Copy link
Member Author

Thanks for the quick reply. I merged aszlig@fb21be5 and now I'm getting the infinite recursion in another place than before:

./nixops-HEAD show-physical -d stalling-net --show-trace                                                                                                                                                                                                             [master] 
trace: Obsolete option `environment.checkConfigurationOptions' is used. It was renamed to `_module.check'.
error: while evaluating the attribute ‘config.deployment’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/attrsets.nix":135:44:
while evaluating anonymous function at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/options.nix":122:41, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/attrsets.nix":135:52:
while evaluating ‘scrubOptionValue’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/options.nix":118:22, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/options.nix":122:44:
while evaluating ‘isDerivation’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/attrsets.nix":222:18, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/options.nix":119:8:
while evaluating the attribute ‘"${attr}"’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/nixos/lib/eval-config.nix":50:5:
while evaluating the attribute ‘config’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":82:25:
while evaluating ‘yieldConfig’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":69:29, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":68:16:
while evaluating the attribute ‘_module.check.value’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":266:9:
while evaluating the option `_module.check':
while evaluating ‘id’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/trivial.nix":4:8, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":264:15:
while evaluating the attribute ‘isDefined’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":298:9:
while evaluating ‘processOrder’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":284:26, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":290:11:
while evaluating ‘fold’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":20:19, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":286:16:
while evaluating ‘fold'’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":23:15, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":27:8:
while evaluating ‘processOverride’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":281:29, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":290:25:
while evaluating ‘filterOverrides’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":369:21, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":281:35:
while evaluating ‘concatMap’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":54:18, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":376:8:
while evaluating ‘processIfAndMerge’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":276:31, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":290:42:
while evaluating ‘concatMap’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":54:18, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":276:37:
while evaluating ‘concatMap’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/lists.nix":54:18, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":162:8:
while evaluating anonymous function at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":162:19, called from undefined position:
while evaluating ‘pushDownProperties’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":319:24, called from "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":162:75:
while evaluating the attribute ‘config’ at "/home/bas.van.dijk/engineering/lumi/nixpkgs/lib/modules.nix":111:11:
while evaluating the attribute ‘config’ at "/home/bas.van.dijk/engineering/lumi/deployment/modules/facility/server.nix":186:3:
infinite recursion encountered
error: evaluation of the deployment specification failed

The offending line is nothing special and worked before:

  config = mkIf cfg.enable { ... }

@aszlig
Copy link
Member

aszlig commented Apr 9, 2015

@basvandijk: Are you using references to pkgs.lib somewhere in your deployment?

@edolstra
Copy link
Member

edolstra commented Apr 9, 2015

Does that module do something like:

with pkgs.lib;

? That no longer works, you have to say with lib; (and add lib as a module argument).

@basvandijk
Copy link
Member Author

Yes I had that line, after removing it the infinite recursion is gone. Thanks.

However I now get the following error:

./nixops-HEAD show-physical -d stalling-net --show-trace                                             [master] 
trace: Obsolete option `environment.checkConfigurationOptions' is used. It was renamed to `_module.check'.
trace: Obsolete option `environment.checkConfigurationOptions' is used. It was renamed to `_module.check'.
trace: Obsolete option `environment.checkConfigurationOptions' is used. It was renamed to `_module.check'.
trace: Obsolete option `environment.checkConfigurationOptions' is used. It was renamed to `_module.check'.
trace: Obsolete option `environment.checkConfigurationOptions' is used. It was renamed to `_module.check'.
trace: Obsolete option `environment.checkConfigurationOptions' is used. It was renamed to `_module.check'.
trace: Obsolete option `environment.checkConfigurationOptions' is used. It was renamed to `_module.check'.
trace: Obsolete option `environment.checkConfigurationOptions' is used. It was renamed to `_module.check'.
trace: Obsolete option `environment.checkConfigurationOptions' is used. It was renamed to `_module.check'.
trace: lib.zip is deprecated, use lib.zipAttrsWith instead
trace: `mkStrict' is obsolete; use `mkOverride 0' instead.
trace: `types.list' is deprecated; use `types.listOf' instead
error: deepOverride not yet supported for functors
error: evaluation of the deployment specification failed

@edolstra
Copy link
Member

edolstra commented Apr 9, 2015

@nbp Any idea?

@aszlig
Copy link
Member

aszlig commented Apr 9, 2015

@basvandijk: Can you re-run show-physical with --debug, please? (please check twice for any secrets)

@basvandijk
Copy link
Member Author

--debug doesn't show anything more than without it.

@aszlig
Copy link
Member

aszlig commented Apr 9, 2015

Ah, never mind, it actually shows the expression as XML but coming from NixOS-instantiate, and doesn't show the generated input expression though. Setting debug to True in nixops/deployment.py however should show the generated expression.

@basvandijk
Copy link
Member Author

Setting debug = True also doesn't show anything more which means that nix-instantiate is failing in the evaluate function:

            xml = subprocess.check_output(
                ["nix-instantiate"]
                + self.extra_nix_eval_flags
                + self._eval_flags(self.nix_exprs) +
                ["--eval-only", "--xml", "--strict",
                 "--arg", "checkConfigurationOptions", "false",
                 "-A", "info"], stderr=self.logger.log_file)

The actual nix-instantiate call in my case resolves to:

nix-instantiate \
  -I .. \
  -I /home/bas.van.dijk/engineering/lumi \
  -I nixops=/nix/store/a4h8z1phg739ymb1sm9g2bd7xs7y3v1r-nixops-HEAD/share/nix/nixops \
  --arg networkExprs \
    [ "/home/bas.van.dijk/engineering/lumi/deployment/stalling-net.nix" \
      "/home/bas.van.dijk/engineering/lumi/deployment/stalling-net-hardware.nix" ] \
  --arg args {} \
  --argstr uuid 877934f8-a70b-11e4-8d76-08002734fdef \
  <nixops/eval-machine-info.nix> \
  --eval-only \
  --xml \
  --strict \
  --arg checkConfigurationOptions false \
  -A info

@basvandijk
Copy link
Member Author

Regarding the error:

error: deepOverride not yet supported for functors

which is thrown from overrideDerivation in customisation.nix:71, the deepOverride function only seems to be called in lib/customisation.nix:77:

  deepOverrider = newArgs: name: x: if builtins.isAttrs x then (
    if x ? deepOverride then (x.deepOverride newArgs) else
    if x ? override then (x.override newArgs) else
    x) else x;

The strange thing is that it's preceded by a builtins.isAttrs x check which guarantees x is not a function. So I'm not sure why I'm getting this error.

@basvandijk
Copy link
Member Author

So maybe this is caused by: NixOS/nixpkgs@8921a8f.

@shlevy the commit message speaks about a too old nix version. My nixops is using:

nix-instantiate --version
nix-instantiate (Nix) 1.8

Could that be the problem?

@edolstra
Copy link
Member

edolstra commented Apr 9, 2015

1.8 should be new enough. All those trace messages suggest something else is going on, such as a deep evaluation of the lib attribute set. For instance, that would trigger the mkStrict warning - mkStrict isn't explicitly called anywhere in Nixpkgs.

@basvandijk
Copy link
Member Author

Indeed, I tried it with Nix-1.9pre4088_1711679 and that gives the same error.

So I guess the best place to start debugging this possible lib deep evaluation is to find all references to lib in nixpkgs and nixops and see how they are used.

@nbp
Copy link
Member

nbp commented Apr 9, 2015

@basvandijk , Do you have a definition of environment.checkConfigurationOptions which is under a mkIf, or which depends on another option definitions?

@nbp
Copy link
Member

nbp commented Apr 9, 2015

oh, I guess the obsolete messages are coming from https://github.com/NixOS/nixops/blob/master/nix/eval-machine-info.nix#L58

@basvandijk
Copy link
Member Author

Indeed. The warnings are now fixed by a patch from @edolstra.

The error remains though:

trace: lib.zip is deprecated, use lib.zipAttrsWith instead
trace: `mkStrict' is obsolete; use `mkOverride 0' instead.
trace: `types.list' is deprecated; use `types.listOf' instead
error: deepOverride not yet supported for functors
error: evaluation of the deployment specification failed

@luke-clifton
Copy link

I'm experiencing the same problem trying to deploy to AWS.

trace: lib.zip is deprecated, use lib.zipAttrsWith instead
trace: `mkStrict' is obsolete; use `mkOverride 0' instead.
trace: `types.list' is deprecated; use `types.listOf' instead
error: deepOverride not yet supported for functors

@basvandijk
Copy link
Member Author

Indeed it only seems to occur for ec2 targets. I tested deployments with virtualbox and hetnzer and they work fine.

The following is a minimal test case that fails:

let aws = {
      region = "<YOUR EC2 REGION>"; 
      accessKeyId = "<YOUR AWS ACCESS KEY ID>";
    };
in {
  network.description = "Debug network";
  debug = { config, pkgs, resources, ... }: {
    deployment = {
      targetEnv = "ec2";
      ec2 = {
        inherit (aws) region accessKeyId;
        keyPair = resources.ec2KeyPairs.nixops-keypair;
        instanceType           = "m3.large";
        ebsBoot                = true;
        ebsInitialRootDiskSize = 32; #GB
      };
    };
  };
  resources = {
    ec2KeyPairs.nixops-keypair = {
      inherit (aws) region accessKeyId;
      name = "nixops-keypair";
    };
  };
}

@basvandijk
Copy link
Member Author

gce targets also fail but without the deprecation warnings and the "deepOverride not yet supported for functors" error:

$ echo '{ gce={...}: { deployment.targetEnv = "gce"; } ;}' > gce.nix                                                             

$ ./nixops-HEAD create -d debug -I .. gce.nix                                                                             
created deployment ‘3880f3ee-e269-11e4-bf36-08002734fdef’
3880f3ee-e269-11e4-bf36-08002734fdef

$ ./nixops-HEAD deploy --build-only -d debug -I ..                                                                        
error: evaluation of the deployment specification failed

@luke-clifton
Copy link

Yes, I posted a separate issue about that here #282.

@basvandijk
Copy link
Member Author

When I set resources.ec2KeyPairs to {} in eval-machine-info.nix:78 the error disappears.

@shlevy any idea why that line is causing the trouble?

@shlevy
Copy link
Member

shlevy commented Apr 14, 2015

@basvandijk No idea, sorry. No code calling deepOverride on a function ever should have worked before, so even though that error message is from my code I'm not sure what's changed to hit that path.

@basvandijk
Copy link
Member Author

Ok. It definitely seems to come from the evalResources function.

@offlinehacker
Copy link

The problem is because it tries to evaluate whole nixpkgs

@shlevy
Copy link
Member

shlevy commented Apr 20, 2015

Don't have time to look into this right now, but IIRC there was some code to filter out specific values from the module evaluation before serializing to XML. @edolstra Is that maybe the culprit here, some new value that hasn't been filtered out?

@offlinehacker
Copy link

Meh, i can't deploy on ec2 now, what's advised workaround?

@offlinehacker
Copy link

So is this nix or nixops related issue?

@offlinehacker
Copy link

Ok, workaround for me was reverting new module system NixOS/nixpkgs#2540

@teh
Copy link
Contributor

teh commented Apr 23, 2015

I'm stuck on this, too. Reverted to the old module system for now. Unfortunately no minimal test because our deployment is so big and hard to boil down to something small.

@copumpkin
Copy link
Member

I'm not sure if this is relevant, and I don't understand why it fixes things, but I've had some luck on my EC2 instances by emulating this commit in my configuration.nix.

@oconnorr
Copy link
Contributor

Me too. I'm trying to GCE deployment with the latest and greatest:

$ readlink `which nixops`
/nix/store/7bg21lxfdlha9bfcxcimnff1a1aw4xjb-nixops-1.3pre1362_2a616f8/bin/nixops

$ NIX_PATH=nixpkgs=/home/oconnorr/nixpkgs nixops deploy -d trivial --show-trace
error: while evaluating the attribute �config.deployment� at "/home/oconnorr/nixpkgs/lib/attrsets.nix":135:44:
while evaluating anonymous function at "/home/oconnorr/nixpkgs/lib/options.nix":122:41, called from "/home/oconnorr/nixpkgs/lib/attrsets.nix":135:52:
while evaluating �scrubOptionValue� at "/home/oconnorr/nixpkgs/lib/options.nix":118:22, called from "/home/oconnorr/nixpkgs/lib/options.nix":122:44:
while evaluating �isDerivation� at "/home/oconnorr/nixpkgs/lib/attrsets.nix":222:18, called from "/home/oconnorr/nixpkgs/lib/options.nix":119:8:
while evaluating the attribute �"${attr}"� at "/home/oconnorr/nixpkgs/nixos/lib/eval-config.nix":50:5:
while evaluating the attribute �config� at "/home/oconnorr/nixpkgs/lib/modules.nix":82:25:
while evaluating �yieldConfig� at "/home/oconnorr/nixpkgs/lib/modules.nix":69:29, called from "/home/oconnorr/nixpkgs/lib/modules.nix":68:16:
while evaluating the attribute �_module.check.value� at "/home/oconnorr/nixpkgs/lib/modules.nix":266:9:
while evaluating the option `_module.check':
while evaluating �id� at "/home/oconnorr/nixpkgs/lib/trivial.nix":4:8, called from "/home/oconnorr/nixpkgs/lib/modules.nix":264:15:
while evaluating the attribute �isDefined� at "/home/oconnorr/nixpkgs/lib/modules.nix":298:9:
while evaluating �processOrder� at "/home/oconnorr/nixpkgs/lib/modules.nix":284:26, called from "/home/oconnorr/nixpkgs/lib/modules.nix":290:11:
while evaluating �fold� at "/home/oconnorr/nixpkgs/lib/lists.nix":20:19, called from "/home/oconnorr/nixpkgs/lib/modules.nix":286:16:
while evaluating �fold'� at "/home/oconnorr/nixpkgs/lib/lists.nix":23:15, called from "/home/oconnorr/nixpkgs/lib/lists.nix":27:8:
while evaluating �processOverride� at "/home/oconnorr/nixpkgs/lib/modules.nix":281:29, called from "/home/oconnorr/nixpkgs/lib/modules.nix":290:25:
while evaluating �filterOverrides� at "/home/oconnorr/nixpkgs/lib/modules.nix":369:21, called from "/home/oconnorr/nixpkgs/lib/modules.nix":281:35:
while evaluating �concatMap� at "/home/oconnorr/nixpkgs/lib/lists.nix":54:18, called from "/home/oconnorr/nixpkgs/lib/modules.nix":376:8:
while evaluating �processIfAndMerge� at "/home/oconnorr/nixpkgs/lib/modules.nix":276:31, called from "/home/oconnorr/nixpkgs/lib/modules.nix":290:42:
while evaluating �concatMap� at "/home/oconnorr/nixpkgs/lib/lists.nix":54:18, called from "/home/oconnorr/nixpkgs/lib/modules.nix":276:37:
while evaluating �concatMap� at "/home/oconnorr/nixpkgs/lib/lists.nix":54:18, called from "/home/oconnorr/nixpkgs/lib/modules.nix":162:8:
while evaluating anonymous function at "/home/oconnorr/nixpkgs/lib/modules.nix":162:19, called from undefined position:
while evaluating �pushDownProperties� at "/home/oconnorr/nixpkgs/lib/modules.nix":319:24, called from "/home/oconnorr/nixpkgs/lib/modules.nix":162:75:
while evaluating the attribute �config� at "/home/oconnorr/nixpkgs/lib/modules.nix":111:11:
while evaluating the attribute �config� at "/nix/store/kslm406j6b8gl9k43lvdsxwdz5i7xbpc-nixops-1.3pre1362_2a616f8/share/nix/nixops/libvirtd.nix":85:3:
infinite recursion encountered
error: evaluation of the deployment specification failed

@rbvermaa
Copy link
Member

Seems to be related to #284

@rbvermaa
Copy link
Member

@oconnorr I was able to reproduce your issue and fix it by pushing NixOS/nixpkgs@ad0bd73 .

@oconnorr
Copy link
Contributor

Strange. Rob, I merged in your change into my repository, but I still have the same error.

@edolstra
Copy link
Member

Well, the infinite recursion can be triggered in many different ways. For instance, if you have a module that uses with pkgs.lib.

@oconnorr
Copy link
Contributor

My trivial-gce.nix is very trivial:

let credentials = {
      project = "[REDACTED]";
      serviceAccount = "[REDACTED]";
      accessKey = "/home/oconnorr/PRIV.pem";
  }; in
{ 
  resources.gceImages.bootstrap = credentials // {
    sourceUri = "gs://[REDACTED]/nixos-15.05pre-git-x86_64-linux.raw.tar.gz";
  };
  machine = { config, pkgs, ...}:
  { deployment.targetEnv = "gce";
    deployment.gce = credentials // {
      rootDiskSize = 100;
      # instance properties
      region = "us-central1-b";
      instanceType = "g1-small";
      tags = [];
      scheduling.automaticRestart = true;
      scheduling.onHostMaintenance = "MIGRATE";
    } ;
  };
}

@oconnorr
Copy link
Contributor

There is a "with pkgs.lib" in /nix/store/kslm406j6b8gl9k43lvdsxwdz5i7xbpc-nixops-1.3pre1362_2a616f8/share/nix/nixops/libvirtd.nix

Do I have to rebuild nixops? What is the best way of doing that? Running

$ NIX_PATH=nixpkgs=/home/oconnorr/nixpkgs nix-env -f "<nixpkgs>" -iA nixopsUnstable

isn't sufficent.

@basvandijk
Copy link
Member Author

@oconnorr I have the following setup for running nixops-HEAD:

I have the following nixops-HEAD script in my project:

#!/usr/bin/env bash

cmd="nixops"
for var in "$@"
do
  cmd="${cmd} \"$var\""
done

nix-shell nixops-HEAD-env.nix -I .. --command "$cmd"

nixops-HEAD-env.nix is defined as:

# This file adds nixops-HEAD to the environment so we can
# benefit from the latest bug-fixes.
#
# It depends on the source of nixops to be in the ./nixops directory.
#
# We currently have nixops checked out in ./nixops as a git submodule.

{ pkgs ? import <nixpkgs> {} }:

let nixopsUnstable = pkgs.callPackage
      <nixpkgs/pkgs/tools/package-management/nixops/unstable.nix> {};

    nixopsHEAD = pkgs.stdenv.lib.overrideDerivation nixopsUnstable (oldAttrs: {
      name = "nixops-HEAD";
      src = ./nixops;
      patches = [];
    });

in
pkgs.myEnvFun {
  name = "nixops-HEAD";
  buildInputs = [
    nixopsHEAD
  ];
}

@maatthc
Copy link

maatthc commented May 15, 2015

Replacing the version worked for me:

nix-install-package --non-interactive --url http://hydra.nixos.org/build/21990677/nix/pkg/nixops-1.3pre1482_17611f5-x86_64-darwin.nixpkg

@oconnorr
Copy link
Contributor

Things seem to be working for me now.

@basvandijk
Copy link
Member Author

It's also working for me these days so I'm closing the issue. Thanks for your help everybody!

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

No branches or pull requests