Repository: conda/conda-build

Issue:
conda build 2.1.6 sporadic failures
After updating 2.1.5 to 2.1.6, I now have sporadic (non reproductible) failures with conda build

```bash
RuntimeError: Can't build <whatever> due to unsatisfiable dependencies:

Packages/dependencies missing in current linux-64 channels: 
  - openssl
  - zlib
  - ...
```
, only on dependencies provided with the conda distribution (e.g. xz, zlib, ...)

Very annoying on running nightly builds (sometimes crashing, sometimes not)

Any clues on where to look (changes between versions) ?

conda --version is 4.3.14

thanks


Discussion:
That's very strange.  That message comes from https://github.com/conda/conda-build/blob/2.1.x/conda_build/build.py#L1530-L1538 - I'm guessing that some Conda Error is happening in https://github.com/conda/conda-build/blob/2.1.x/conda_build/build.py#L1506 and that terribly large catch-all is goofing up on some sporadic conda error (like a connection error to anaconda.org?) and then rather than showing that error, it's trying to treat it like a package it should try to build.  How often are you seeing the failures?  Every build?  One in 5?  One in ten?  Any reproducible test case at all?
Thanks I will try to look further into this,

I don't know if it is related but another issue poped in

```bash
$ conda inspect linkages <whatever>

Traceback (most recent call last):
  File "<...>/bin/conda-inspect", line 6, in <module>
    sys.exit(conda_build.cli.main_inspect.main())
  File "<...>/lib/python3.6/site-packages/conda_build/cli/main_inspect.py", line 190, in main
    return execute(sys.argv[1:])
  File "<...>lib/python3.6/site-packages/conda_build/cli/main_inspect.py", line 179, in execute
    show_files=args.show_files, groupby=args.groupby))
  File "<...>/lib/python3.6/site-packages/conda_build/api.py", line 251, in inspect_linkages
    show_files=show_files, groupby=groupby)
  File "<..>/lib/python3.6/site-packages/conda_build/inspect.py", line 271, in inspect_linkages
    output_string += print_linkages(pkgmap[pkg], show_files=show_files)
  File "<...>conda3/lib/python3.6/site-packages/conda_build/inspect.py", line 119, in print_linkages
    for lib, path in sorted(set(map(itemgetter(0, 1), depmap[dep]))):
KeyError: 'system'
```

Also appeared when upgrading 2.1.5 to 2.1.6

I don't understand the logic of 
```python
k = sorted(set(depmap.keys()) - {'system', 'not found'})
all_deps = k if 'not found' not in depmap.keys() else k + ['system', 'not found']
```
in print_linkages (inspect.py)

Should I open another issue ?
Just as an update, upgrading anaconda 4.3.0 to anaconda 4.3.1 reduces the number of failures, without making them disappear. 

for the conda inspect error, I patched the file inspect.py
```python
linkages = get_linkages(obj_files, prefix)
depmap = defaultdict(list)
pkgmap[pkg] = depmap
depmap['not found'] = []
depmap['system'] = []   # <-- prevents conda inspect failure when no system linkage
for binary in linkages:
```

Resolving patch:
diff --git a/conda_build/inspect.py b/conda_build/inspect.py
--- a/conda_build/inspect.py
+++ b/conda_build/inspect.py
@@ -237,6 +237,7 @@ def inspect_linkages(packages, prefix=sys.prefix, untracked=False,
         depmap = defaultdict(list)
         pkgmap[pkg] = depmap
         depmap['not found'] = []
+        depmap['system'] = []
         for binary in linkages:
             for lib, path in linkages[binary]:
                 path = replace_path(binary, path, prefix) if path not in {'',


Test patch: