Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug in bdist_wininst cross compile?

4 views
Skip to first unread message

Robin Becker

unread,
Mar 17, 2010, 10:38:16 AM3/17/10
to pytho...@python.org
has anyone had any success with cross compilation and bdist_wininst; I have
modified build_ext very slightly to fix a small bug in cross compilation related
to library order. That seems to fix

setup.py build --plat-name=win-amd64


however, when I try to do a clean build of an exe ie

rm -rf build

setup.py bdist_wininst --plat-name=win-amd64

it appears as though build is invoked with the wrong plat-name ie I see this in
the output

> running bdist_wininst
> running build
> running build_py
> creating build
> creating build\lib.win32-2.6
> creating build\lib.win32-2.6\reportlab
> copying src\reportlab\rl_config.py -> build\lib.win32-2.6\reportlab
......
> C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nolog

followed by errors related to a missing library (the amd64 version won't work
with a win32 build).

If I build first with

setup.py build --plat-name=win-amd64

and then use

setup.py bdist_wininst --plat-name=win-amd64 --skip-build

then I seem to get a proper amd64 exe.

I think the problem can be fixed by modifying distutils/command/bdist_wininst.py
using this patch

> *** bdist_wininst.py.orig Wed Mar 17 14:00:15 2010
> --- bdist_wininst.py Wed Mar 17 14:29:55 2010
> ***************
> *** 79,90 ****
>
> def finalize_options (self):
> if self.bdist_dir is None:
> ! if self.skip_build and self.plat_name:
> ! # If build is skipped and plat_name is overridden, bdist will
> ! # not see the correct 'plat_name' - so set that up manually.
> bdist = self.distribution.get_command_obj('bdist')
> bdist.plat_name = self.plat_name
> ! # next the command will be initialized using that name
> bdist_base = self.get_finalized_command('bdist').bdist_base
> self.bdist_dir = os.path.join(bdist_base, 'wininst')
> if not self.target_version:
> --- 79,91 ----
>
> def finalize_options (self):
> if self.bdist_dir is None:
> ! if self.plat_name:
> ! #bdist doesn't propagate plat_name so we do it here
> ! build = self.distribution.get_command_obj('build')
> ! build.plat_name = self.plat_name
> bdist = self.distribution.get_command_obj('bdist')
> bdist.plat_name = self.plat_name
> ! # next the command(s) will be initialized using that name
> bdist_base = self.get_finalized_command('bdist').bdist_base
> self.bdist_dir = os.path.join(bdist_base, 'wininst')
> if not self.target_version:

which forces bdist_wininst's version of the plat_name forward onto both build
and bdist.
--
Robin Becker

Gabriel Genellina

unread,
Mar 17, 2010, 5:37:24 PM3/17/10
to pytho...@python.org
En Wed, 17 Mar 2010 11:38:16 -0300, Robin Becker <ro...@reportlab.com>
escribió:

> has anyone had any success with cross compilation and bdist_wininst; I
> have modified build_ext very slightly to fix a small bug in cross
> compilation related to library order.

Please post your bug report + patch at http://bugs.python.org or it will
be lost.

--
Gabriel Genellina

Robin Becker

unread,
Mar 18, 2010, 8:06:16 AM3/18/10
to pytho...@python.org, Gabriel Genellina

OK done
--
Robin Becker

0 new messages