Hi,

Well, here is the ldd output I get for the Python interpreter on my  
Linux box:
$ ldd /usr/bin/python
        linux-gate.so.1 =>  (0x00a32000)
        libpython2.4.so.1.0 => /usr/lib/libpython2.4.so.1.0 (0x00c99000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00101000)
        libdl.so.2 => /lib/libdl.so.2 (0x00ba3000)
        libutil.so.1 => /lib/libutil.so.1 (0x00c93000)
        libm.so.6 => /lib/libm.so.6 (0x00b7c000)
        libc.so.6 => /lib/libc.so.6 (0x00a51000)
        /lib/ld-linux.so.2 (0x00a33000)
As you can see, after doing all the splitting and stripping, you end  
up getting a dependentFile starting with a '(' for the first line. The  
test on dependentFile.startswith('(') is there to handle this case.  
This didn't happen before I did my modifications, because there was  
still a space before the '('. So the case was handled correctly with  
'pos = dependentFile.find(" (")'. But since now, dependentFile is  
stripped before this call, the space has disappeared and you need to  
handle this case specifically.
--
- Eric -


On 17 sept. 09, at 23:48, Anthony Tuininga wrote:
> Hi,
>
> Yes, some of those changes were already made available but some of
> these were new changes. I've checked in the changes regarding the "not
> found" differences. The addition of the clause "and not
> dependentFile.startswith('('):" on the last line is interesting. Can
> you explain what you are after that with an example? Thanks.
>
> Anthony
>
> On Thu, Sep 17, 2009 at 2:06 AM, Eric Brunel <eric.bru...@pragmadev.com 
> > wrote:
>> Hi,
>>
>> I think I've got bitten by the exact same problem at some point,  
>> did a
>> correction to handle it and forgot to post it there. Sorry for that.
>>
>> To correct the problem, the following should work:
>> - open /usr/local/python25/lib/python2.5/site-packages/cx_Freeze/
>> freezer.py in a text editor
>> - search for expandtabs; you should get a line looking like 'parts =
>> line.expandtabs().strip().split(" => ")'
>> - a few lines after this one, you should have a line like
>> 'dependentFile = parts[1]'
>> - change the line to 'dependentFile = parts[1].strip()'
>> This should solve the problem.
>>
>> There were other little corrections made because Solaris sometimes
>> reports missing files in unusual ways. Just in case you get one of
>> these at some point, here is the exact piece of code I have now in my
>> file freezer.py, starting at the line with the expandtabs thing:
>> ---
>> parts = line.expandtabs().strip().split(" => ")
>> if len(parts) != 2:
>>     continue
>> dependentFile = parts[1].strip()
>> if dependentFile in ("not found", "(file not found)"):
>>     print "WARNING: cannot find", parts[0]
>>     continue
>> pos = dependentFile.find(" (")
>> if pos >= 0:
>>     dependentFile = dependentFile[:pos].strip()
>> if dependentFile and not dependentFile.startswith('('):
>>     dependentFiles.append(dependentFile)
>> ---
>> (this is the whole body of the for loop). This code is for version
>> 4.0.1 btw; don't know if anything has changed in it for the latest
>> version.
>>
>> HTH
>> --
>>  - Eric -
>>
>>
>> On 17 sept. 09, at 06:21, Christian Lalanne wrote:
>>> Hi,
>>>
>>> I am having a problem generating binaries on Solaris 8 using
>>> ActivePython 2.5.4 and cxFreeze 4.1... I was under the impression  
>>> that
>>> it may be related to Eric's fix because cxfreeze is looking for a  
>>> file
>>> called '       /usr/lib/64/libresolv.so.2' and not finding it when
>>> generating the frozen binaries. The file is clearly there, minus the
>>> leading blanks...
>>>
>>> cxfreeze emme2notify --install-dir=dist-cx41py25-st7
>>> Traceback (most recent call last):
>>>  File "/usr/local/python25/bin/cxfreeze", line 5, in <module>
>>>    main()
>>>  File
>>> "/usr/local/python25/lib/python2.5/site-packages/cx_Freeze/main.py",
>>> line 179, in main
>>>    freezer.Freeze()
>>>  File
>>> "/usr/local/python25/lib/python2.5/site-packages/cx_Freeze/
>>> freezer.py",
>>> line 418, in Freeze
>>>    self._FreezeExecutable(executable)
>>>  File
>>> "/usr/local/python25/lib/python2.5/site-packages/cx_Freeze/
>>> freezer.py",
>>> line 123, in _FreezeExecutable
>>>    scriptModule = finder.IncludeFile(exe.script, exe.moduleName)
>>>  File
>>> "/usr/local/python25/lib/python2.5/site-packages/cx_Freeze/ 
>>> finder.py",
>>> line 422, in IncludeFile
>>>    module = self._LoadModule(moduleName, open(path, "U"), path,  
>>> info,
>>> IOError: [Errno 2] No such file or directory: 'emme2notify'
>>> inro20:/compil/Emme/Python_tools/trunk/src# cxfreeze emme2notify.py
>>> --install-dir=dist-cx41py25-st7
>>> creating directory dist-cx41py25-st7
>>> coyping
>>> /usr/local/python25/lib/python2.5/site-packages/cx_Freeze/bases/
>>> Console
>>> -> dist-cx41py25-st7/emme2notify
>>> coyping        /usr/lib/64/libresolv.so.2 ->
>>> dist-cx41py25-st7/libresolv.so.2
>>> Traceback (most recent call last):
>>>  File "/usr/local/python25/bin/cxfreeze", line 5, in <module>
>>>    main()
>>>  File
>>> "/usr/local/python25/lib/python2.5/site-packages/cx_Freeze/main.py",
>>> line 179, in main
>>>    freezer.Freeze()
>>>  File
>>> "/usr/local/python25/lib/python2.5/site-packages/cx_Freeze/
>>> freezer.py",
>>> line 418, in Freeze
>>>    self._FreezeExecutable(executable)
>>>  File
>>> "/usr/local/python25/lib/python2.5/site-packages/cx_Freeze/
>>> freezer.py",
>>> line 125, in _FreezeExecutable
>>>    includeMode = True)
>>>  File
>>> "/usr/local/python25/lib/python2.5/site-packages/cx_Freeze/
>>> freezer.py",
>>> line 107, in _CopyFile
>>>    self._CopyFile(source, target, copyDependentFiles)
>>>  File
>>> "/usr/local/python25/lib/python2.5/site-packages/cx_Freeze/
>>> freezer.py",
>>> line 100, in _CopyFile
>>>    shutil.copyfile(source, target)
>>>  File "/usr/local/python25/lib/python2.5/shutil.py", line 51, in
>>> copyfile
>>>    fsrc = open(src, 'rb')
>>> IOError: [Errno 2] No such file or directory: '
>>> /usr/lib/64/libresolv.so.2'
>>>
>>> I have also tried cxfreeze 4.0.1 but am getting an error at runtime
>>> using the same python and Solaris:
>>> "unknown encoding: string-escape"
>>>
>>> Any help would be appreciated.
>>>
>>> Regards,
>>>
>>> Chris
>>>
>>>> Re: [cx-freeze-users] cx_freeze not working on Solaris (problem &
>>>> solution)
>>>>
>>>> Anthony Tuininga
>>>> Wed, 21 Jan 2009 12:16:48 -0800
>>>>
>>>> Eric,
>>>>
>>>> Thanks for the report and the solution. I've checked it into
>>>> Subversion so it will be included in the next release.
>>>>
>>>> As for reports, this works as well as anything else. There is a
>>>> SourceForge tracker that you could use as well but I'm fine with
>>>> this,
>>>> too. For anything more complex than the one line change I prefer  
>>>> the
>>>> output from svn diff (or diff -u). Thanks again.
>>>>
>>>> Anthony
>>>>
>>>> On Wed, Jan 21, 2009 at 9:17 AM, Eric Brunel
>>>> <eric.bru...@pragmadev.com> wrote:
>>>>> Hello all,
>>>>>
>>>>> I tried cx_freeze on a Solaris box and it didn't work because some
>>>>> library dependencies weren't spotted. I investigated a bit and  
>>>>> found
>>>>> out the 'ldd' command on Solaris outputs the dependency list  
>>>>> with a
>>>>> tab after the '=>'. So the line.strip().split(" => ") in
>>>>> Freezer._GetDependentFiles (module freezer.py, line 200 in version
>>>>> 4.0.1) doesn't work and the wrong library dependencies are  
>>>>> returned.
>>>>>
>>>>> Apparently, replacing this line by:
>>>>> parts = line.expandtabs().strip().split(" => ")
>>>>> seemed to solve the problem for me.
>>>>>
>>>>> Just thought it would be nice to include this in the next  
>>>>> version. I
>>>>> didn't find a more "official" way to report bugs than this list.  
>>>>> If
>>>>> there is, please tell me: I'll be glad to do it.
>>>>>
>>>>> Thanks!
>>>>> --
>>>>> - Eric Brunel
>>>
>>> ------------------------------------------------------------------------------
>>> Come build with us! The BlackBerry&reg; Developer Conference in  
>>> SF, CA
>>> is the only developer event you need to attend this year. Jumpstart
>>> your
>>> developing skills, take BlackBerry mobile applications to market and
>>> stay
>>> ahead of the curve. Join us from November 9&#45;12, 2009. Register
>>> now&#33;
>>> http://p.sf.net/sfu/devconf
>>> _______________________________________________
>>> cx-freeze-users mailing list
>>> cx-freeze-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry&reg; Developer Conference in SF,  
>> CA
>> is the only developer event you need to attend this year. Jumpstart  
>> your
>> developing skills, take BlackBerry mobile applications to market  
>> and stay
>> ahead of the curve. Join us from November 9&#45;12, 2009. Register  
>> now&#33;
>> http://p.sf.net/sfu/devconf
>> _______________________________________________
>> cx-freeze-users mailing list
>> cx-freeze-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users
>>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart  
> your
> developing skills, take BlackBerry mobile applications to market and  
> stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register  
> now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> cx-freeze-users mailing list
> cx-freeze-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users




------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
cx-freeze-users mailing list
cx-freeze-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to