Python 3.3 coming soon?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Python 3.3 coming soon?

Ryan Johnson-10
Hi python maintainer,

Is there any chance to get a build of python 3.3 on x86_64? (I need PEP
380, delegating to a subgenerator, and the Windows version doesn't play
nice with cygwin shells). I tried downloading the sources and applying
the patches mentioned in the .cygport file for the cygwin python 3.2
source distribution, but make fails with:

./Modules/signalmodule.c: In function ‘fill_siginfo’:
./Modules/signalmodule.c:745:60: error: ‘siginfo_t’ has no member named
‘si_band’
PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
^
Include/tupleobject.h:62:75: note: in definition of macro ‘PyTuple_SET_ITEM’
#define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
^
./Modules/signalmodule.c:745:5: note: in expansion of macro
‘PyStructSequence_SET_ITEM’
PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
^

NOTES:

  * Google turned up several other reports of the same error message,
    going back as far as python 2.6 for cygwin, but all the workarounds
    seem to have been fixed in older versions upstream, and/or fix other
    problems that had no obvious link with si_band (such as using
    ncursesw instead of ncurses).
  * I don't have (or know how to use) cygport, so maybe it would be as
    simple as changing $VERSION in the .cygport file.


Detailed steps I followed:

 1. Download python 3.3.2 source from python.org
 2. Download the cygwin python 3.2 source package using setup.exe, along
    with binaries for all dependencies (gettext, python3-tkinter, etc.)
 3. Apply the following patches (as specified in the .cygport):
    3.0b3-tkinter.patch
    3.0rc3-ctypes-util-find_library.patch
    3.1-enable-new-dtags.patch
    3.1-ncurses-abi6.patch
    3.1-PATH_MAX.patch
    3.1-ssl-threads.patch
    3.2-ctypes-libpython.patch
    3.2-cygwin-soname.patch
    3.2-dbm.patch
    3.2-distutils-shlibext.patch
    3.2-export-PyNode_SizeOf.patch
    3.2-export-PySignal_SetWakeupFd.patch
    3.2-format-parsetuple.patch
    3.2-pep3149.patch
    3.2-thread-cygwin64.patch
    CVE-2013-4238-py32.patch
    uuid.patch
 4. autoreconf -i
 5. ./configure CPPFLAGS="-I/usr/include/ncursesw"
    --prefix=$HOME/apps/python-3.3.2 --enable-shared --enable-ipv6
    --with-libc= --with-libm= --with-system-expat --with-system-ffi
    ac_cv_func_bind_textdomain_codeset=yes
 6. make -k

Thoughts?
Ryan


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Unable to compile python 3.3 [Was: Re: Python 3.3 coming soon?]

Ryan Johnson-10
On 14/10/2013 10:17 AM, Ryan Johnson wrote:

> Hi python maintainer,
>
> Is there any chance to get a build of python 3.3 on x86_64? (I need
> PEP 380, delegating to a subgenerator, and the Windows version doesn't
> play nice with cygwin shells). I tried downloading the sources and
> applying the patches mentioned in the .cygport file for the cygwin
> python 3.2 source distribution, but make fails with:
>
> ./Modules/signalmodule.c: In function ‘fill_siginfo’:
> ./Modules/signalmodule.c:745:60: error: ‘siginfo_t’ has no member
> named ‘si_band’
> PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
> ^
> Include/tupleobject.h:62:75: note: in definition of macro
> ‘PyTuple_SET_ITEM’
> #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject
> *)(op))->ob_item[i] = v)
> ^
> ./Modules/signalmodule.c:745:5: note: in expansion of macro
> ‘PyStructSequence_SET_ITEM’
> PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
> ^
>
> NOTES:
>
>  * Google turned up several other reports of the same error message,
>    going back as far as python 2.6 for cygwin, but all the workarounds
>    seem to have been fixed in older versions upstream, and/or fix other
>    problems that had no obvious link with si_band (such as using
>    ncursesw instead of ncurses).
>  * I don't have (or know how to use) cygport, so maybe it would be as
>    simple as changing $VERSION in the .cygport file.
>
>
> Detailed steps I followed:
Update: I installed cygport, waded through various slight
incompatibilities in the patches, and verified that the compilation
still fails with the same error message. The modified .cygport and
updated patches are attached (other patches remain the same as for 3.2).

The steps to repro are now simply:
# download the 3.3.2 source .xz from python.org
$ ./cygport --64 python3-3.cygport prep
$ ./cygport --64 python3-3.cygport compile

Going by this StackOverflow question, si_band is POSIX, though I don't
know which version introduced it... the linux man pages suggest
POSIX.1-2001. In any case, it looks like si_band is endemic in POSIX
systems, but missing in cygwin.

Updating the signal module to no longer expose si_band at all seems to
work around the problem (see patch), but compilation still dies (much
later) with:

Traceback (most recent call last):
   File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 2166,
in <module>
     main()
   File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 2161,
in main
     "Tools/scripts/2to3", "Tools/scripts/pyvenv"]
   File
"/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/core.py", line
148, in setup
     dist.run_commands()
   File
"/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/dist.py", line
929, in run_commands
     self.run_command(cmd)
   File
"/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/dist.py", line
948, in run_command
     cmd_obj.run()
   File
"/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/command/build.py",
line 126, in run
     self.run_command(cmd_name)
   File
"/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/cmd.py", line
313, in run_command
     self.distribution.run_command(command)
   File
"/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/dist.py", line
948, in run_command
     cmd_obj.run()
   File
"/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/command/build_ext.py",
line 354, in run
     self.build_extensions()
   File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 245,
in build_extensions
     build_ext.build_extensions(self)
   File
"/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/command/build_ext.py",
line 463, in build_extensions
     self.build_extension(ext)
   File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 279,
in build_extension
     if not self.configure_ctypes(ext):
   File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 1807,
in configure_ctypes
     exec(f.read(), globals(), fficonfig)
   File "<string>", line 33, in <module>
KeyError: 'X86_WIN64'
Makefile:505: recipe for target 'sharedmods' failed

At this point I'm stuck... any advice from the gurus out there would be
appreciated.

Thanks,
Ryan


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

3.3-dbm.patch (1K) Download Attachment
3.3-pep3149.patch (690 bytes) Download Attachment
3.3-tkinter.patch (1K) Download Attachment
python3-3.cygport (2K) Download Attachment
3.3-si_band.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Unable to compile python 3.3 [Was: Re: Python 3.3 coming soon?]

nu774
Installing libffi-devel will let python pick system libffi, so you can
skip that libffi building part you are currently stuck.

(2013/10/15 10:10), Ryan Johnson wrote:

> "/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/command/build_ext.py",
> line 463, in build_extensions
>      self.build_extension(ext)
>    File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 279,
> in build_extension
>      if not self.configure_ctypes(ext):
>    File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 1807,
> in configure_ctypes
>      exec(f.read(), globals(), fficonfig)
>    File "<string>", line 33, in <module>
> KeyError: 'X86_WIN64'
> Makefile:505: recipe for target 'sharedmods' failed
>
> At this point I'm stuck... any advice from the gurus out there would be
> appreciated.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Unable to compile python 3.3 [Was: Re: Python 3.3 coming soon?]

Ryan Johnson-10
On 14/10/2013 11:28 PM, nu774 wrote:
> Installing libffi-devel will let python pick system libffi, so you can
> skip that libffi building part you are currently stuck.
Thanks for the hint.

Everything compiles, and I was able to create a binary package (though
the test target fails, see below).

Now to figure out how to make setup.exe see it...

Thanks,
Ryan

$  ./cygport --64 python3-3.3.cygport test
 >>> Testing python3-3.3.2-0
...
./python.exe
/usr/src/python3-3.3.2-0/src/Python-3.3.2/Tools/scripts/run_tests.py
/usr/src/python3-3.3.2-0/build/python -W default -bb -E -R -m test -r -w
-j 0 -u all,-largefile,-audio,-gui
Traceback (most recent call last):
   File
"/usr/src/python3-3.3.2-0/src/Python-3.3.2/Tools/scripts/run_tests.py",
line 51, in <module>
     main(sys.argv[1:])
   File
"/usr/src/python3-3.3.2-0/src/Python-3.3.2/Tools/scripts/run_tests.py",
line 47, in main
     os.execv(sys.executable, args)
PermissionError: [Errno 13] Permission denied
Makefile:875: recipe for target 'test' failed



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

[Solved] Re: Unable to compile python 3.3 [Was: Re: Python 3.3 coming soon?]

Ryan Johnson-10
On 15/10/2013 9:49 AM, Ryan Johnson wrote:
> On 14/10/2013 11:28 PM, nu774 wrote:
>> Installing libffi-devel will let python pick system libffi, so you
>> can skip that libffi building part you are currently stuck.
> Thanks for the hint.
>
> Everything compiles, and I was able to create a binary package (though
> the test target fails, see below).
>
> Now to figure out how to make setup.exe see it...
OK, I got it installed. The procedure (inefficient but simple enough):
- copy the package files into my local package directory
- manually hack the corresponding setup.ini to point at the new files
and their checksums
- run setup.exe to install from local directory

This isn't a permanent solution, because setup.ini gets clobbered every
time I connect to a mirror, and setup will try to downgrade me back to
the official python3 package.

Meanwhile, though, a cursory test suggests that everything is working:

$ python3
Python 3.3.2 (default, Oct 15 2013, 09:21:45)
[GCC 4.8.1] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> 3+5
8
 >>> {1:3, 4:5}
{1: 3, 4: 5}

The cygport files and patches I sent before remain unchanged and would
probably make a good starting point for the python3 maintainer's next
release, though the si_band issue has yet to be worked out in a good way.

> Thanks,
> Ryan


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: [Solved] Re: Unable to compile python 3.3 [Was: Re: Python 3.3 coming soon?]

Jason Tishler
Ryan,

On Tue, Oct 15, 2013 at 10:39:58AM -0400, Ryan Johnson wrote:
> The cygport files and patches I sent before remain unchanged and would
> probably make a good starting point for the python3 maintainer's next
> release, though the si_band issue has yet to be worked out in a good
> way.

I finally have a 64-bit Windows box.  I will begin the process of
producing 64-bit versions of my packages.  Thanks for the head start on
the python 3.3 package.

Jason

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Unable to compile python 3.3 [Was: Re: Python 3.3 coming soon?]

Jason Tishler
In reply to this post by nu774
On Tue, Oct 15, 2013 at 12:28:31PM +0900, nu774 wrote:

> Installing libffi-devel will let python pick system libffi, so you
> can skip that libffi building part you are currently stuck.
>
> (2013/10/15 10:10), Ryan Johnson wrote:
> >"/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/command/build_ext.py",
> >line 463, in build_extensions
> >     self.build_extension(ext)
> >   File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 279,
> >in build_extension
> >     if not self.configure_ctypes(ext):
> >   File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 1807,
> >in configure_ctypes
> >     exec(f.read(), globals(), fficonfig)
> >   File "<string>", line 33, in <module>
> >KeyError: 'X86_WIN64'
> >Makefile:505: recipe for target 'sharedmods' failed
> >
> >At this point I'm stuck... any advice from the gurus out there would be
> >appreciated.

I get the same build failure with Python 2.7.5 and 3.2.5 under 64-bit
Cygwin even though I configure --with-system-ffi and have libffi-devel
installed.  I noticed that libffi-devel installs its headers in a
non-standard location:

$ cygcheck -l libffi-devel | fgrep .h
/usr/lib/libffi-3.0.13/include/ffi.h
/usr/lib/libffi-3.0.13/include/ffitarget.h

AFAICT, this prevents Python's build system from using the system
provided libffi and attempt to build its own causing an error like the
one above.

I can workaround the problem by creating symlinks to the libffi header
files in /usr/include:

$ ln -s /usr/lib/libffi-3.0.13/include/* /usr/include

It appears that others have successfully built Python under 64-bit
Cygwin without resorting to my workaround.  Does anyone know what I'm
missing?

Thanks,
Jason

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Unable to compile python 3.3 [Was: Re: Python 3.3 coming soon?]

Ryan Johnson-10
On 31/10/2013 2:11 PM, Jason Tishler wrote:

> On Tue, Oct 15, 2013 at 12:28:31PM +0900, nu774 wrote:
>> Installing libffi-devel will let python pick system libffi, so you
>> can skip that libffi building part you are currently stuck.
>>
>> (2013/10/15 10:10), Ryan Johnson wrote:
>>> "/usr/src/python3-3.3.2-3/src/Python-3.3.2/Lib/distutils/command/build_ext.py",
>>> line 463, in build_extensions
>>>      self.build_extension(ext)
>>>    File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 279,
>>> in build_extension
>>>      if not self.configure_ctypes(ext):
>>>    File "/usr/src/python3-3.3.2-3/src/Python-3.3.2/setup.py", line 1807,
>>> in configure_ctypes
>>>      exec(f.read(), globals(), fficonfig)
>>>    File "<string>", line 33, in <module>
>>> KeyError: 'X86_WIN64'
>>> Makefile:505: recipe for target 'sharedmods' failed
>>>
>>> At this point I'm stuck... any advice from the gurus out there would be
>>> appreciated.
> I get the same build failure with Python 2.7.5 and 3.2.5 under 64-bit
> Cygwin even though I configure --with-system-ffi and have libffi-devel
> installed.  I noticed that libffi-devel installs its headers in a
> non-standard location:
>
> $ cygcheck -l libffi-devel | fgrep .h
> /usr/lib/libffi-3.0.13/include/ffi.h
> /usr/lib/libffi-3.0.13/include/ffitarget.h
>
> AFAICT, this prevents Python's build system from using the system
> provided libffi and attempt to build its own causing an error like the
> one above.
>
> I can workaround the problem by creating symlinks to the libffi header
> files in /usr/include:
>
> $ ln -s /usr/lib/libffi-3.0.13/include/* /usr/include
>
> It appears that others have successfully built Python under 64-bit
> Cygwin without resorting to my workaround.  Does anyone know what I'm
> missing?
Try installing pkg-config.

Ryan


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply | Threaded
Open this post in threaded view
|

Re: Unable to compile python 3.3 [Was: Re: Python 3.3 coming soon?]

Jason Tishler
Ryan,

On Thu, Oct 31, 2013 at 02:44:49PM -0400, Ryan Johnson wrote:
> On 31/10/2013 2:11 PM, Jason Tishler wrote:
> >It appears that others have successfully built Python under 64-bit
> >Cygwin without resorting to my workaround.  Does anyone know what I'm
> >missing?
>
> Try installing pkg-config.

That worked.

Thanks,
Jason

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple