error during prefix substitution of text file

0 views
Skip to first unread message

Jeremy McCormick

unread,
May 18, 2016, 6:47:26 PM5/18/16
to conda - Public
Hi,

I'm attempting to build this external package with conda.


This is a large C++ framework used in particle physics.  It has a Python binding which I'm trying to integrate into my build system.

My meta.yaml looks like this:

--

package:
  name: root
  version: "6.06.02"

source:
  fn: root_v6.06.02.source.tar.gz

requirements:
  build:
    - python

--

The build.sh is pretty simple and just consists of the following:

--

./configure --prefix=$PREFIX
make install

--

The download and compilation step seems to work fine.

But I'm having some trouble at the step where conda tries to replace the build prefix with the installation dir.

I get this cryptic traceback from the build:

updating shebang: bin/rootbrowse                                      
[...]
Traceback (most recent call last):
  File "/work/conda-build/miniconda/bin/conda-build", line 5, in <module>
    sys.exit(main())                                                                              
  File "/work/conda-build/miniconda/lib/python2.7/site-packages/conda_build/main_build.py", line 208, in main
    args_func(args, p)                                                                                                                
  File "/work/conda-build/miniconda/lib/python2.7/site-packages/conda_build/main_build.py", line 493, in args_func
    args.func(args, p)                                                                                                                     
  File "/work/conda-build/miniconda/lib/python2.7/site-packages/conda_build/main_build.py", line 438, in execute  
    include_recipe=args.include_recipe)                                                                                                    
  File "/work/conda-build/miniconda/lib/python2.7/site-packages/conda_build/build.py", line 515, in build         
    post_build(m, sorted(files2 - files1))                                                                                                 
  File "/work/conda-build/miniconda/lib/python2.7/site-packages/conda_build/post.py", line 332, in post_build     
    fix_shebang(f, osx_is_app=osx_is_app)                                                                                                  
  File "/work/conda-build/miniconda/lib/python2.7/site-packages/conda_build/post.py", line 76, in fix_shebang     
    fo.write(new_data)                                                                                                                     
TypeError: must be unicode, not str                               

When installed normally outside of conda the 'bin/rootbrowse' file is just a short Python script.  But here when I look in the build directory, 'bin/rootbrowse' ends up as an empty file with size 0, presumably because conda has clobbered its contents somehow.

Now I'm not sure this is problem with Conda itself (probably not), but I'm unable to determine here what is happening such that this file cannot be processed correctly.  There's nothing really special about it.  In fact, the file doesn't even contain the build prefix, so it could be skipped entirely!  (something which I don't know how to do)

Here's my relevant conda env:

[1019 $] conda info
Using Anaconda Cloud api site https://api.anaconda.org
Current conda install:

             platform : linux-64
        conda version : 4.0.5
  conda-build version : 1.20.1
       python version : 2.7.11.final.0
     requests version : 2.9.1
[..]
                        https://repo.continuum.io/pkgs/free/noarch/
                        https://repo.continuum.io/pkgs/pro/linux-64/
                        https://repo.continuum.io/pkgs/pro/noarch/
          config file : None
    is foreign system : False

Can anyone give me some clues here as to what might be going on so that Conda chokes on this file during the substitution of the install prefix into text files?

Is there any way to skip certain files during this step?  If so I could not find it in the docs.

Any way to turn on extra debugging info so I can get more details about what conda is doing here?

Thanks.

--Jeremy

Chris Barker

unread,
May 18, 2016, 6:56:50 PM5/18/16
to Jeremy McCormick, conda - Public


On Wed, May 18, 2016 at 3:47 PM, Jeremy McCormick <jermcc...@gmail.com> wrote:
updating shebang: bin/rootbrowse                                      

not sure if this will help, but does rootbrowse HAVE a #! line? maybe there is something wrong with it. Or, if it doesn't maybe try adding one...

-CHB


 

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

Jeremy McCormick

unread,
May 18, 2016, 7:02:40 PM5/18/16
to Chris Barker, conda - Public
Hi, Chris.

Yes, it does.  First line is....

#!/usr/bin/env python

The 'file' command seems to understand it okay....

[1092 $] file /work/sw/root/root-6.06.02/bin/rootbrowse
/work/sw/root/root-6.06.02/bin/rootbrowse: a /usr/bin/env python script text executable

I'm not sure what conda is trying to do here though....shouldn't this be left as is or will conda's actual python install location be substituted here instead?  (Forgive the basic questions...I'm just starting to use this tool so I don't fully understand all its conventions.)

Thanks.  

--Jeremy

Charles Doutriaux

unread,
May 18, 2016, 7:19:20 PM5/18/16
to co...@continuum.io
I don't know if it helps but I ran into the same error, then I updated my conda-build and it now works happily.

C.

Kale Franz

unread,
May 19, 2016, 5:34:10 AM5/19/16
to Charles Doutriaux, conda - Public
conda-build is now (today) at release 1.20.3.  If you still encounter the error, go ahead an file it here: https://github.com/conda/conda-build/issues/new

Jeremy McCormick

unread,
May 19, 2016, 6:29:38 PM5/19/16
to Kale Franz, Charles Doutriaux, conda - Public
Hi,
The error has now gone away after doing a 'conda update conda-build' to get the latest release.
Thanks!
--Jeremy


On Thursday, May 19, 2016, Kale Franz <kfr...@continuum.io> wrote:
conda-build is now (today) at release 1.20.3.  If you still encounter the error, go ahead an file it here: https://github.com/conda/conda-build/issues/new

--
Reply all
Reply to author
Forward
0 new messages