[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Use subprocess in gen_win.py

From: Paul Burba <ptburba_at_gmail.com>
Date: Fri, 24 Apr 2009 16:59:27 -0400

On Fri, Apr 24, 2009 at 2:52 PM, Arfrever Frehtes Taifersar Arahesis
<Arfrever.FTA_at_gmail.com> wrote:
> Using of os.popen4 in build/generator/gen_win.py probably causes
> "DeprecationWarning: os.popen4 is deprecated.  Use the subprocess module.".
>
> I'm attaching the patch which fixes this problem.
> I don't use Windows, so I cannot test this patch, so I'm not committing it directly.
>
> [[[
> * build/generator/gen_win.py
>  (WinGeneratorBase._find_swig): Use subprocess instead of os.popen4()
>   for compatibility with Python 3.
> ]]]
>
> --

Arfrever,

The patch doesn't work for me on trunk_at_37468.

Without the patch my build finds swig:

[[[
C:\SVN\src-trunk>python --version
Python 2.6.1

C:\SVN\src-trunk>vc6-build.bat

C:\SVN\src-trunk>set APACHE_INSTALL_DIR=C:\Apache22

C:\SVN\src-trunk>set APACHE_SOURCE_ROOT=C:\SVN\httpd-2.2.10

C:\SVN\src-trunk>set VER=trunk

C:\SVN\src-trunk>set SUBVERSION_SOURCE_ROOT=C:\SVN\src-trunk

C:\SVN\src-trunk>set BUILD=Release

C:\SVN\src-trunk>cd C:\SVN\src-trunk

C:\SVN\src-trunk>gen-make.py -t vcproj --vsnet-version=2008
--with-httpd=C:\SVN\httpd-2.2.10 --with-openssl=C:\SVN\openssl
--with-berkeley-db=C:\SVN\bdb --with-apr=C:\SVN\httpd-2.2
.10\srclib\apr --with-apr-util=C:\SVN\httpd-2.2.10\srclib\apr-util
--with-zlib=C:\SVN\zlib --enable-bdb-in-apr-util
--with-swig=C:\SVN\swig --with-junit="C:\Program Files\Java\jdk1
.6.0_07\jre\lib\ext\junit-4.4.jar" --with-sqlite=C:\SVN\sqlite3.6.10
--with-serf=C:\SVN\serf --with-neon=C:\SVN\neon
build\generator\gen_vcnet_vcproj.py:6: DeprecationWarning: the md5
module is deprecated; use hashlib instead
  import md5
Found libdb47.lib in C:\SVN\bdb
Generating for VS.NET 2008
Could not detect Ruby version.
  Ruby bindings will be linked with msvcrt-ruby18.lib
Found installed perl version number.
  Perl bindings will be linked with perl510.lib
Found installed SWIG version 1.3.36
Using SWIG library directory C:\SVN\swig\Lib
Found JDK version 1.6 in C:\Program Files\Java\jdk1.6.0_07
Found SQLite version 3.6.10
Found neon version 0.28.2
Traceback (most recent call last):
  File "C:\SVN\src-trunk\gen-make.py", line 286, in <module>
    main(conf, gentype, skip_depends=skip, other_options=rest.list)
  File "C:\SVN\src-trunk\gen-make.py", line 43, in main
    generator.compute_hdr_deps()
  File "build\generator\gen_base.py", line 190, in compute_hdr_deps
    for include_file in include_deps.query(native_path(source.filename)):
  File "build\generator\gen_base.py", line 968, in query
    c_includes, swig_includes = self.query_swig(fname)
  File "build\generator\gen_base.py", line 951, in query_swig
    hdrs = self._scan_for_includes(fname)
  File "build\generator\gen_base.py", line 1006, in _scan_for_includes
    if not match:
KeyboardInterrupt
Terminate batch job (Y/N)? y
]]]

But with the patch it does not:

[[[
C:\SVN\src-trunk>vc6-build.bat

C:\SVN\src-trunk>set APACHE_INSTALL_DIR=C:\Apache22

C:\SVN\src-trunk>set APACHE_SOURCE_ROOT=C:\SVN\httpd-2.2.10

C:\SVN\src-trunk>set VER=trunk

C:\SVN\src-trunk>set SUBVERSION_SOURCE_ROOT=C:\SVN\src-trunk

C:\SVN\src-trunk>set BUILD=Release

C:\SVN\src-trunk>cd C:\SVN\src-trunk

C:\SVN\src-trunk>gen-make.py -t vcproj --vsnet-version=2008
--with-httpd=C:\SVN\httpd-2.2.10 --with-openssl=C:\SVN\openssl
--with-berkeley-db=C:\SVN\bdb --with-apr=C:\SVN\httpd-2.2
.10\srclib\apr --with-apr-util=C:\SVN\httpd-2.2.10\srclib\apr-util
--with-zlib=C:\SVN\zlib --enable-bdb-in-apr-util
--with-swig=C:\SVN\swig --with-junit="C:\Program Files\Java\jdk1
.6.0_07\jre\lib\ext\junit-4.4.jar" --with-sqlite=C:\SVN\sqlite3.6.10
--with-serf=C:\SVN\serf --with-neon=C:\SVN\neon
build\generator\gen_vcnet_vcproj.py:6: DeprecationWarning: the md5
module is deprecated; use hashlib instead
  import md5
Found libdb47.lib in C:\SVN\bdb
Generating for VS.NET 2008
Could not detect Ruby version.
  Ruby bindings will be linked with msvcrt-ruby18.lib
Found installed perl version number.
  Perl bindings will be linked with perl510.lib
Could not find installed SWIG, assuming version 1.3.25
Found JDK version 1.6 in C:\Program Files\Java\jdk1.6.0_07
Found SQLite version 3.6.10
Found neon version 0.28.2
C:\SVN\swig\swig not found; skipping SWIG file generation...
Traceback (most recent call last):
  File "C:\SVN\src-trunk\gen-make.py", line 286, in <module>
    main(conf, gentype, skip_depends=skip, other_options=rest.list)
  File "C:\SVN\src-trunk\gen-make.py", line 43, in main
    generator.compute_hdr_deps()
  File "build\generator\gen_base.py", line 190, in compute_hdr_deps
    for include_file in include_deps.query(native_path(source.filename)):
  File "build\generator\gen_base.py", line 968, in query
    c_includes, swig_includes = self.query_swig(fname)
  File "build\generator\gen_base.py", line 951, in query_swig
    hdrs = self._scan_for_includes(fname)
  File "build\generator\gen_base.py", line 1004, in _scan_for_includes
    for line in fileinput.input(fname):
  File "C:\Python26\lib\fileinput.py", line 253, in next
    line = self.readline()
  File "C:\Python26\lib\fileinput.py", line 346, in readline
    self._buffer = self._file.readlines(self._bufsize)
KeyboardInterrupt
Terminate batch job (Y/N)? y
]]]

Glancing at the patch I am not sure what is wrong. With the memory
still fresh of wasting a lot of time dealing with subprocess (see
r35049, r35093, r35183, r35184) I'm glad to test a patch, but I'm not
going to track down problems until I have some free time...which will
probably be when I'm dead :-\

Paul

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1897601
Received on 2009-04-24 23:00:19 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.