[SciPy-dev] Re: scipy_distutils under cygwin using DF

Berthold Höllmann hoel at gl-group.com
Tue Mar 30 05:41:22 EST 2004


Pearu Peterson <pearu at scipy.org> writes:

> On Mon, 29 Mar 2004, [ISO-8859-15] Berthold Höllmann wrote:
>
>> after some fiddeling, the following does work for me under Win XP,
>> cygwin, using the Enthought Python. cygwin python does return "posix"
>> for "os.name" so the 'argv = [os.environ['COMSPEC'],'/C']+argv' part
>> could be OK:
>> 
>> Index: scipy_core/scipy_distutils/exec_command.py
>> ===================================================================
>> RCS file: /home/cvsroot/world/scipy_core/scipy_distutils/exec_command.py,v
>> retrieving revision 1.17
>> diff -r1.17 exec_command.py
>
> Thanks for the patch. I have applied it with few minor changes to CVS.
> Let me know if my changes did not work.

Dear Pearu,

There are still problems (a problem) with the patches. I was already
im mine, but I had'nt found the time to report them, sorry. The
version is working for Linux and Solaris but trying to build
scipy_core under WinXP I get:

---snip---
...
compling C sources
creating build\temp.win32-2.3
creating build\temp.win32-2.3\Release
creating build\temp.win32-2.3\Release\scipy_base
C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DUSE_MCONF_LITE_LE -Ic:\Python23\include -Ic:\Python23\PC /Tcscipy_base\fastumathmodule.c /Fobuild\temp.win32-2.3\Release\scipy_base\fastumathmodule.obj
Could not locate executable h:\work\CVS\scipy\scipy_core\"C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe"
Executable h:\work\CVS\scipy\scipy_core\"C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" does not exist

error: Command ""C:\Programme\Microsoft Visual Studio\VC98\BIN\cl.exe" /c /nologo /Ox /MD /W3 /GX /DNDEBUG -DUSE_MCONF_LITE_LE -Ic:\Python23\include -Ic:\Python23\PC /Tcscipy_base\fastumathmodule.c /Fobuild\temp.win32-2.3\Release\scipy_base\fastumathmodule.obj" failed with exit status 1
---snip---

"h:\work\CVS\scipy\scipy_core\" is where I checked out scipy from
CVS. Further "python scipy_distutils/exec_command.py" fails. Line
numbers are not exactely those from CVS because of additional
debugging code.

---snip---
    s,o=exec_command('echo path=%path%')
    log.debug((s,o))
    assert s==0 and o!='',(s,o)

    s,o=exec_command('%s -c "import sys;sys.stderr.write(sys.platform)"' \
                     % pythonexe)
    log.debug((s,o))
    assert s==0 and o=='win32',(s,o)
---snip---

With this I get:

---snip---
$ python scipy_distutils/exec_command.py
...
Running spawnve(0,'C:\\WINDOWS\\system32\\cmd.exe',['C:\\WINDOWS\\system32\\cmd.exe', '/C', 'C:\\cygwin\\bin\\echo.exe', 'path=%path%'],os.environ)
_update_environment(...)
(0, 'path=c:\\Programme\\...<snipped>...\\bin')
exec_command('c:\\Python23\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"',)
Retaining cwd: h:\work\CVS\scipy\scipy_core
_preserve_environment([])
_update_environment(...)
_exec_command(...)
splitcmdline('c:\\Python23\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"')
splitcmdline -> ['c:\\Python23\\PYTHON.EXE', '-c', '"import sys;sys.stderr.write(sys.platform)"']
find_executable('c:\\Python23\\PYTHON.EXE')
Found executable c:\Python23\PYTHON.EXE
Running spawnve(0,'C:\\WINDOWS\\system32\\cmd.exe',['C:\\WINDOWS\\system32\\cmd.exe', '/C', 'c:\\Python23\\PYTHON.EXE', '-c', '"import sys;sys.stderr.write(sys.platform)"'],os.environ)
_update_environment(...)
(0, 'COMMAND \'c:\\\\Python23\\\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"\' FAILED: win32')
Traceback (most recent call last):
  File "scipy_distutils/exec_command.py", line 599, in ?
    test(use_tee=0)
  File "scipy_distutils/exec_command.py", line 500, in test_nt
    assert s==0 and o=='win32',(s,o)
AssertionError: (0, 'COMMAND \'c:\\\\Python23\\\\PYTHON.EXE -c "import sys;sys.stderr.write(sys.platform)"\' FAILED: win32')
---snip---

The problem is, the test writes to stderr, but a result on stderr
leads "_exec_command" to generate the "... FAILED ..." message which
is not handled by the assert statement. Changing the assert to 

---snip---
    assert s==0 and o[-5:]=='win32',(s,o)
---snip---

fixes this problem and leads to the next one:

---snip---
exec_command('c:\\Python23\\PYTHON.EXE -c "raise \'Ignore me.\'"',)
Retaining cwd: h:\work\CVS\scipy\scipy_core
_preserve_environment([])
_update_environment(...)
_exec_command(...)
splitcmdline('c:\\Python23\\PYTHON.EXE -c "raise \'Ignore me.\'"')
splitcmdline -> ['c:\\Python23\\PYTHON.EXE', '-c', '"raise \'Ignore me.\'"']
find_executable('c:\\Python23\\PYTHON.EXE')
Found executable c:\Python23\PYTHON.EXE
Running spawnve(0,'C:\\WINDOWS\\system32\\cmd.exe',['C:\\WINDOWS\\system32\\cmd.exe', '/C', 'c:\\Python23\\PYTHON.EXE', '-c', '"raise \'Ignore me.\'"'],os.environ)
_update_environment(...)
(1, '')
Traceback (most recent call last):
  File "scipy_distutils/exec_command.py", line 600, in ?
    test(use_tee=0)
  File "scipy_distutils/exec_command.py", line 504, in test_nt
    assert s==1 and o,(s,o)
AssertionError: (1, '')
---snip---

I have no idea what the problem is here, because:

---snip---
C:\WINDOWS\system32>C:\\WINDOWS\\system32\\cmd.exe /C c:\\Python23\\PYTHON.EXE -c "raise 'Ignore me.'"
Traceback (most recent call last):
  File "<string>", line 1, in ?
Ignore me.
---snip---

Testing works on Linux, but on Solaris I get:

---snip---
...
exec_command('echo $AAA',)
Retaining cwd: /home/hoel/work/CVS/scipy/scipy_core
_preserve_environment([])
_update_environment(...)
_exec_command(...)
splitcmdline('echo $AAA')
splitcmdline -> ['echo', '$AAA']
Running spawnvpe(0,'echo',['echo', '$AAA'],os.environ)
_update_environment(...)
Traceback (most recent call last):
  File "scipy_distutils/exec_command.py", line 600, in ?
    test(use_tee=0)
  File "scipy_distutils/exec_command.py", line 523, in test_posix
    assert s==0 and o=='',(s,o)
AssertionError: (0, '$AAA')
---snip---

which I also don't understand

---snip---
hoel at donau:scipy_core echo $AAA

hoel at donau:scipy_core /bin/sh
$ echo $AAA

$ 
---snip---

I'll try to find some fixes for these problems.

Kind regards

Berthold Höllmann
-- 
Germanischer Lloyd AG
CAE Development
Vorsetzen 35
20459 Hamburg
Phone: +49(0)40 36149-7374
Fax: +49(0)40 36149-7320
e-mail: hoel at gl-group.com
Internet: http://www.gl-group.com 
 
 
 
This e-mail contains confidential information for the exclusive attention of the intended addressee. Any access of third parties to this e-mail is unauthorised. Any use of this e-mail by unintended recipients such as copying, distribution, disclosure etc. is prohibited and may be unlawful. When addressed to our clients the content of this e-mail is subject to the General Terms and Conditions of GL's Group of Companies applicable at the date of this e-mail.  
 
GL's Group of Companies does not warrant and/or guarantee that this message at the moment of receipt is authentic, correct and its communication free of errors, interruption etc.  
 


More information about the SciPy-Dev mailing list