Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue13210] Support Visual Studio 2010

 

 

First page Previous page 1 2 3 Next page Last page  View All Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Apr 26, 2012, 4:49 AM

Post #1 of 58 (401 views)
Permalink
[issue13210] Support Visual Studio 2010

Changes by Mark Dickinson <dickinsm [at] gmail>:


----------
nosy: +mark.dickinson

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 8:05 AM

Post #2 of 58 (398 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Richard Oudkerk <shibturn [at] gmail> added the comment:

> the errno codes (EAGAIN etc) are provided only as a compatibility for
> posix apps that test "errno". On windows, we use the WSA return values
> from the api functions and WsaGetLastError().
> ...
> So, the proposed patch is not a change, it is merely reinforcing the
> previous practice of prefering the native error codes over the 'errno'
> emulation.

Except that Microsoft's C library also uses some of the non-WSA versions. For instance read() (or _read()) is documented to set errno to EBADF or EINVAL on error. So EBADF and EINVAL are just as "native" as WSAEBADF and WSAEINVAL.

It is also quite common for python's C code to do stuff like

errno = EINVAL;
PyErr_SetFromErrno(PyExc_OSError);

errnomap in Objects/exceptions.c is used to convert some OSError exceptions to subclasses like PermissionError. It shouldn't be hard to use it to also convert WSAEINVAL to EINVAL etc.

----------
nosy: +sbt

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 8:09 AM

Post #3 of 58 (391 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Brian Curtin <brian [at] python> added the comment:

I recently added what you just mentioned in the vs2010port branch for WSA and non-WSA to work together. I still need to figure out some distutils/packaging failures, but the port is nearly ready*.

* I've only focused on 32-bit debug builds, but updating the project files and whatnot for other configurations is easy.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 8:19 AM

Post #4 of 58 (396 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Kristján Valur Jónsson <kristjan [at] ccpgames> added the comment:

> Except that Microsoft's C library also uses some of the non-WSA
> versions. For instance read() (or _read()) is documented to set
> errno to EBADF or EINVAL on error. So EBADF and EINVAL are just as
> "native" as WSAEBADF and WSAEINVAL.
read() is a posix function, so of course they set errno for it. You'll probably find that GetLastError() will some native error codes.


> It is also quite common for python's C code to do stuff like
> errno = EINVAL;
> PyErr_SetFromErrno(PyExc_OSError);
This doesn't change that, and as far as I know, this has worked and continues to work. "errno" is supported.

> errnomap in Objects/exceptions.c is used to convert some OSError
> exceptions to subclasses like PermissionError. It shouldn't be hard
> to use it to also convert WSAEINVAL to EINVAL etc.
Why would we get different errors codes for e.g. connection reset events because we build with a different compiler?
Python has always used the native error codes for socket io on windows, why change that?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 8:20 AM

Post #5 of 58 (391 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Kristján Valur Jónsson <kristjan [at] ccpgames> added the comment:

Brian, I posted a suggested port five weeks ago. What kind of problems are you having? It's really a very straightforward thing.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 8:22 AM

Post #6 of 58 (386 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Kristján Valur Jónsson <kristjan [at] ccpgames> added the comment:

Also, I'm not sure distutils and all that is really necessary. As I understood it, the goal is to make it so that the casual hacker can compile and run python using visual studio 2010. 3.3 continues to be "officially" distributed with 2008. Surely it is possible to do this in smaller steps, rather than one fell swoop?
For instance, the sxs patch and the errnomodule patch could go in now without disturbing anything whatsoever.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 8:31 AM

Post #7 of 58 (390 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Brian Curtin <brian [at] python> added the comment:

No, this is the real thing. Python 3.3 distributed on VS2010.

In order to ship a fully built Python 3.3 MSI for users, I've found it's not just as easy as updating errno. I'll strip out all of the project file changes and whatnot and post a patch of the actual C and Python code changes to see that this is in line with what people think is usable.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 8:32 AM

Post #8 of 58 (386 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Brian Curtin <brian [at] python> added the comment:

Also, I personally don't care about distutils, but I need all of the tests to pass before I can consider merging this. Distutils and packaging need a few changes to be able to compile extensions and create setups and whatever with VS2010.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 8:40 AM

Post #9 of 58 (386 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Éric Araujo <merwok [at] netwok> added the comment:

Could you attach a file with the distutils/packaging test output? I don’t really know the packaging.compiler module, but I may be able to make sense of the error messages and work with you to fix them.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 9:14 AM

Post #10 of 58 (387 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Richard Oudkerk <shibturn [at] gmail> added the comment:

> This doesn't change that, and as far as I know, this has worked and
> continues to work. "errno" is supported.

Using your patch, does the following throw an AssertionError?

>>> import os, errno
>>> try:
... os.read(-1, 10)
... except OSError as e:
... assert e.errno == errno.EBADF
...
>>>

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 10:28 AM

Post #11 of 58 (386 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Kristján Valur Jónsson <kristjan [at] ccpgames> added the comment:

> Using your patch, does the following throw an AssertionError?
Yes, it looks as though it will. It seems I was too agressive, since errnomodule has different entries for EBADF and WSAEBADF.

This is the kind of feedback I'd like to have had earlier. It means that there are some cases were we want to keep the winsock error codes there separately from the others. Annoying as that may be.

Brian, do I understand you correctly that 2010 is to the official compiler for 3.3?

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 10:30 AM

Post #12 of 58 (387 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Brian Curtin <brian [at] python> added the comment:

Yes.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 10:34 AM

Post #13 of 58 (394 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Kristján Valur Jónsson <kristjan [at] ccpgames> added the comment:

Super, I must have missed that memo. At PyCon there wasn't much enthusiasm for it, and this was considered a toy project :)

You may be interested in my patch to see what I did with the project files, then. Otherwise, I'll be happy to review yours. In particular, I removed a bunch of redundant settings, and fixed the .props files.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 11:56 AM

Post #14 of 58 (394 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Martin v. Löwis <martin [at] v> added the comment:

> For instance, the sxs patch and the errnomodule patch could go in now
> without disturbing anything whatsoever.

I'm not convinced that the errno change is actually correct.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 11:58 AM

Post #15 of 58 (392 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Martin v. Löwis <martin [at] v> added the comment:

> Brian, do I understand you correctly that 2010 is to the official compiler for 3.3?

Unless we switch to VS 2012, yes.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 12:00 PM

Post #16 of 58 (387 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Brian Curtin <brian [at] python> added the comment:

I don't have a link handy, but from what I've read we could go from VS2010 to VS2012 with relative ease since it's supposed to be able to work with 2010 solutions/project files. I haven't tried this with the beta, but I'll take a look.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 12:51 PM

Post #17 of 58 (388 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Brian Curtin <brian [at] python> added the comment:

VS11 opened the VS2010 project fine without doing conversion. Note that this just uses VS11 to work with the project in VS2010 mode with the 2010 compiler.

Doing the conversion to VS11's compiler is another thing to consider, although probably not until it goes RTM. I just ran the conversion from VS2010 to VS11 and it just sets "PlatformToolset" to "v110" in all vcxproj files. It didn't compile cleanly, having 25 projects succeed and 4 fail, but it was more than enough to get python_d.exe to run. A few tests failed, but they're the same as the failures on VS2010, so we're not far off from VS11 easily working.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 1:22 PM

Post #18 of 58 (391 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Changes by STINNER Victor <victor.stinner [at] gmail>:


----------
nosy: -haypo

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 2:07 PM

Post #19 of 58 (389 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Kristján Valur Jónsson <kristjan [at] ccpgames> added the comment:

MVL wrote:
> I'm not convinced that the errno change is actually correct.

You are right, as SBT pointed out. There are cases where we have had errno.EFOO and errno.WSAEFOO point to different values, because one was used by sockets and other by regular stuff. My patch was too heavy handed and nerfed at least EBADF. Perhaps others. (Getting a concrete example from SBT was helpful, btw)

For socket-specific errors, it is an easy choice, however, but for socket error codes that also have to do with file IO it is less clear and probably full of special cases. This is nothing new, however. For writing portable socket code that needs to deal with the EBADF code, you would have to check for WSAEBADF on windows and EBADF on linux. Probably both to be portable.

Since my patch was aimed at making 3.3. merely compilable for VS2010 I wanted to maintain the same value semantics as were it compiled for 2008. If we are changing the compiler version however, we might just as well take the plunge and translate the windows codes where they have corresponding posix codes. I'm eager to see Brian's patch.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 26, 2012, 2:09 PM

Post #20 of 58 (391 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Kristján Valur Jónsson <kristjan [at] ccpgames> added the comment:

[.the Soney PS3 sdk also has weird error codes for its otherwise posix compatible api. I did write a translation layer to convert those codes into posix codes where appropriate. I could show you what I did, but I'd proably set me up to be lynched by Soney's lawyers.]

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 27, 2012, 4:12 AM

Post #21 of 58 (393 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Richard Oudkerk <shibturn [at] gmail> added the comment:

The problems with error numbers seem to be caused by the addition of a new section in errno.h:

/* POSIX SUPPLEMENT */
#define EADDRINUSE 100
#define EADDRNOTAVAIL 101
...
#define ETXTBSY 139
#define EWOULDBLOCK 140

Of these the only ones which clash with WSA equivalents are

EADDRINUSE
EADDRNOTAVAIL
EAFNOSUPPORT
EALREADY
ECONNABORTED
ECONNREFUSED
ECONNRESET
EDESTADDRREQ
EHOSTUNREACH
EINPROGRESS
EISCONN
ELOOP
EMSGSIZE
ENETDOWN
ENETRESET
ENETUNREACH
ENOBUFS
ENOPROTOOPT
ENOTCONN
ENOTSOCK
EOPNOTSUPP
EPROTONOSUPPORT
EPROTOTYPE
ETIMEDOUT
EWOULDBLOCK

I think the simplest solution is just to undefine these new "clashing" constants near the top of Modules/errnomodule.c and Objects/exceptions.c so that we fall back to the preferred WSA equivalents later.

I have tried this by cloning sandbox/vs2010port, reverting

Objects/exceptions.c
Modules/posixmodule.c
Modules/errnomodule.c
Modules/_io/fileio.c

to "ancestor(vs2010,default)" and then applying the attached patch. I get four failures:

test_distutils
test_email
test_import
test_packaging

This is an improvement over the tip of vs2010 (2fc5398b3115) where I get two additional failures

test_importlib
test_subprocess

----------
Added file: http://bugs.python.org/file25379/wsa_undef.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Apr 27, 2012, 7:43 AM

Post #22 of 58 (391 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Richard Oudkerk <shibturn [at] gmail> added the comment:

According to http://msdn.microsoft.com/en-us/library/5814770t.aspx the "supported" errno values in VS2010 are

E2BIG EACCES EAGAIN EBADF ECHILD EDEADLOCK EDOM EEXIST EILSEQ
EINVAL EMFILE ENOENT ENOEXEC ENOMEM ENOSPC ERANGE EXDEV STRUNCATE

of which the ones with WSA equivalents are

EACCES EBADF EINVAL EMFILE

The other constants listed in errno.h are for "compatibility with POSIX".

I take this to mean that the only errno values which will be set by libc are on the supported list. We should not change any of these, but I think we can redefine the others to WSA equivalents without a problem.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 1, 2012, 8:58 PM

Post #23 of 58 (373 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Brian Curtin <brian [at] python> added the comment:

As of a40f47cc7691, Richard's idea is now the implementation, which seems to work well and has simplified the changes quite well. Attached is code_changes.diff which shows all of the necessary code changes as of now.

The test_import failure you were originally seeing has gone away (it was on default as well, I guess it has been fixed). test_email fails on the default branch as well so nothing new there.

----------
Added file: http://bugs.python.org/file25433/code_changes.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 2, 2012, 3:15 AM

Post #24 of 58 (369 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Kristján Valur Jónsson <kristjan [at] ccpgames> added the comment:

Posted some comments.
Also, I see you didn't remove the old SxS functionality, no longer used by VS2010 (see my sxs.patch)

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 8, 2012, 7:56 PM

Post #25 of 58 (361 views)
Permalink
[issue13210] Support Visual Studio 2010 [In reply to]

Brian Curtin <brian [at] python> added the comment:

The tip of the vs2010 branch now works just as well as default does. There are no outstanding test failures that aren't seen on default -- test_email still fails for some line ending stuff, but that's not relevant here.

Attached is a patch showing just the code changes, including Kristjan's SXS patch, support in Tools\msi\msi.py for VS2010, and a few small distutils and packaging version adjustments to work with VS2010.

----------
keywords: +needs review
stage: -> patch review
Added file: http://bugs.python.org/file25503/code_changes2.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue13210>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

First page Previous page 1 2 3 Next page Last page  View All Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.