Repository: conda/conda

Issue:
recursion problem or infinite loop in dependency solver
I am executing this command:

``` bash
/opt/wakari/miniconda/bin/conda update --dry-run -c https://conda.anaconda.org/wakari/channel/release:0.8.0 -p /opt/wakari/wakari-server --all
```

And it appears to loop "forever" (well, for a few minutes, at least", stating again and again:

``` bash
Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping
Solving package specifications: 
Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping
Solving package specifications: 
Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping
Solving package specifications: 
Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping
Solving package specifications: 
Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping
Solving package specifications: 
```

(you get the point), and then when I finally `CTRL-C` to abort, the stack-trace suggests a recursion problem:

``` python
Solving package specifications: 
Warning: Could not find some dependencies for wakari-enterprise-server-conf: wakari-server >=1.8.0, skipping
^CTraceback (most recent call last):
  File "/opt/wakari/miniconda/bin/conda", line 5, in <module>
    sys.exit(main())
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 194, in main
    args_func(args, p)
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/main.py", line 201, in args_func
    args.func(args, p)
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/main_update.py", line 38, in execute
    install.install(args, parser, 'update')
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 358, in install
    return install(args, parser, command=command)

... REPEATED MANY TIMES ...

  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 358, in install
    return install(args, parser, command=command)
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 358, in install
    return install(args, parser, command=command)
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/cli/install.py", line 337, in install
    minimal_hint=args.alt_hint)
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/plan.py", line 402, in install_actions
    config.track_features, minimal_hint=minimal_hint):
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 726, in solve
    for pkg in self.get_pkgs(ms, max_only=max_only):
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/utils.py", line 142, in __call__
    res = cache[key] = self.func(*args, **kw)
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 261, in get_pkgs
    pkgs = [Package(fn, self.index[fn]) for fn in self.find_matches(ms)]
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 168, in __init__
    self.norm_version = normalized_version(self.version)
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/resolve.py", line 28, in normalized_version
    return verlib.NormalizedVersion(version)
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/verlib.py", line 93, in __init__
    self._parse(s, error_on_huge_major_num)
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/verlib.py", line 110, in _parse
    block = self._parse_numdots(groups['version'], s, False, 2)
  File "/opt/wakari/miniconda/lib/python2.7/site-packages/conda/verlib.py", line 159, in _parse_numdots
    if len(n) > 1 and n[0] == '0':
KeyboardInterrupt
```



Discussion:
This is with conda 3.16.0:

``` bash
/opt/wakari/miniconda/bin/conda -V
conda 3.16.0
```

I see the problem. It's trying to ignore `wakari-server` but it really should be ignoring `wakari-enterprise-server-conf`.


Resolving patch:
diff --git a/conda/resolve.py b/conda/resolve.py
--- a/conda/resolve.py
+++ b/conda/resolve.py
@@ -309,7 +309,7 @@ def add_dependents(fn1, max_only=False):
 
                 if not found:
                     raise NoPackagesFound("Could not find some dependencies "
-                        "for %s: %s" % (ms, ', '.join(notfound)), notfound)
+                        "for %s: %s" % (ms, ', '.join(notfound)), [ms.spec] + notfound)
 
         add_dependents(root_fn, max_only=max_only)
         return res
@@ -426,7 +426,7 @@ def get_dists(self, specs, max_only=False):
                     dists[pkg.fn] = pkg
                     found = True
             if not found:
-                raise NoPackagesFound("Could not find some dependencies for %s: %s" % (spec, ', '.join(notfound)), notfound)
+                raise NoPackagesFound("Could not find some dependencies for %s: %s" % (spec, ', '.join(notfound)), [spec] + notfound)
 
         return dists
 


Test patch: