msg114738 - (view) |
Author: Brian Curtin (brian.curtin) *  |
Date: 2010-08-23 21:31 |
Using Cygwin 1.7, there are build failures for both _curses, _curses_panel, and _io.
The curses failures are because symlinking /usr/include/{n}curses.h from /usr/include/{n}curses.h was removed in recent versions [0], so I added "-I/usr/include/ncurses" to the BASECFLAGS for cygwin. Not knowing the ins and outs of gcc/configure/make, I doubt the patch (ncurses_fix.diff) is correct or complete. It works on my machine so at least it's a starting point (maybe?).
_io gets the following warning and then later failure on gcc 4.3.4:
/cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/_iomodule.c:172: warning: ‘PyExc_BlockingIOError’ redeclared without dllimport attribute: previous dllimport ignored
...
build/temp.cygwin-1.7.5-i686-2.7/cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/bufferedio.o: In function `_buffered_check_blocking_error': /cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/bufferedio.c:558: undefined reference to `__imp__PyExc_BlockingIOError'
/cygdrive/c/Users/bcurtin/cygwin-python/release27-maint/Modules/_io/bufferedio.c:558: undefined reference to `__imp__PyExc_BlockingIOError'
My Linux compile (gcc 4.5.0) gets the same warning, but no error. Windows is totally fine with _iomodule.c:172.
This was found by Ben Walker.
[0] http://cygwin.com/ml/cygwin-announce/2010-01/msg00002.html
|
msg114741 - (view) |
Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) *  |
Date: 2010-08-23 21:52 |
The _io module appears both in setup.py and Modules/Setup.dist. Is it normal?
IMO if the _io module is built-in, it should not be built as an extension module.
|
msg114742 - (view) |
Author: Daniel Stutzbach (stutzbach)  |
Date: 2010-08-23 21:58 |
Should release27-maint/Modules/_io/_iomodule.c:172 be:
PyAPI_DATA(PyObject *) PyExc_BlockingIOError = (PyObject *)&_PyExc_BlockingIOError;
?
|
msg114744 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2010-08-23 22:01 |
Why should it be?
|
msg114745 - (view) |
Author: Roumen Petrov (rpetrov) * |
Date: 2010-08-23 22:09 |
patch of patch attached to issue 3871
--- ./Modules/_io/_iomodule.h.MINGW 2009-12-23 12:52:04.000000000 +0200
+++ ./Modules/_io/_iomodule.h 2009-12-14 22:01:16.000000000 +0200
@@ -72,7 +72,7 @@
PyObject *filename; /* Not used, but part of the IOError object */
Py_ssize_t written;
} PyBlockingIOErrorObject;
-PyAPI_DATA(PyObject *) PyExc_BlockingIOError;
+extern PyObject* PyExc_BlockingIOError;
/*
* Offset type for positioning.
|
msg114749 - (view) |
Author: Daniel Stutzbach (stutzbach)  |
Date: 2010-08-23 22:21 |
> Why should it be?
The error indicates that the definition in the .c file doesn't match the declaration in the .h file, with respect to the funky Windows-specific stuff ('dllimport') that PyAPI_DATA adds.
Roumen's patch suggests I had it backwards, and it's the .h file that should be changed.
|
msg114750 - (view) |
Author: Benjamin Peterson (benjamin.peterson) *  |
Date: 2010-08-23 22:26 |
2010/8/23 Daniel Stutzbach <report@bugs.python.org>:
>
> Daniel Stutzbach <daniel@stutzbachenterprises.com> added the comment:
>
>> Why should it be?
>
> The error indicates that the definition in the .c file doesn't match the declaration in the .h file, with respect to the funky Windows-specific stuff ('dllimport') that PyAPI_DATA adds.
>
> Roumen's patch suggests I had it backwards, and it's the .h file that should be changed.
Why would this not be required for the standard exceptions then?
|
msg114751 - (view) |
Author: Ben Walker (bwalker) |
Date: 2010-08-23 22:36 |
I have been using the following patch to fix the issue locally for a few weeks now (in addition to something equivalent to what Brian submitted for the _curses issue). These two patches combined give me a working python 2.7 on cygwin 1.7. I originally used something identical to Roumen's patch, but later started using the patch below after reading up on __declspec. Note that line 740 is also a candidate to be changed to dllexport, but I don't have the setup to test that.
Index: Include/pyport.h
===================================================================
--- Include/pyport.h (revision 84288)
+++ Include/pyport.h (working copy)
@@ -739,7 +739,7 @@
# if !defined(__CYGWIN__)
# define PyAPI_FUNC(RTYPE) __declspec(dllimport)
RTYPE
# endif /* !__CYGWIN__ */
-# define PyAPI_DATA(RTYPE) extern __declspec(dllimport) RTYPE
+# define PyAPI_DATA(RTYPE) extern __declspec(dllexport) RTYPE
/* module init functions outside the core must be exported */
# if defined(__cplusplus)
# define PyMODINIT_FUNC extern "C" __declspec(dllexport) void
|
msg114759 - (view) |
Author: Roumen Petrov (rpetrov) * |
Date: 2010-08-23 23:44 |
Ben, import of variables cannot be changed to export as this will produce crash in application ("core dump"/"bus error" etc.) that try to use them.
|
msg114760 - (view) |
Author: Daniel Stutzbach (stutzbach)  |
Date: 2010-08-23 23:58 |
> Why would this not be required for the standard exceptions then?
It looks like PyAPI_DATA can be defined differently depending on whether we're building code as a built-in or as a loadable module. If _iomodule.c is really being built as a module, that would explain why there's a difference. The standard exceptions are always built-in.
In Python 2.7, _io is not the default I/O system for Python, so I could understand why it might be a loadable module there. Of course, if Amaury is right that it's being built both ways then I assume that could be the underlying problem.
Also, the definition of PyAPI_DATA has a bunch of conditions specifically for Cygwin, which (partially) explains why the behavior is different from a regular Windows build.
I am not an export on the dllimport and dllexport keywords, although I have needed to use them on occasion. I am speculating.
|
msg114761 - (view) |
Author: Brian Curtin (brian.curtin) *  |
Date: 2010-08-24 00:08 |
This patch lets everything build ok, but a run of regrtest segfaults usually after a few tests (using -r) and there are nearly constant stack traces printed to stderr about not being able to remap the Cygwin bz2 DLL's address space.
I used extern as Roumen suggested, plus my curses hack, and added a #ifndef in Modules/main.c that was causing a problem without it.
|
msg224252 - (view) |
Author: Mark Lawrence (BreamoreBoy) * |
Date: 2014-07-29 21:10 |
Stage needs setting to "patch review", any volunteers to undertake a review?
|
msg224620 - (view) |
Author: Roumen Petrov (rpetrov) * |
Date: 2014-08-03 08:55 |
PATH_MAX in duplicate with issue8548
Instead to modify BASECFLAGS user could configure with CPPFLAGS set if symbolic links are missing .
In addition 5.9 package creates links so work around is not required .
Please close as invalid.
|
msg345323 - (view) |
Author: Erik Bray (erik.bray) *  |
Date: 2019-06-12 11:48 |
I think this issue can probably be closed. It refers to a very old version of Cygwin as well as old versions of Python. I don't have any problem building the _curses or _io modules on recent versions of Cygwin (>=2.9) and with current cpython master (3.9.0a0).
|
|
Date |
User |
Action |
Args |
2022-04-11 14:57:05 | admin | set | github: 53874 |
2019-06-20 05:27:35 | methane | set | status: open -> closed resolution: out of date stage: needs patch -> resolved |
2019-06-12 11:48:23 | erik.bray | set | nosy:
+ erik.bray messages:
+ msg345323
|
2019-04-26 20:22:57 | BreamoreBoy | set | nosy:
- BreamoreBoy
|
2014-08-03 08:55:39 | rpetrov | set | messages:
+ msg224620 |
2014-07-29 21:35:57 | brian.curtin | set | nosy:
- brian.curtin
|
2014-07-29 21:10:00 | BreamoreBoy | set | versions:
+ Python 3.4, Python 3.5, - Python 3.1, Python 3.2 nosy:
+ BreamoreBoy, jlt63
messages:
+ msg224252
components:
+ Cross-Build, - Extension Modules, Windows |
2012-05-29 06:15:49 | arifwn | set | nosy:
+ arifwn
|
2010-09-24 14:59:51 | brian.curtin | set | assignee: brian.curtin -> |
2010-08-24 00:08:18 | brian.curtin | set | keywords:
patch, patch files:
+ issue9665.diff messages:
+ msg114761
|
2010-08-23 23:58:11 | stutzbach | set | keywords:
patch, patch
messages:
+ msg114760 |
2010-08-23 23:44:48 | rpetrov | set | messages:
+ msg114759 |
2010-08-23 22:36:34 | bwalker | set | nosy:
+ bwalker messages:
+ msg114751
|
2010-08-23 22:26:02 | benjamin.peterson | set | messages:
+ msg114750 |
2010-08-23 22:21:52 | stutzbach | set | keywords:
patch, patch
messages:
+ msg114749 |
2010-08-23 22:09:46 | rpetrov | set | nosy:
+ rpetrov messages:
+ msg114745
|
2010-08-23 22:01:06 | benjamin.peterson | set | keywords:
patch, patch nosy:
+ benjamin.peterson messages:
+ msg114744
|
2010-08-23 21:58:41 | stutzbach | set | keywords:
patch, patch
messages:
+ msg114742 |
2010-08-23 21:52:30 | amaury.forgeotdarc | set | keywords:
patch, patch nosy:
+ amaury.forgeotdarc messages:
+ msg114741
|
2010-08-23 21:31:58 | brian.curtin | create | |