Author: Matti Picus <matti.pi...@gmail.com> Branch: py3.5 Changeset: r95658:48303f7469f9 Date: 2019-01-17 00:28 +0200 http://bitbucket.org/pypy/pypy/changeset/48303f7469f9/
Log: merge default into branch diff --git a/pypy/conftest.py b/pypy/conftest.py --- a/pypy/conftest.py +++ b/pypy/conftest.py @@ -14,6 +14,14 @@ rsyncdirs = ['.', '../lib-python', '../lib_pypy', '../demo'] rsyncignore = ['_cache'] +try: + from hypothesis import settings +except ImportError: + pass +else: + settings.register_profile('default', deadline=None) + settings.load_profile('default') + # PyPy's command line extra options (these are added # to py.test's standard options) # 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 @@ -9,14 +9,14 @@ import rpython rpydir = str(py.path.local(rpython.__file__).join('..')) -def _get_compiler_type(cc, x64_flag, ver0=None): +def _get_compiler_type(cc, x64_flag): if not cc: cc = os.environ.get('CC','') if not cc: - return MsvcPlatform(x64=x64_flag, ver0=ver0) + return MsvcPlatform(x64=x64_flag) elif cc.startswith('mingw') or cc == 'gcc': return MingwPlatform(cc) - return MsvcPlatform(cc=cc, x64=x64_flag, ver0=ver0) + return MsvcPlatform(cc=cc, x64=x64_flag) def _get_vcver0(): # try to get the compiler which served to compile python @@ -28,17 +28,13 @@ return vsver return None -def Windows(cc=None, ver0=None): - #if ver0 is None: - # ver0 = _get_vcver0() - return _get_compiler_type(cc, False, ver0=ver0) +def Windows(cc=None): + return _get_compiler_type(cc, False) def Windows_x64(cc=None, ver0=None): raise Exception("Win64 is not supported. You must either build for Win32" " or contribute the missing support in PyPy.") - if ver0 is None: - ver0 = _get_vcver0() - return _get_compiler_type(cc, True, ver0=ver0) + return _get_compiler_type(cc, True) def _find_vcvarsall(version, x64flag): import rpython.tool.setuptools_msvc as msvc @@ -50,7 +46,7 @@ return msvc.msvc14_get_vc_env(arch) else: return msvc.msvc9_query_vcvarsall(version / 10.0, arch) - + def _get_msvc_env(vsver, x64flag): vcdict = None toolsdir = None @@ -74,7 +70,7 @@ # even msdn does not know which to run # see https://msdn.microsoft.com/en-us/library/1700bbwd(v=vs.90).aspx # which names both - vcvars = os.path.join(toolsdir, 'vcvars32.bat') + vcvars = os.path.join(toolsdir, 'vcvars32.bat') import subprocess try: @@ -83,12 +79,14 @@ stderr=subprocess.PIPE) stdout, stderr = popen.communicate() - if popen.wait() != 0: + if popen.wait() != 0 or stdout[:5].lower() == 'error': + log.msg('Running "%s" errored: \n\nstdout:\n%s\n\nstderr:\n%s' % ( + vcvars, stdout.split()[0], stderr)) return None - if stdout[:5].lower() == 'error': - log.msg('Running "%s" errored: %s' %(vcvars, stdout.split()[0])) - return None - except: + else: + log.msg('Running "%s" succeeded' %(vcvars,)) + except Exception as e: + log.msg('Running "%s" failed: "%s"', (vcvars, str(e))) return None stdout = stdout.replace("\r\n", "\n") @@ -102,6 +100,8 @@ for key, value in vcdict.items(): if key.upper() in ['PATH', 'INCLUDE', 'LIB']: env[key.upper()] = value + if 'PATH' not in env: + log.msg('Did not find "PATH" in stdout\n%s' %(stdout)) if not _find_executable('mt.exe', env['PATH']): # For some reason the sdk bin path is missing? # put it together from some other env variables that happened to exist @@ -113,7 +113,7 @@ log.msg('Could not find mt.exe on path=%s' % env['PATH']) log.msg('Running vsver %s set this env' % vsver) for key, value in vcdict.items(): - log.msg('%s=%s' %(key, value)) + log.msg('%s=%s' %(key, value)) log.msg("Updated environment with vsver %d, using x64 %s" % (vsver, x64flag,)) return env @@ -122,7 +122,7 @@ if ver0 in vcvers: vcvers.insert(0, ver0) errs = [] - for vsver in vcvers: + for vsver in vcvers: env = _get_msvc_env(vsver, x64flag) if env is not None: return env, vsver @@ -189,8 +189,13 @@ self.cc = cc # detect version of current compiler - returncode, stdout, stderr = _run_subprocess(self.cc, [], + try: + returncode, stdout, stderr = _run_subprocess(self.cc, [], env=self.c_environ) + except EnvironmentError: + log.msg('Could not run %s using PATH=\n%s' %(self.cc, + '\n'.join(self.c_environ['PATH'].split(';')))) + raise r = re.search(r'Microsoft.+C/C\+\+.+\s([0-9]+)\.([0-9]+).*', stderr) if r is not None: self.version = int(''.join(r.groups())) / 10 - 60 @@ -276,23 +281,21 @@ if not standalone: args = self._args_for_shared(args) - if self.version >= 80: - # Tell the linker to generate a manifest file - temp_manifest = exe_name.dirpath().join( - exe_name.purebasename + '.manifest') - args += ["/MANIFEST", "/MANIFESTFILE:%s" % (temp_manifest,)] + # Tell the linker to generate a manifest file + temp_manifest = exe_name.dirpath().join( + exe_name.purebasename + '.manifest') + args += ["/MANIFEST", "/MANIFESTFILE:%s" % (temp_manifest,)] self._execute_c_compiler(self.link, args, exe_name) - if self.version >= 80: - # Now, embed the manifest into the program - if standalone: - mfid = 1 - else: - mfid = 2 - out_arg = '-outputresource:%s;%s' % (exe_name, mfid) - args = ['-nologo', '-manifest', str(temp_manifest), out_arg] - self._execute_c_compiler('mt.exe', args, exe_name) + # Now, embed the manifest into the program + if standalone: + mfid = 1 + else: + mfid = 2 + out_arg = '-outputresource:%s;%s' % (exe_name, mfid) + args = ['-nologo', '-manifest', str(temp_manifest), out_arg] + self._execute_c_compiler('mt.exe', args, exe_name) return exe_name @@ -396,7 +399,7 @@ if len(headers_to_precompile)>0: if shared: - no_precompile_cfiles += [m.makefile_dir / 'main.c', + no_precompile_cfiles += [m.makefile_dir / 'main.c', m.makefile_dir / 'wmain.c'] stdafx_h = path.join('stdafx.h') txt = '#ifndef PYPY_STDAFX_H\n' _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit