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

Mailing List Archive: Python: Dev

Python 2.7: only Visual Studio 2008?

 

 

Python dev RSS feed   Index | Next | Previous | View Threaded


luc_j_bourhis at mac

Aug 21, 2012, 3:24 AM

Post #1 of 12 (773 views)
Permalink
Python 2.7: only Visual Studio 2008?

Greetings,

it is my understanding that the patches floating around the net to support Visual Studio 2010 to compile the Python core and for distutils will never be accepted and therefore that the 2.7 line is stuck to VS 2008 for the remaining of its life. Could you please confirm that?

Best wishes,

Luc

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


brian at python

Aug 21, 2012, 6:44 AM

Post #2 of 12 (758 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

On Tue, Aug 21, 2012 at 5:24 AM, Luc Bourhis <luc_j_bourhis [at] mac> wrote:
> Greetings,
>
> it is my understanding that the patches floating around the net to support Visual Studio 2010 to compile the Python core and for distutils will never be accepted and therefore that the 2.7 line is stuck to VS 2008 for the remaining of its life. Could you please confirm that?

This is correct. A compiler upgrade is a feature, so the change to
VS2010 could only be applied to the version actively receiving new
features, which at the time was 3.3.
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


amauryfa at gmail

Aug 21, 2012, 7:35 AM

Post #3 of 12 (763 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

2012/8/21 Brian Curtin <brian [at] python>:
> On Tue, Aug 21, 2012 at 5:24 AM, Luc Bourhis <luc_j_bourhis [at] mac> wrote:
>> Greetings,
>>
>> it is my understanding that the patches floating around the net to support Visual Studio 2010 to compile the Python core and for distutils will never be accepted and therefore that the 2.7 line is stuck to VS 2008 for the remaining of its life. Could you please confirm that?
>
> This is correct. A compiler upgrade is a feature, so the change to
> VS2010 could only be applied to the version actively receiving new
> features, which at the time was 3.3.

But this does not prevent anyone from creating and maintaining such a
patch, outside of the official python.org repository.

--
Amaury Forgeot d'Arc
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


martin at v

Aug 21, 2012, 7:57 AM

Post #4 of 12 (762 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

Zitat von Luc Bourhis <luc_j_bourhis [at] mac>:

> it is my understanding that the patches floating around the net to
> support Visual Studio 2010 to compile the Python core and for
> distutils will never be accepted and therefore that the 2.7 line is
> stuck to VS 2008 for the remaining of its life. Could you please
> confirm that?

That is correct, yes.

OTOH, Python is free software, so people are free to maintain such
patches, and even make binary releases out of them. These just won't
be available from python.org.

Regards,
Martin

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


martin at v

Aug 21, 2012, 8:01 AM

Post #5 of 12 (761 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

Zitat von Brian Curtin <brian [at] python>:

> On Tue, Aug 21, 2012 at 5:24 AM, Luc Bourhis <luc_j_bourhis [at] mac> wrote:
>> Greetings,
>>
>> it is my understanding that the patches floating around the net to
>> support Visual Studio 2010 to compile the Python core and for
>> distutils will never be accepted and therefore that the 2.7 line is
>> stuck to VS 2008 for the remaining of its life. Could you please
>> confirm that?
>
> This is correct. A compiler upgrade is a feature

In the specific case, this isn't actually the limiting factor.
Instead, it's binary compatibility: binaries compiled with VS 2010
are incompatible (in some cases) with those compiled with VS 2008.
So if the python.org binaries were released as compiler outputs
from VS 2010, exising extensions modules might crash Python. Therefore,
we cannot switch.

Maintaining a VS 2010 build process along with the VS 2008 process
would be a new feature, indeed. Fortunately, Mercurial makes it easy
enough to maintain such patches in a ways that allows simple tracking of
changes applied to 2.7 itself, for anybody with enough interest to do
so.

Regards,
Martin


_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


lists at cheimes

Aug 21, 2012, 8:32 AM

Post #6 of 12 (761 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

Am 21.08.2012 17:01, schrieb martin [at] v:
> In the specific case, this isn't actually the limiting factor.
> Instead, it's binary compatibility: binaries compiled with VS 2010
> are incompatible (in some cases) with those compiled with VS 2008.
> So if the python.org binaries were released as compiler outputs
> from VS 2010, exising extensions modules might crash Python. Therefore,
> we cannot switch.

Compatibility issues may lead to other strange bugs, too. IIRC each
msvcrt has its own thread local storage and therefore its own errno
handling. An extension compiled with VS 2010 won't be able to use the
PyErr_SetFromErrno*() function correctly. That's much harder to debug
than a FILE pointer mismatch because it usually doesn't cause a segfault.

Christian

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


luc_j_bourhis at mac

Aug 21, 2012, 10:38 AM

Post #7 of 12 (761 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

Thanks for the quick response.

>> [...] A compiler upgrade is a feature, so the change to
>> VS2010 could only be applied to the version actively receiving new
>> features, which at the time was 3.3.
>
> But this does not prevent anyone from creating and maintaining such a
> patch, outside of the official python.org repository.

I was contemplating that option indeed. Sébastien Sablé seemed to have the same aim. Would you know any other such efforts? I would rather prefer to contribute back to the community.

Best wishes,

Luc Bourhis

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


martin at v

Aug 21, 2012, 3:34 PM

Post #8 of 12 (753 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

> I was contemplating that option indeed. Sébastien Sablé seemed to
> have the same aim. Would you know any other such efforts?

I believe Kristjan Jonsson has a port as well.

Regards,
Martin


_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


martin at v

Aug 25, 2012, 10:02 AM

Post #9 of 12 (727 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

> Compatibility issues may lead to other strange bugs, too. IIRC each
> msvcrt has its own thread local storage and therefore its own errno
> handling. An extension compiled with VS 2010 won't be able to use the
> PyErr_SetFromErrno*() function correctly. That's much harder to debug
> than a FILE pointer mismatch because it usually doesn't cause a segfault.

Interesting point. This somewhat breaks the stable ABI, which does
include three SetFromErrno functions. So I guess we need to warn users
of the stable ABI against using these functions.

A solution would then be to add an additional set of functions which
expect errno as a parameter, although this is quite some complication.
Another solution is to introduce a Py_errno macro (and _Py_errno
function) which exposes Python's view of errno, so code that might
be confronted with this issue would write

Py_errno = errno;

before calling any of these functions.

Except for the FILE* issue, I never considered any of the other issues
really relevant for Python extensions, namely:
- each CRT has its own heap, allocating on one heap and releasing to
the other can leak. Not an issue for Python, since no Python API
involves malloc/free pairs across DLL boundaries.
- each CRT has its own timezone. This isn't really an issue, as they
still get initialized consistently when the process starts (I guess
except when the process starts before the DST change, but imports
the extension after the DST change).
- each CRT has its own locale. This may be an issue if an extension
module relies on the CRT locale for data formatting; I just think
this is unlikely to occur in practice (and when it does, it's easily
notable).

Anything else that you are aware of?

Regards,
Martin
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


stefan at bytereef

Aug 25, 2012, 10:36 AM

Post #10 of 12 (727 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

"Martin v. L?wis" <martin [at] v> wrote:
> - each CRT has its own locale. This may be an issue if an extension
> module relies on the CRT locale for data formatting; I just think
> this is unlikely to occur in practice (and when it does, it's easily
> notable).

_decimal's 'n' format specifier actually relies on the CRT locale. The
functions in question are in libmpdec, so on Windows it is not possible
to compile a static libmpdec and build the module from that.

Well, it's possible, but setting the locale from Python then has no
effect on the module, IIRC.


Stefan Krah


_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


martin at v

Aug 25, 2012, 10:49 AM

Post #11 of 12 (735 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

On 25.08.2012 19:36, Stefan Krah wrote:
> "Martin v. L?wis" <martin [at] v> wrote:
>> - each CRT has its own locale. This may be an issue if an extension
>> module relies on the CRT locale for data formatting; I just think
>> this is unlikely to occur in practice (and when it does, it's easily
>> notable).
>
> _decimal's 'n' format specifier actually relies on the CRT locale. The
> functions in question are in libmpdec, so on Windows it is not possible
> to compile a static libmpdec and build the module from that.

Building a static libmpdec should work fine, as long as it links with
the CRT DLL. Most likely, the problem was that the project file in
question would also link with the static CRT, which then causes the
problem.

But I see the point that extension modules may rely on the locale set by
the Python script.

Regards,
Martin

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


lists at cheimes

Sep 7, 2012, 4:39 AM

Post #12 of 12 (623 views)
Permalink
Re: Python 2.7: only Visual Studio 2008? [In reply to]

Hi Martin,

I'm sorry for my delayed reply, my backlog grew rather large.

Am 25.08.2012 19:02, schrieb "Martin v. Löwis":
> Interesting point. This somewhat breaks the stable ABI, which does
> include three SetFromErrno functions. So I guess we need to warn users
> of the stable ABI against using these functions.

As far as I know it's only an issue an Windows. The stable ABI
documentation should mention that mixing C runtime libraries may cause
bugs and segfaults. As a Python core developer with some experience with
Windows I'm well aware of the possible issues. Others may fall for it as
the docs lack a clear warning -- or I wasn't able to find the warning
quickly.


> A solution would then be to add an additional set of functions which
> expect errno as a parameter, although this is quite some complication.
> Another solution is to introduce a Py_errno macro (and _Py_errno
> function) which exposes Python's view of errno, so code that might
> be confronted with this issue would write
>
> Py_errno = errno;
>
> before calling any of these functions.

I like the Py_errno idea. It's simple and doesn't introduce three or
more new methods. Can we still implement the feature for 3.3.0 or is it
too late?


> Anything else that you are aware of?

AFAIK each CRT has its own thread local storage. But that's not an issue
for us as we already have an API for TLS access.

Christian
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Python dev 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.