[pypy-commit] pypy py3.5-msvc14: merge msvc14 into branch

2018-02-10 Thread mattip
Author: Matti Picus 
Branch: py3.5-msvc14
Changeset: r93796:a1fe6bf9
Date: 2018-02-10 18:58 -0500
http://bitbucket.org/pypy/pypy/changeset/a1fe6bf9/

Log:merge msvc14 into branch

diff too long, truncating to 2000 out of 2750 lines

diff --git a/get_externals.py b/get_externals.py
new file mode 100644
--- /dev/null
+++ b/get_externals.py
@@ -0,0 +1,69 @@
+'''Get external dependencies for building PyPy
+they will end up in the platform.host().basepath, something like 
repo-root/external
+'''
+
+from __future__ import print_function
+
+import argparse
+import os
+import zipfile
+from subprocess import Popen, PIPE
+from rpython.translator.platform import host
+
+def runcmd(cmd, verbose):
+stdout = stderr = ''
+report = False
+try:
+p = Popen(cmd, stdout=PIPE, stderr=PIPE)
+stdout, stderr = p.communicate()
+if p.wait() != 0 or verbose:
+report = True
+except Exception as e:
+stderr = str(e) + '\n' + stderr
+report = True
+if report:
+print('running "%s" returned\n%s\n%s' % (' '.join(cmd), stdout, 
stderr))
+if stderr:
+raise RuntimeError(stderr)
+
+def checkout_repo(dest='externals', org='pypy', branch='default', 
verbose=False):
+url = 'https://bitbucket.org/{}/externals'.format(org)
+if not os.path.exists(dest):
+cmd = ['hg','clone',url,dest]
+runcmd(cmd, verbose)
+cmd = ['hg','-R', dest, 'update',branch]
+runcmd(cmd, verbose)
+
+def extract_zip(externals_dir, zip_path):
+with zipfile.ZipFile(os.fspath(zip_path)) as zf:
+zf.extractall(os.fspath(externals_dir))
+return externals_dir / zf.namelist()[0].split('/')[0]
+
+def parse_args():
+p = argparse.ArgumentParser()
+p.add_argument('-v', '--verbose', action='store_true')
+p.add_argument('-O', '--organization',
+   help='Organization owning the deps repos', default='pypy')
+p.add_argument('-e', '--externals', default=host.externals,
+   help='directory in which to store dependencies',
+   )
+p.add_argument('-b', '--branch', default=host.externals_branch,
+   help='branch to check out',
+   )
+p.add_argument('-p', '--platform', default=None,
+   help='someday support cross-compilation, ignore for now',
+   )
+return p.parse_args()
+
+
+def main():
+args = parse_args()
+checkout_repo(
+dest=args.externals,
+org=args.organization,
+branch=args.branch,
+verbose=args.verbose,
+)
+
+if __name__ == '__main__':
+main()
diff --git a/pypy/doc/windows.rst b/pypy/doc/windows.rst
--- a/pypy/doc/windows.rst
+++ b/pypy/doc/windows.rst
@@ -42,7 +42,7 @@
 Translating PyPy with Visual Studio
 ---
 
-We routinely test translation using v9, also known as Visual Studio 2008.
+We routinely test translation of PyPy 2.7 using v9 and PyPy 3 with vc14.
 Other configurations may work as well.
 
 The translation scripts will set up the appropriate environment variables
@@ -132,243 +132,14 @@
 Installing external packages
 
 
-On Windows, there is no standard place where to download, build and
-install third-party libraries.  We recommend installing them in the parent
-directory of the pypy checkout.  For example, if you installed pypy in
-``d:\pypy\trunk\`` (This directory contains a README file), the base
-directory is ``d:\pypy``. You must then set the
-INCLUDE, LIB and PATH (for DLLs) environment variables appropriately.
+We uses a `repository` parallel to 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.
 
-
-Abridged method (using Visual Studio 2008)
---
-
-Download the versions of all the external packages from
-https://bitbucket.org/pypy/pypy/downloads/local_59.zip
-(for post-5.8 builds) with sha256 checksum
-``6344230e90ab7a9cb84efbae1ba22051cdeeb40a31823e0808545b705aba8911``
-https://bitbucket.org/pypy/pypy/downloads/local_5.8.zip
-(to reproduce 5.8 builds) with sha256 checksum 
-``fbe769bf3a4ab6f5a8b0a05b61930fc7f37da2a9a85a8f609cf5a9bad06e2554`` or
-https://bitbucket.org/pypy/pypy/downloads/local_2.4.zip
-(for 2.4 release and later) or
-https://bitbucket.org/pypy/pypy/downloads/local.zip
-(for pre-2.4 versions)
-Then expand it into the base directory (base_dir) and modify your environment
-to reflect this::
-
-set PATH=\bin;%PATH%
-set INCLUDE=\include;%INCLUDE%
-set LIB=\lib;%LIB%
-
-Now you should be good to go. If you choose this method, you do not need
-to download/build anything else. 
-
-Nona

[pypy-commit] pypy py3.5-msvc14: prefer msvc14

2018-02-10 Thread mattip
Author: Matti Picus 
Branch: py3.5-msvc14
Changeset: r93797:c16af036eb3c
Date: 2018-02-10 19:01 -0500
http://bitbucket.org/pypy/pypy/changeset/c16af036eb3c/

Log:prefer msvc14

diff --git a/rpython/translator/platform/windows.py 
b/rpython/translator/platform/windows.py
--- a/rpython/translator/platform/windows.py
+++ b/rpython/translator/platform/windows.py
@@ -29,8 +29,9 @@
 return None
 
 def Windows(cc=None, ver0=None):
-if ver0 is None:
-ver0 = _get_vcver0()
+# disallow getting currently used compiler
+#if ver0 is None:
+#ver0 = _get_vcver0()
 return _get_compiler_type(cc, False, ver0=ver0)
 
 def Windows_x64(cc=None, ver0=None):
___
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit