[pypy-commit] pypy py3.5: merge default into branch
mattip
pypy.commits at gmail.com
Sat Jun 9 02:11:41 EDT 2018
Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.5
Changeset: r94745:2e791fab4895
Date: 2018-06-09 06:10 -0700
http://bitbucket.org/pypy/pypy/changeset/2e791fab4895/
Log: merge default into branch
diff --git a/pypy/doc/windows.rst b/pypy/doc/windows.rst
--- a/pypy/doc/windows.rst
+++ b/pypy/doc/windows.rst
@@ -29,29 +29,28 @@
``C:\Users\<user name>\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python``
or in
``C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python``.
-A current version of ``setuptools`` will be able to find it there. For
-Windows 10, you must right-click the download, and under ``Properties`` ->
-``Compatibility`` mark it as ``Run run this program in comatibility mode for``
-``Previous version...``. Also, you must download and install the ``.Net Framework 3.5``,
+A current version of ``setuptools`` will be able to find it there.
+Also, you must download and install the ``.Net Framework 3.5``,
otherwise ``mt.exe`` will silently fail. Installation will begin automatically
by running the mt.exe command by hand from a DOS window (that is how the author
discovered the problem).
.. _Microsoft Visual C++ Compiler for Python 2.7: https://www.microsoft.com/EN-US/DOWNLOAD/DETAILS.ASPX?ID=44266
-Installing "Build Tools for Visual Studio 2017" (for Python 3)
+Installing "Build Tools for Visual Studio 2015" (for Python 3)
--------------------------------------------------------------
-As documented in the CPython Wiki_, CPython now recommends Visual C++ version
-14.0. A compact version of the compiler suite can be obtained from Microsoft_
-downloads, search the page for "Build Tools for Visual Studio 2017".
+As documented in the CPython Wiki_, CPython recommends Visual C++ version
+14.0 for python version 3.5. A compact version of the compiler suite can be
+obtained from Microsoft_ downloads, search the page for "Microsoft Build Tools 2015".
-You will also need to install the the `Windows SDK`_ in order to use the
-`mt.exe` mainfest compiler.
+You will need to reboot the computer for the installation to successfully install and
+run the `mt.exe` mainfest compiler. The installation will set the
+`VS140COMNTOOLS` environment variable, this is key to distutils/setuptools
+finding the compiler
.. _Wiki: https://wiki.python.org/moin/WindowsCompilers
-.. _Microsoft: https://www.visualstudio.com/downloads
-.. _`Windows SDK`: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
+.. _Microsoft: https://www.visualstudio.com/vs/older-downloads/
Translating PyPy with Visual Studio
-----------------------------------
@@ -99,6 +98,9 @@
Setting Up Visual Studio 9.0 for building SSL in Python3
--------------------------------------------------------
+**Note: this is old information, left for historical reference. We recommend
+using Visual Studio 2015, which now seems to properly set this all up.**
+
On Python3, the ``ssl`` module is based on ``cffi``, and requires a build step after
translation. However ``distutils`` does not support the Micorosft-provided Visual C
compiler, and ``cffi`` depends on ``distutils`` to find the compiler. The
@@ -146,14 +148,14 @@
Installing external packages
----------------------------
-We uses a `repository` parallel to pypy to hold binary compiled versions of the
+We uses a subrepository_ inside pypy to hold binary compiled versions of the
build dependencies for windows. As part of the `rpython` setup stage, environment
variables will be set to use these dependencies. The repository has a README
file on how to replicate, and a branch for each supported platform. You may run
the `get_externals.py` utility to checkout the proper branch for your platform
and PyPy version.
-.. _repository: https://bitbucket.org/pypy/external
+.. _subrepository: https://bitbucket.org/pypy/external
Using the mingw compiler
------------------------
diff --git a/pypy/module/cpyext/include/pyconfig.h b/pypy/module/cpyext/include/pyconfig.h
--- a/pypy/module/cpyext/include/pyconfig.h
+++ b/pypy/module/cpyext/include/pyconfig.h
@@ -31,16 +31,27 @@
#endif
#ifndef Py_BUILD_CORE /* not building the core - must be an ext */
-# if defined(_MSC_VER) && !defined(_CFFI_)
- /* So MSVC users need not specify the .lib file in
- * their Makefile (other compilers are generally
- * taken care of by distutils.) */
-# ifdef _DEBUG
-# error("debug first with cpython")
+# if defined(_MSC_VER) && !defined(_CFFI_)
+ /* So MSVC users need not specify the .lib file in
+ * their Makefile (other compilers are generally
+ * taken care of by distutils.)
+ */
+# ifdef _DEBUG
+# error("debug first with cpython")
# pragma comment(lib,"python35.lib")
-# else
+# else
# pragma comment(lib,"python35.lib")
-# endif /* _DEBUG */
+# endif /* _DEBUG */
+# define HAVE_COPYSIGN 1
+# define copysign _copysign
+# ifdef MS_WIN64
+ typedef __int64 ssize_t;
+# else
+ typedef _W64 int ssize_t;
+# endif
+#define HAVE_SSIZE_T 1
+
+
# endif
#endif /* _MSC_VER */
diff --git a/rpython/rlib/rposix_environ.py b/rpython/rlib/rposix_environ.py
--- a/rpython/rlib/rposix_environ.py
+++ b/rpython/rlib/rposix_environ.py
@@ -11,6 +11,13 @@
str0 = annmodel.s_Str0
+def llexternal(name, args, result, **kwds):
+ # Issue #2840
+ # All functions defined here should be releasegil=False, both
+ # because it doesn't make much sense to release the GIL and
+ # because the OS environment functions are usually not thread-safe
+ return rffi.llexternal(name, args, result, releasegil=False, **kwds)
+
# ____________________________________________________________
#
# Annotation support to control access to 'os.environ' in the RPython
@@ -66,7 +73,7 @@
prefix = ''
if sys.platform.startswith('darwin'):
CCHARPPP = rffi.CArrayPtr(rffi.CCHARPP)
- _os_NSGetEnviron = rffi.llexternal(
+ _os_NSGetEnviron = llexternal(
'_NSGetEnviron', [], CCHARPPP,
compilation_info=ExternalCompilationInfo(includes=['crt_externs.h'])
)
@@ -119,14 +126,13 @@
def r_putenv(name, value):
just_a_placeholder
-os_getenv = rffi.llexternal('getenv', [rffi.CCHARP], rffi.CCHARP,
- releasegil=False)
-os_putenv = rffi.llexternal(prefix + 'putenv', [rffi.CCHARP], rffi.INT,
+os_getenv = llexternal('getenv', [rffi.CCHARP], rffi.CCHARP)
+os_putenv = llexternal(prefix + 'putenv', [rffi.CCHARP], rffi.INT,
save_err=rffi.RFFI_SAVE_ERRNO)
if _WIN32:
- _wgetenv = rffi.llexternal('_wgetenv', [rffi.CWCHARP], rffi.CWCHARP,
- compilation_info=eci, releasegil=False)
- _wputenv = rffi.llexternal('_wputenv', [rffi.CWCHARP], rffi.INT,
+ _wgetenv = llexternal('_wgetenv', [rffi.CWCHARP], rffi.CWCHARP,
+ compilation_info=eci)
+ _wputenv = llexternal('_wputenv', [rffi.CWCHARP], rffi.INT,
compilation_info=eci,
save_err=rffi.RFFI_SAVE_LASTERROR)
@@ -206,7 +212,7 @@
REAL_UNSETENV = False
if hasattr(__import__(os.name), 'unsetenv'):
- os_unsetenv = rffi.llexternal('unsetenv', [rffi.CCHARP], rffi.INT,
+ os_unsetenv = llexternal('unsetenv', [rffi.CCHARP], rffi.INT,
save_err=rffi.RFFI_SAVE_ERRNO)
def unsetenv_llimpl(name):
More information about the pypy-commit
mailing list