Repository: conda/conda

Issue:
conda build - exception - padding error
I just updated to the lastest conda-build in defaults, and latest conda conda-env in conda canary, when I run conda build I am getting a 'package error'. Here is my conda environemnt:

```
           platform : linux-64
      conda version : 4.2.5
   conda is private : False
  conda-env version : 2.6.0
conda-build version : 2.0.1
     python version : 2.7.12.final.0
   requests version : 2.10.0
   root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7  (writable)
default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7
   envs directories : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs
      package cache : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs
       channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel7/linux-64/
                      file:///reg/g/psdm/sw/conda/channels/system-rhel7/noarch/
                      file:///reg/g/psdm/sw/conda/channels/psana-rhel7/linux-64/
                      file:///reg/g/psdm/sw/conda/channels/psana-rhel7/noarch/
                      file:///reg/g/psdm/sw/conda/channels/external-rhel7/linux-64/
                      file:///reg/g/psdm/sw/conda/channels/external-rhel7/noarch/
                      https://repo.continuum.io/pkgs/free/linux-64/
                      https://repo.continuum.io/pkgs/free/noarch/
                      https://repo.continuum.io/pkgs/pro/linux-64/
                      https://repo.continuum.io/pkgs/pro/noarch/
                      https://conda.anaconda.org/scikit-beam/linux-64/
                      https://conda.anaconda.org/scikit-beam/noarch/
                      file:///reg/g/psdm/sw/conda/channels/testing-rhel7/linux-64/
                      file:///reg/g/psdm/sw/conda/channels/testing-rhel7/noarch/
        config file : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/.condarc
       offline mode : False
```

and here is the build output

```
SIT_ARCH=x86_64-rhel7-gcc48-opt conda build  -c file:///reg/g/psdm/sw/conda/channels/system-rhel7 -c file:///reg/g/psdm/sw/conda/channels/psana-rhel7 -c file:///reg/g/psdm/sw/conda/channels/external-rhel7 --quiet recipes/psana/psana-conda-opt 2>&1 | tee -a /reg/g/psdm/sw/conda/logs/conda_build_psana_psana-conda-1.0.2-py27_1_rhel7_linux-64.log
/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/environ.py:303: UserWarning: The environment variable 'SIT_ROOT' is undefined.
  UserWarning
BUILD START: psana-conda-1.0.2-py27_1
    (actual version deferred until further download or env creation)

The following NEW packages will be INSTALLED:

    boost:           1.57.0-4                                                                         
    cairo:           1.12.18-6                                                                        
    cycler:          0.10.0-py27_0                                                                    
    cython:          0.24.1-py27_0                                                                    
    fontconfig:      2.11.1-6                                                                         
    freetype:        2.5.5-1                                                                          
    h5py:            2.5.0-py27_hdf518_mpi4py2_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    hdf5:            1.8.17-openmpi_100            file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    icu:             54.1-0                                                                           
    libgfortran:     3.0.0-1                                                                          
    libpng:          1.6.22-0                                                                         
    libsodium:       1.0.10-0                                                                         
    libxml2:         2.9.2-0                                                                          
    matplotlib:      1.5.1-np111py27_0                                                                
    mkl:             11.3.3-0                                                                         
    mpi4py:          2.0.0-py27_openmpi_100        file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    mysql:           5.5.24-0                                                                         
    ndarray:         1.1.5-0                       file:///reg/g/psdm/sw/conda/channels/psana-rhel7   
    numexpr:         2.6.1-np111py27_0                                                                
    numpy:           1.11.1-py27_0                                                                    
    openmpi:         1.10.3-lsf_verbs_100          file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    openssl:         1.0.2h-1                                                                         
    pip:             8.1.2-py27_0                                                                     
    pixman:          0.32.6-0                                                                         
    pycairo:         1.10.0-py27_0                                                                    
    pyparsing:       2.1.4-py27_0                                                                     
    pyqt:            4.11.4-py27_4                                                                    
    python:          2.7.12-1                                                                         
    python-dateutil: 2.5.3-py27_0                                                                     
    pytz:            2016.6.1-py27_0                                                                  
    pyzmq:           15.4.0-py27_0                                                                    
    qt:              4.8.5-0                                                                          
    readline:        6.2-2                                                                            
    scipy:           0.18.0-np111py27_0                                                               
    scons:           2.3.0-py27_0                                                                     
    setuptools:      26.1.1-py27_0                                                                    
    sip:             4.18-py27_0                                                                      
    six:             1.10.0-py27_0                                                                    
    sqlite:          3.13.0-0                                                                         
    szip:            2.1-100                       file:///reg/g/psdm/sw/conda/channels/external-rhel7
    tables:          3.2.3.1-py27_hdf18_100        file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    tk:              8.5.18-0                                                                         
    wheel:           0.29.0-py27_0                                                                    
    zeromq:          4.1.4-0                                                                          
    zlib:            1.2.8-3                                                                          


The following NEW packages will be INSTALLED:

    boost:           1.57.0-4                                                                         
    cairo:           1.12.18-6                                                                        
    cycler:          0.10.0-py27_0                                                                    
    cython:          0.24.1-py27_0                                                                    
    fontconfig:      2.11.1-6                                                                         
    freetype:        2.5.5-1                                                                          
    h5py:            2.5.0-py27_hdf518_mpi4py2_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    hdf5:            1.8.17-openmpi_100            file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    icu:             54.1-0                                                                           
    libgfortran:     3.0.0-1                                                                          
    libpng:          1.6.22-0                                                                         
    libsodium:       1.0.10-0                                                                         
    libxml2:         2.9.2-0                                                                          
    matplotlib:      1.5.1-np111py27_0                                                                
    mkl:             11.3.3-0                                                                         
    mpi4py:          2.0.0-py27_openmpi_100        file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    mysql:           5.5.24-0                                                                         
    ndarray:         1.1.5-0                       file:///reg/g/psdm/sw/conda/channels/psana-rhel7   
    numexpr:         2.6.1-np111py27_0                                                                
    numpy:           1.11.1-py27_0                                                                    
    openmpi:         1.10.3-lsf_verbs_100          file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    openssl:         1.0.2h-1                                                                         
    pip:             8.1.2-py27_0                                                                     
    pixman:          0.32.6-0                                                                         
    pycairo:         1.10.0-py27_0                                                                    
    pyparsing:       2.1.4-py27_0                                                                     
    pyqt:            4.11.4-py27_4                                                                    
    python:          2.7.12-1                                                                         
    python-dateutil: 2.5.3-py27_0                                                                     
    pytz:            2016.6.1-py27_0                                                                  
    pyzmq:           15.4.0-py27_0                                                                    
    qt:              4.8.5-0                                                                          
    readline:        6.2-2                                                                            
    scipy:           0.18.0-np111py27_0                                                               
    scons:           2.3.0-py27_0                                                                     
    setuptools:      26.1.1-py27_0                                                                    
    sip:             4.18-py27_0                                                                      
    six:             1.10.0-py27_0                                                                    
    sqlite:          3.13.0-0                                                                         
    szip:            2.1-100                       file:///reg/g/psdm/sw/conda/channels/external-rhel7
    tables:          3.2.3.1-py27_hdf18_100        file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    tk:              8.5.18-0                                                                         
    wheel:           0.29.0-py27_0                                                                    
    zeromq:          4.1.4-0                                                                          
    zlib:            1.2.8-3                                                                          

Traceback (most recent call last):
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/bin/conda-build", line 6, in <module>
    sys.exit(conda_build.cli.main_build.main())
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 239, in main
    execute(sys.argv[1:])
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 231, in execute
    already_built=None, config=config)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/api.py", line 83, in build
    need_source_download=need_source_download, config=config)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 998, in build_tree
    config=recipe_config)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 558, in build
    create_env(config.build_prefix, specs, config=config)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 451, in create_env
    clear_cache=clear_cache)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 427, in create_env
    plan.execute_actions(actions, index, verbose=config.debug)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/plan.py", line 643, in execute_actions
    inst.execute_instructions(plan, index, verbose)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 132, in execute_instructions
    cmd(state, arg)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 77, in LINK_CMD
    link(state['prefix'], dist, lt, index=state['index'])
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/install.py", line 973, in link
    (placeholder, dist))
conda.exceptions.PaddingError: Padding error: 
finished running conda build. logfile: /reg/g/psdm/sw/conda/logs/conda_build_psana_psana-conda-1.0.2-py27_1_rhel7_linux-64.log
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
```

An older version of the recipe can be found here
https://github.com/davidslac/manage-lcls-conda-build-system/tree/master/recipes/psana/psana-conda-opt

After backing conda-build back down to 1.19, things look like they are working again, at least conda made the build environment and is running my build script

conda build - exception - padding error
I just updated to the lastest conda-build in defaults, and latest conda conda-env in conda canary, when I run conda build I am getting a 'package error'. Here is my conda environemnt:

```
           platform : linux-64
      conda version : 4.2.5
   conda is private : False
  conda-env version : 2.6.0
conda-build version : 2.0.1
     python version : 2.7.12.final.0
   requests version : 2.10.0
   root environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7  (writable)
default environment : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7
   envs directories : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/envs
      package cache : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/pkgs
       channel URLs : file:///reg/g/psdm/sw/conda/channels/system-rhel7/linux-64/
                      file:///reg/g/psdm/sw/conda/channels/system-rhel7/noarch/
                      file:///reg/g/psdm/sw/conda/channels/psana-rhel7/linux-64/
                      file:///reg/g/psdm/sw/conda/channels/psana-rhel7/noarch/
                      file:///reg/g/psdm/sw/conda/channels/external-rhel7/linux-64/
                      file:///reg/g/psdm/sw/conda/channels/external-rhel7/noarch/
                      https://repo.continuum.io/pkgs/free/linux-64/
                      https://repo.continuum.io/pkgs/free/noarch/
                      https://repo.continuum.io/pkgs/pro/linux-64/
                      https://repo.continuum.io/pkgs/pro/noarch/
                      https://conda.anaconda.org/scikit-beam/linux-64/
                      https://conda.anaconda.org/scikit-beam/noarch/
                      file:///reg/g/psdm/sw/conda/channels/testing-rhel7/linux-64/
                      file:///reg/g/psdm/sw/conda/channels/testing-rhel7/noarch/
        config file : /reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/.condarc
       offline mode : False
```

and here is the build output

```
SIT_ARCH=x86_64-rhel7-gcc48-opt conda build  -c file:///reg/g/psdm/sw/conda/channels/system-rhel7 -c file:///reg/g/psdm/sw/conda/channels/psana-rhel7 -c file:///reg/g/psdm/sw/conda/channels/external-rhel7 --quiet recipes/psana/psana-conda-opt 2>&1 | tee -a /reg/g/psdm/sw/conda/logs/conda_build_psana_psana-conda-1.0.2-py27_1_rhel7_linux-64.log
/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/environ.py:303: UserWarning: The environment variable 'SIT_ROOT' is undefined.
  UserWarning
BUILD START: psana-conda-1.0.2-py27_1
    (actual version deferred until further download or env creation)

The following NEW packages will be INSTALLED:

    boost:           1.57.0-4                                                                         
    cairo:           1.12.18-6                                                                        
    cycler:          0.10.0-py27_0                                                                    
    cython:          0.24.1-py27_0                                                                    
    fontconfig:      2.11.1-6                                                                         
    freetype:        2.5.5-1                                                                          
    h5py:            2.5.0-py27_hdf518_mpi4py2_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    hdf5:            1.8.17-openmpi_100            file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    icu:             54.1-0                                                                           
    libgfortran:     3.0.0-1                                                                          
    libpng:          1.6.22-0                                                                         
    libsodium:       1.0.10-0                                                                         
    libxml2:         2.9.2-0                                                                          
    matplotlib:      1.5.1-np111py27_0                                                                
    mkl:             11.3.3-0                                                                         
    mpi4py:          2.0.0-py27_openmpi_100        file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    mysql:           5.5.24-0                                                                         
    ndarray:         1.1.5-0                       file:///reg/g/psdm/sw/conda/channels/psana-rhel7   
    numexpr:         2.6.1-np111py27_0                                                                
    numpy:           1.11.1-py27_0                                                                    
    openmpi:         1.10.3-lsf_verbs_100          file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    openssl:         1.0.2h-1                                                                         
    pip:             8.1.2-py27_0                                                                     
    pixman:          0.32.6-0                                                                         
    pycairo:         1.10.0-py27_0                                                                    
    pyparsing:       2.1.4-py27_0                                                                     
    pyqt:            4.11.4-py27_4                                                                    
    python:          2.7.12-1                                                                         
    python-dateutil: 2.5.3-py27_0                                                                     
    pytz:            2016.6.1-py27_0                                                                  
    pyzmq:           15.4.0-py27_0                                                                    
    qt:              4.8.5-0                                                                          
    readline:        6.2-2                                                                            
    scipy:           0.18.0-np111py27_0                                                               
    scons:           2.3.0-py27_0                                                                     
    setuptools:      26.1.1-py27_0                                                                    
    sip:             4.18-py27_0                                                                      
    six:             1.10.0-py27_0                                                                    
    sqlite:          3.13.0-0                                                                         
    szip:            2.1-100                       file:///reg/g/psdm/sw/conda/channels/external-rhel7
    tables:          3.2.3.1-py27_hdf18_100        file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    tk:              8.5.18-0                                                                         
    wheel:           0.29.0-py27_0                                                                    
    zeromq:          4.1.4-0                                                                          
    zlib:            1.2.8-3                                                                          


The following NEW packages will be INSTALLED:

    boost:           1.57.0-4                                                                         
    cairo:           1.12.18-6                                                                        
    cycler:          0.10.0-py27_0                                                                    
    cython:          0.24.1-py27_0                                                                    
    fontconfig:      2.11.1-6                                                                         
    freetype:        2.5.5-1                                                                          
    h5py:            2.5.0-py27_hdf518_mpi4py2_100 file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    hdf5:            1.8.17-openmpi_100            file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    icu:             54.1-0                                                                           
    libgfortran:     3.0.0-1                                                                          
    libpng:          1.6.22-0                                                                         
    libsodium:       1.0.10-0                                                                         
    libxml2:         2.9.2-0                                                                          
    matplotlib:      1.5.1-np111py27_0                                                                
    mkl:             11.3.3-0                                                                         
    mpi4py:          2.0.0-py27_openmpi_100        file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    mysql:           5.5.24-0                                                                         
    ndarray:         1.1.5-0                       file:///reg/g/psdm/sw/conda/channels/psana-rhel7   
    numexpr:         2.6.1-np111py27_0                                                                
    numpy:           1.11.1-py27_0                                                                    
    openmpi:         1.10.3-lsf_verbs_100          file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    openssl:         1.0.2h-1                                                                         
    pip:             8.1.2-py27_0                                                                     
    pixman:          0.32.6-0                                                                         
    pycairo:         1.10.0-py27_0                                                                    
    pyparsing:       2.1.4-py27_0                                                                     
    pyqt:            4.11.4-py27_4                                                                    
    python:          2.7.12-1                                                                         
    python-dateutil: 2.5.3-py27_0                                                                     
    pytz:            2016.6.1-py27_0                                                                  
    pyzmq:           15.4.0-py27_0                                                                    
    qt:              4.8.5-0                                                                          
    readline:        6.2-2                                                                            
    scipy:           0.18.0-np111py27_0                                                               
    scons:           2.3.0-py27_0                                                                     
    setuptools:      26.1.1-py27_0                                                                    
    sip:             4.18-py27_0                                                                      
    six:             1.10.0-py27_0                                                                    
    sqlite:          3.13.0-0                                                                         
    szip:            2.1-100                       file:///reg/g/psdm/sw/conda/channels/external-rhel7
    tables:          3.2.3.1-py27_hdf18_100        file:///reg/g/psdm/sw/conda/channels/system-rhel7  
    tk:              8.5.18-0                                                                         
    wheel:           0.29.0-py27_0                                                                    
    zeromq:          4.1.4-0                                                                          
    zlib:            1.2.8-3                                                                          

Traceback (most recent call last):
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/bin/conda-build", line 6, in <module>
    sys.exit(conda_build.cli.main_build.main())
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 239, in main
    execute(sys.argv[1:])
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/cli/main_build.py", line 231, in execute
    already_built=None, config=config)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/api.py", line 83, in build
    need_source_download=need_source_download, config=config)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 998, in build_tree
    config=recipe_config)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 558, in build
    create_env(config.build_prefix, specs, config=config)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 451, in create_env
    clear_cache=clear_cache)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda_build/build.py", line 427, in create_env
    plan.execute_actions(actions, index, verbose=config.debug)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/plan.py", line 643, in execute_actions
    inst.execute_instructions(plan, index, verbose)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 132, in execute_instructions
    cmd(state, arg)
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/instructions.py", line 77, in LINK_CMD
    link(state['prefix'], dist, lt, index=state['index'])
  File "/reg/g/psdm/sw/conda/inst/miniconda2-dev-rhel7/lib/python2.7/site-packages/conda/install.py", line 973, in link
    (placeholder, dist))
conda.exceptions.PaddingError: Padding error: 
finished running conda build. logfile: /reg/g/psdm/sw/conda/logs/conda_build_psana_psana-conda-1.0.2-py27_1_rhel7_linux-64.log
sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file
```

An older version of the recipe can be found here
https://github.com/davidslac/manage-lcls-conda-build-system/tree/master/recipes/psana/psana-conda-opt

After backing conda-build back down to 1.19, things look like they are working again, at least conda made the build environment and is running my build script



Discussion:
@davidslac Thanks so much for all of these bug reports.  Will investigate and fix them all.

You're welcome!

From: Kale Franz <notifications@github.com<mailto:notifications@github.com>>
Reply-To: conda/conda <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Monday, September 12, 2016 at 8:28 AM
To: conda/conda <conda@noreply.github.com<mailto:conda@noreply.github.com>>
Cc: David A Schneider <davidsch@slac.stanford.edu<mailto:davidsch@slac.stanford.edu>>, Mention <mention@noreply.github.com<mailto:mention@noreply.github.com>>
Subject: Re: [conda/conda] conda build - exception - padding error (#3407)

@davidslachttps://github.com/davidslac Thanks so much for all of these bug reports. Will investigate and fix them all.

## 

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/conda/conda/issues/3407#issuecomment-246385470, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQAThWBmDYIZa-Nx_0FK7EluKsLyuG6wks5qpW-HgaJpZM4J6Hdo.

@davidslac I've fixed the other two issues you filed.  And I'll make the messaging better on this one.

The issue here is that around conda-build 2.0, we changed the length of the binary path placeholder.  Before, it was arbitrarily set to 80 characters, and now we've extended it to the max value we can while still maintaining broad interoperability (255).  The downside is that dependencies sometimes have to be rebuilt with the longer padding.

I think we've rebuilt most of the packages in defaults that needed it, but we could have missed some.  My guess is it's one of the packages in one of your local file:// channels.

Regardless, I'll make the messaging better so you know exactly which one is the culprit.

@davidslac Thanks so much for all of these bug reports.  Will investigate and fix them all.

You're welcome!

From: Kale Franz <notifications@github.com<mailto:notifications@github.com>>
Reply-To: conda/conda <reply@reply.github.com<mailto:reply@reply.github.com>>
Date: Monday, September 12, 2016 at 8:28 AM
To: conda/conda <conda@noreply.github.com<mailto:conda@noreply.github.com>>
Cc: David A Schneider <davidsch@slac.stanford.edu<mailto:davidsch@slac.stanford.edu>>, Mention <mention@noreply.github.com<mailto:mention@noreply.github.com>>
Subject: Re: [conda/conda] conda build - exception - padding error (#3407)

@davidslachttps://github.com/davidslac Thanks so much for all of these bug reports. Will investigate and fix them all.

## 

You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/conda/conda/issues/3407#issuecomment-246385470, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQAThWBmDYIZa-Nx_0FK7EluKsLyuG6wks5qpW-HgaJpZM4J6Hdo.

@davidslac I've fixed the other two issues you filed.  And I'll make the messaging better on this one.

The issue here is that around conda-build 2.0, we changed the length of the binary path placeholder.  Before, it was arbitrarily set to 80 characters, and now we've extended it to the max value we can while still maintaining broad interoperability (255).  The downside is that dependencies sometimes have to be rebuilt with the longer padding.

I think we've rebuilt most of the packages in defaults that needed it, but we could have missed some.  My guess is it's one of the packages in one of your local file:// channels.

Regardless, I'll make the messaging better so you know exactly which one is the culprit.


Resolving patch:
diff --git a/conda/exceptions.py b/conda/exceptions.py
--- a/conda/exceptions.py
+++ b/conda/exceptions.py
@@ -128,8 +128,9 @@ def __init__(self, *args, **kwargs):
 
 
 class PaddingError(CondaError):
-    def __init__(self, *args):
-        msg = 'Padding error: %s' % ' '.join(text_type(arg) for arg in self.args)
+    def __init__(self, dist, placeholder, placeholder_length):
+        msg = ("Placeholder of length '%d' too short in package %s.\n"
+               "The package must be rebuilt with conda-build > 2.0." % (placeholder_length, dist))
         super(PaddingError, self).__init__(msg)
 
 
diff --git a/conda/install.py b/conda/install.py
--- a/conda/install.py
+++ b/conda/install.py
@@ -248,6 +248,10 @@ def parse_line(line):
     return {pr.filepath: (pr.placeholder, pr.filemode) for pr in parsed_lines}
 
 
+class _PaddingError(Exception):
+    pass
+
+
 def binary_replace(data, a, b):
     """
     Perform a binary replacement of `data`, where the placeholder `a` is
@@ -261,7 +265,7 @@ def replace(match):
         occurances = match.group().count(a)
         padding = (len(a) - len(b))*occurances
         if padding < 0:
-            raise PaddingError(a, b, padding)
+            raise _PaddingError
         return match.group().replace(a, b) + b'\0' * padding
 
     original_data_len = len(data)
@@ -968,9 +972,8 @@ def link(prefix, dist, linktype=LINK_HARD, index=None):
             placeholder, mode = has_prefix_files[filepath]
             try:
                 update_prefix(join(prefix, filepath), prefix, placeholder, mode)
-            except PaddingError:
-                raise PaddingError("ERROR: placeholder '%s' too short in: %s\n" %
-                                   (placeholder, dist))
+            except _PaddingError:
+                raise PaddingError(dist, placeholder, len(placeholder))
 
         # make sure that the child environment behaves like the parent,
         #    wrt user/system install on win


Test patch:
diff --git a/tests/test_install.py b/tests/test_install.py
--- a/tests/test_install.py
+++ b/tests/test_install.py
@@ -18,7 +18,8 @@
 from conda.fetch import download
 from conda.install import (FileMode, PaddingError, binary_replace, dist2dirname, dist2filename,
                            dist2name, dist2pair, dist2quad, name_dist, on_win,
-                           read_no_link, update_prefix, warn_failed_remove, yield_lines)
+                           read_no_link, update_prefix, warn_failed_remove, yield_lines,
+                           _PaddingError)
 from contextlib import contextmanager
 from os import chdir, getcwd, makedirs
 from os.path import dirname, exists, join, relpath
@@ -46,7 +47,7 @@ def test_shorter(self):
             b'xxxbbbbxyz\x00\x00zz')
 
     def test_too_long(self):
-        self.assertRaises(PaddingError, binary_replace,
+        self.assertRaises(_PaddingError, binary_replace,
                           b'xxxaaaaaxyz\x00zz', b'aaaaa', b'bbbbbbbb')
 
     def test_no_extra(self):
@@ -71,7 +72,7 @@ def test_multiple(self):
         self.assertEqual(
             binary_replace(b'aaaacaaaa\x00', b'aaaa', b'bbb'),
             b'bbbcbbb\x00\x00\x00')
-        self.assertRaises(PaddingError, binary_replace,
+        self.assertRaises(_PaddingError, binary_replace,
                           b'aaaacaaaa\x00', b'aaaa', b'bbbbb')
 
     @pytest.mark.skipif(not on_win, reason="exe entry points only necessary on win")