Repository: conda/conda-build

Issue:
Checksumming a directory?
The new 'checksum all the things' stuff is going a bit too far:


```
_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/libpanelw.5.dylib
install_name_tool -add_rpath @loader_path/ /Users/ray/mc-x64-2.7/conda-bld/ncurses_1479738958440/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/libpanelw.5.dylib
Traceback (most recent call last):
  File "/Users/ray/mc-x64-2.7/bin/conda-build", line 11, in <module>
    load_entry_point('conda-build==0+unknown', 'console_scripts', 'conda-build')()
  File "/Users/ray/mc-x64-2.7/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 247, in main
    execute(sys.argv[1:])
  File "/Users/ray/mc-x64-2.7/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 239, in execute
    already_built=None, config=config, noverify=args.no_verify)
  File "/Users/ray/mc-x64-2.7/lib/python2.7/site-packages/conda_build/api.py", line 77, in build
    need_source_download=need_source_download, config=config)
  File "/Users/ray/mc-x64-2.7/lib/python2.7/site-packages/conda_build/build.py", line 1199, in build_tree
    config=recipe_config)
  File "/Users/ray/mc-x64-2.7/lib/python2.7/site-packages/conda_build/build.py", line 893, in build
    create_info_files(m, pkg_files, config=config, prefix=config.build_prefix)
  File "/Users/ray/mc-x64-2.7/lib/python2.7/site-packages/conda_build/build.py", line 442, in create_info_files
    create_info_files_json(m, config.info_dir, prefix, files, files_with_prefix)
  File "/Users/ray/mc-x64-2.7/lib/python2.7/site-packages/conda_build/build.py", line 541, in create_info_files_json
    files_json_files = build_info_files_json(m, prefix, files, files_with_prefix)
  File "/Users/ray/mc-x64-2.7/lib/python2.7/site-packages/conda_build/build.py", line 517, in build_info_files_json
    "sha256": sha256_checksum(path),
  File "/Users/ray/mc-x64-2.7/lib/python2.7/site-packages/conda_build/build.py", line 475, in sha256_checksum
    with open(filename, 'rb') as f:
IOError: [Errno 21] Is a directory: '/Users/ray/mc-x64-2.7/conda-bld/ncurses_1479738958440/_b_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/lib/terminfo'
2.7/bin/conda-build --python 27 --numpy 111 --no-activate /Volumes/VMware Shared Folders/conda/anaconda/packages/ncurses
Traceback (most recent call last):
  File "/Users/ray/mc-x64-2.7/bin/build", line 11, in <module>
    load_entry_point('abts', 'console_scripts', 'build')()
  File "/Volumes/VMware Shared Folders/conda/anaconda/bt/build.py", line 484, in main
    build(pkg, only_build = opts.only_build)
  File "/Volumes/VMware Shared Folders/conda/anaconda/bt/build.py", line 343, in build
    build(p)
  File "/Volumes/VMware Shared Folders/conda/anaconda/bt/build.py", line 356, in build
    conda_build(pkg)
  File "/Volumes/VMware Shared Folders/conda/anaconda/bt/build.py", line 291, in conda_build
    check_call(cmd, env=env)
  File "/Users/ray/mc-x64-2.7/lib/python2.7/subprocess.py", line 541, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/Users/ray/mc-x64-2.7/bin/python', '/Users/ray/mc-x64-2.7/bin/conda-build', '--python', '27', '--numpy', '111', '--no-activate', '/Volumes/VMware Shared Folders/conda/anaconda/packages/ncurses']' returned non-zero exit status 1****
```


Discussion:

Resolving patch:
diff --git a/conda_build/build.py b/conda_build/build.py
--- a/conda_build/build.py
+++ b/conda_build/build.py
@@ -470,6 +470,8 @@ def get_short_path(m, target_file):
 
 
 def sha256_checksum(filename, buffersize=65536):
+    if not isfile(filename):
+        return None
     sha256 = hashlib.sha256()
     with open(filename, 'rb') as f:
         for block in iter(lambda: f.read(buffersize), b''):


Test patch: