Commit b494a5af authored by Matti Picus's avatar Matti Picus
Browse files

merge py3.7 into release

--HG--
branch : release-pypy3.7-v7.x
Pipeline #27657 passed with stage
in 28 minutes and 20 seconds
......@@ -118,3 +118,6 @@ cd00c77c619f02c43c23e6a2514e5b685230ef02 release-pypy3.7-v7.3.5rc2
dd033553d6918be9f2a72bb3ea03b3024bef2be2 release-pypy2.7-v7.3.6rc1
a5e5c18d11e9b7163722f1d31a723a4cb4a50f14 release-pypy3.7-v7.3.6rc1
7e233b73b92740ab7a20680a404ac100be1eb508 release-pypy3.8-v7.3.6rc1
b89256933b0b12169977295224730039a58a1815 release-pypy2.7-v7.3.6rc2
e4511a21ddfc921621a5a008f106eafb102206f2 release-pypy3.7-v7.3.6rc2
28b8e9d917f109e3324feb0bac6b541a6482a57d release-pypy3.8-v7.3.6rc2
......@@ -2,6 +2,7 @@
import pytest
import datetime
import sys
class date_safe(datetime.date):
......@@ -162,10 +163,12 @@ def test_check_arg_types():
import decimal
class Number:
def __init__(self, value):
self.value = value
self.value = int(value)
def __int__(self):
return self.value
class SubInt(int): pass
class SubInt(int):
pass
dt10 = datetime.datetime(10, 10, 10, 10, 10, 10, 10)
for xx in [
......@@ -185,9 +188,7 @@ def test_check_arg_types():
assert str(exc.value).startswith('an integer is required')
f10 = Number(10.9)
with pytest.raises(TypeError) as exc:
datetime.datetime(10, 10, f10)
assert str(exc.value) == '__int__ returned non-int (type float)'
datetime.datetime(10, 10, f10)
class Float(float):
pass
......@@ -349,6 +350,7 @@ def test_subclass_datetime():
assert type(d2) is MyDatetime
assert d2 == datetime.datetime(2016, 4, 5, 7, 2, 3)
@pytest.mark.skipif('__pypy__' not in sys.builtin_module_names, reason='pypy only')
def test_normalize_pair():
normalize = datetime._normalize_pair
......@@ -356,6 +358,7 @@ def test_normalize_pair():
assert normalize(1, 60, 60) == (2, 0)
assert normalize(1, 95, 60) == (2, 35)
@pytest.mark.skipif('__pypy__' not in sys.builtin_module_names, reason='pypy only')
def test_normalize_date():
normalize = datetime._normalize_date
......@@ -372,6 +375,7 @@ def test_normalize_date():
assert normalize(2001, 1, 61) == (2001, 3, 2)
assert normalize(2000, 1, 61) == (2000, 3, 1)
@pytest.mark.skipif('__pypy__' not in sys.builtin_module_names, reason='pypy only')
def test_normalize_datetime():
normalize = datetime._normalize_datetime
abnormal = (2002, 13, 35, 30, 95, 75, 1000001)
......
......@@ -383,7 +383,7 @@ def _get_sysconfigdata_name():
))
def _generate_posix_vars():
def _generate_posix_vars(args):
"""Generate the Python module containing build-time variables."""
import pprint
vars = {}
......@@ -416,6 +416,10 @@ def _generate_posix_vars():
if _PYTHON_BUILD:
vars['BLDSHARED'] = vars['LDSHARED']
if args:
# PyPy extension: they should be key, value pairs
for k, v in zip(args[::2], args[1::2]):
vars[k] = v
# There's a chicken-and-egg situation on OS X with regards to the
# _sysconfigdata module after the changes introduced by #15298:
# get_config_vars() is called by get_platform() as part of the
......@@ -741,7 +745,7 @@ def _print_dict(title, data):
def _main():
"""Display all information sysconfig detains."""
if '--generate-posix-vars' in sys.argv:
_generate_posix_vars()
_generate_posix_vars(sys.argv[2:])
return
print('Platform: "%s"' % get_platform())
print('Python version: "%s"' % get_python_version())
......
......@@ -485,6 +485,9 @@ class MakefileTests(unittest.TestCase):
'var6': '42/lib/python3.5/config-b42dollar$5-x86_64-linux-gnu',
})
def test_multiarch_config_var(self):
multiarch = get_config_var('MULTIARCH')
self.assertIsInstance(multiarch, str)
if __name__ == "__main__":
unittest.main()
......@@ -55,7 +55,7 @@ class BaseTest(unittest.TestCase):
self.include = 'Include'
else:
self.bindir = 'bin'
self.lib = ('lib', 'python%d.%d' % sys.version_info[:2])
self.lib = ('lib', 'pypy%d.%d' % sys.version_info[:2])
self.include = 'include'
executable = getattr(sys, '_base_executable', sys.executable)
self.exe = os.path.split(executable)[-1]
......@@ -160,8 +160,8 @@ class BasicTest(BaseTest):
('bin',),
('include',),
('lib',),
('lib', 'python%d.%d' % sys.version_info[:2]),
('lib', 'python%d.%d' % sys.version_info[:2], 'site-packages'),
('lib', 'pypy%d.%d' % sys.version_info[:2]),
('lib', 'pypy%d.%d' % sys.version_info[:2], 'site-packages'),
)
def create_contents(self, paths, filename):
......
......@@ -259,17 +259,36 @@ class EnvBuilder:
copier(context.env_exe, path, relative_symlinks_ok=True)
if not os.path.islink(path):
os.chmod(path, 0o755)
# PyPy: also copy lib/*.so*, lib/tk, lib/tkl for portable builds
# if symlinks are not available
libsrc = os.path.join(context.python_dir, '..', 'lib')
if os.path.exists(libsrc) and not self.symlinks:
libdst = os.path.join(context.env_dir, 'lib')
if not os.path.exists(libdst):
os.mkdir(libdst)
for f in os.listdir(libsrc):
src = os.path.join(libsrc, f)
dst = os.path.join(libdst, f)
copier(src, dst)
if not self.symlinks:
#
# PyPy extension: also copy the main library, not just the
# small executable
for libname in ['libpypy3-c.so', 'libpypy3-c.dylib']:
dest_library = os.path.join(binpath, libname)
src_library = os.path.join(os.path.dirname(context.executable),
libname)
if (not os.path.exists(dest_library) and
os.path.exists(src_library)):
copier(src_library, dest_library)
if not os.path.islink(dest_library):
os.chmod(dest_library, 0o755)
libsrc = os.path.join(context.python_dir, '..', 'lib')
if os.path.exists(libsrc):
# PyPy: also copy lib/*.so*, lib/tk, lib/tcl for portable
# builds
libdst = os.path.join(context.env_dir, 'lib')
pypylib = 'pypy%d.%d' % sys.version_info[:2]
if not os.path.exists(libdst):
os.mkdir(libdst)
for f in os.listdir(libsrc):
src = os.path.join(libsrc, f)
dst = os.path.join(libdst, f)
if f == pypylib or os.path.exists(dst):
# just in case this is used with the cpython layout
# be sure not to copy the stdlib
# also skip directories when upgrading
continue
copier(src, dst)
#
else:
if self.symlinks:
......
......@@ -20,6 +20,7 @@ build_time_vars = {
# for CPython
"SOABI": '-'.join(so_ext.split('.')[1].split('-')[:2]),
"SO": so_ext, # deprecated in Python 3, for backward compatibility
'MULTIARCH': sys.implementation._multiarch,
'CC': "cc -pthread",
'CXX': "c++ -pthread",
'OPT': "-DNDEBUG -O2",
......
......@@ -162,6 +162,26 @@ way to enable it for building pypy is to set an environment variable::
After setting this, translation (described next) will find the OpenSSL libs
as expected.
Set environment variables that will affect translation
------------------------------------------------------
The following environment variables can be used to tweak the result:
+------------------------+-----------------------------------------------------------+
| value | result |
+------------------------+-----------------------------------------------------------+
| CC | compiler to use |
| PYPY_MULTIARCH | pypy 3.7+: ends up in ``sys.platform._multiarch`` |
| .. | on posix |
| PYPY_USESSION_DIR | base directory for temporary files, usually ``$TMP`` |
| PYPY_USESSION_BASENAME | each call to ``from rpython.tools import udir`` will get |
| .. | a temporary directory |
| .. | ``$PYPY_USESSION_DIR/usession-$PYPY_USESSION_BASENAME-N`` |
| .. | where ``N`` increments on each call |
| PYPY_USESSION_KEEP | how many old temporary directories to keep, any older |
| .. | ones will be deleted. Defaults to 3 |
+---------------------+--------------------------------------------------------------+
Run the translation
-------------------
......
......@@ -267,23 +267,16 @@ of very high quality requirements for compilers and partly because there is
simply no other way to get around such complex project, that will keep you sane.
There are probably people out there who are smart enough not to need it, we're
not one of those. You may consider familiarizing yourself with `pytest`_,
since this is a tool we use for tests.
This leads to the next issue:
since this is a tool we use for tests. We ship our own tweaked version of
pytest in the top of the tree, so ``python -m pytest`` will pick up our version,
which means our tests need to run with that version of pytest.
.. _pytest: https://pytest.org/
py.test and the py lib
----------------------
The `py.test testing tool`_ drives all our testing needs.
We also have post-translation tests in the ``extra_tests`` directory that are
run in a virtual environment from a separate directory, so they use a more
up-to-date version of pytest. As much as possible, these are meant to be
pass with CPython as well.
We use the `py library`_ for filesystem path manipulations, terminal
writing, logging and some other support functionality.
You don't necessarily need to install these two libraries because
we also ship them inlined in the PyPy source tree.
.. _py library: https://pylib.readthedocs.org/
.. _pytest: https://pytest.org/
Running PyPy's unit tests
-------------------------
......
......@@ -82,6 +82,7 @@ CPython 3.3 compatible versions
.. toctree::
release-pypy3.3-5.5.0.rst
release-pypy3.3-v5.5.0.rst
release-pypy3.3-v5.2-alpha1.rst
......
......@@ -49,6 +49,7 @@ CPython 3.7 compatible versions
.. toctree::
whatsnew-pypy3-head.rst
whatsnew-pypy3-7.3.6.rst
whatsnew-pypy3-7.3.4.rst
CPython 3.6 compatible versions
......
......@@ -139,6 +139,10 @@ Bugfixes shared across versions
the last tag (i.e. final)
- Fix position bugs in the astcompiler stemming from the fact that
``SyntaxErrors`` use 1-based column offsets
- Fix an obscure corner of ``%``-formatting when a tuple is passed in that
triggered infinite recursion in the ``__repr__`` of a ``named_tuple`` with an
``__iter__`` (issue 3555_)
- Fixed a PowerPC JIT bug that caused a stack overflow (issue 3463_)
Speedups and enhancements shared across versions
------------------------------------------------
......@@ -232,6 +236,7 @@ Python 3.7 C-API
.. _3353: https://foss.heptapod.net/pypy/pypy/-/issues/3353
.. _3431: https://foss.heptapod.net/pypy/pypy/-/issues/3431
.. _3402: https://foss.heptapod.net/pypy/pypy/-/issues/3402
.. _3463: https://foss.heptapod.net/pypy/pypy/-/issues/3463
.. _3472: https://foss.heptapod.net/pypy/pypy/-/issues/3472
.. _3483: https://foss.heptapod.net/pypy/pypy/-/issues/3483
.. _3490: https://foss.heptapod.net/pypy/pypy/-/issues/3490
......@@ -242,6 +247,7 @@ Python 3.7 C-API
.. _3531: https://foss.heptapod.net/pypy/pypy/-/issues/3531
.. _3538: https://foss.heptapod.net/pypy/pypy/-/issues/3538
.. _3546: https://foss.heptapod.net/pypy/pypy/-/issues/3546
.. _3555: https://foss.heptapod.net/pypy/pypy/-/issues/3555
.. _`bpo 22557`: https://bugs.python.org/issue22557
.. _`bpo 44022`: https://bugs.python.org/issue44022
.. _`bpo 43650`: https://bugs.python.org/issue43650
......
......@@ -18,10 +18,12 @@ suggestions which name could have been meant instead in case of typos). This
follows the upcoming CPython 3.10 features.
.. branch: distutils-implementation
Instantiate the ``distutils.command.install`` schema for the python
implementation (issue 3436)
.. branch: py3.7-bpo-30245
Avoid overflow in ``struct.pack_into`` error message (BPO 30245)
......
......@@ -33,6 +33,9 @@ def assert_in(a, b):
pypy_versions = {
'7.3.6rc2': {'python_version': ['3.8.12', '3.7.12', '2.7.18'],
'date': '2021-10-06',
},
'7.3.6rc1': {'python_version': ['3.8.12', '3.7.12', '2.7.18'],
'date': '2021-09-13',
},
......
This diff is collapsed.
......@@ -81,10 +81,21 @@ def generate_sysconfigdata(pypy_c, lib_pypy):
"""
if ARCH == 'win32':
return
# this creates a _sysconfigdata_*.py file in some directory, the name
# run ./config.guess to add the HOST_GNU_TYPE (copied from CPython,
# apparently useful for the crossenv package)
config_guess = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'config.guess')
try:
host_gnu_type = subprocess.check_output([config_guess]).strip()
except Exception:
host_gnu_type = "unkown"
# this creates a _sysconfigdata_*.py file in some directory, the name
# of the directory is written into pybuilddir.txt
subprocess.check_call([str(pypy_c), '-m' 'sysconfig',
'--generate-posix-vars'])
'--generate-posix-vars',
# Use PyPy-specific extension to get HOST_GNU_TYPE
'HOST_GNU_TYPE', host_gnu_type])
with open('pybuilddir.txt') as fid:
dirname = fid.read().strip()
assert os.path.exists(dirname)
......@@ -93,6 +104,9 @@ def generate_sysconfigdata(pypy_c, lib_pypy):
assert len(sysconfigdata_names) == 1
shutil.copy(os.path.join(dirname, sysconfigdata_names[0]), lib_pypy)
shutil.rmtree(dirname)
def create_package(basedir, options, _fake=False):
......
#! /bin/bash
# Edit these appropriately before running this script
pmaj=2 # python main version: 2 or 3
pmin=7 # python minor version
pmaj=3 # python main version: 2 or 3
pmin=8 # python minor version
maj=7
min=3
rev=6
rc=rc1 # comment this line for actual release
rc=rc2 # comment this line for actual release
function maybe_exit {
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
......
[
{
"pypy_version": "7.3.6rc2",
"python_version": "3.8.12",
"stable": false,
"latest_pypy": false,
"date": "2021-10-06",
"files": [
{
"filename": "pypy3.8-v7.3.6rc2-aarch64.tar.bz2",
"arch": "aarch64",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy3.8-v7.3.6rc2-aarch64.tar.bz2"
},
{
"filename": "pypy3.8-v7.3.6rc2-linux32.tar.bz2",
"arch": "i686",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy3.8-v7.3.6rc2-linux32.tar.bz2"
},
{
"filename": "pypy3.8-v7.3.6rc2-linux64.tar.bz2",
"arch": "x64",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy3.8-v7.3.6rc2-linux64.tar.bz2"
},
{
"filename": "pypy3.8-v7.3.6rc2-osx64.tar.bz2",
"arch": "x64",
"platform": "darwin",
"download_url": "https://downloads.python.org/pypy/pypy3.8-v7.3.6rc2-osx64.tar.bz2"
},
{
"filename": "pypy3.8-v7.3.6rc2-win64.zip",
"arch": "x64",
"platform": "win64",
"download_url": "https://downloads.python.org/pypy/pypy3.8-v7.3.6rc2-win64.zip"
},
{
"filename": "pypy3.8-v7.3.6rc2-s390x.tar.bz2",
"arch": "s390x",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy3.8-v7.3.6rc2-s390x.tar.bz2"
}
]
},
{
"pypy_version": "7.3.6rc2",
"python_version": "3.7.12",
"stable": false,
"latest_pypy": false,
"date": "2021-10-06",
"files": [
{
"filename": "pypy3.7-v7.3.6rc2-aarch64.tar.bz2",
"arch": "aarch64",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy3.7-v7.3.6rc2-aarch64.tar.bz2"
},
{
"filename": "pypy3.7-v7.3.6rc2-linux32.tar.bz2",
"arch": "i686",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy3.7-v7.3.6rc2-linux32.tar.bz2"
},
{
"filename": "pypy3.7-v7.3.6rc2-linux64.tar.bz2",
"arch": "x64",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy3.7-v7.3.6rc2-linux64.tar.bz2"
},
{
"filename": "pypy3.7-v7.3.6rc2-osx64.tar.bz2",
"arch": "x64",
"platform": "darwin",
"download_url": "https://downloads.python.org/pypy/pypy3.7-v7.3.6rc2-osx64.tar.bz2"
},
{
"filename": "pypy3.7-v7.3.6rc2-win64.zip",
"arch": "x64",
"platform": "win64",
"download_url": "https://downloads.python.org/pypy/pypy3.7-v7.3.6rc2-win64.zip"
},
{
"filename": "pypy3.7-v7.3.6rc2-s390x.tar.bz2",
"arch": "s390x",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy3.7-v7.3.6rc2-s390x.tar.bz2"
}
]
},
{
"pypy_version": "7.3.6rc2",
"python_version": "2.7.18",
"stable": false,
"latest_pypy": false,
"date": "2021-10-06",
"files": [
{
"filename": "pypy2.7-v7.3.6rc2-aarch64.tar.bz2",
"arch": "aarch64",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy2.7-v7.3.6rc2-aarch64.tar.bz2"
},
{
"filename": "pypy2.7-v7.3.6rc2-linux32.tar.bz2",
"arch": "i686",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy2.7-v7.3.6rc2-linux32.tar.bz2"
},
{
"filename": "pypy2.7-v7.3.6rc2-linux64.tar.bz2",
"arch": "x64",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy2.7-v7.3.6rc2-linux64.tar.bz2"
},
{
"filename": "pypy2.7-v7.3.6rc2-osx64.tar.bz2",
"arch": "x64",
"platform": "darwin",
"download_url": "https://downloads.python.org/pypy/pypy2.7-v7.3.6rc2-osx64.tar.bz2"
},
{
"filename": "pypy2.7-v7.3.6rc2-win64.zip",
"arch": "x64",
"platform": "win64",
"download_url": "https://downloads.python.org/pypy/pypy2.7-v7.3.6rc2-win64.zip"
},
{
"filename": "pypy2.7-v7.3.6rc2-s390x.tar.bz2",
"arch": "s390x",
"platform": "linux",
"download_url": "https://downloads.python.org/pypy/pypy2.7-v7.3.6rc2-s390x.tar.bz2"
}
]
},
{
"pypy_version": "7.3.6rc1",
"python_version": "3.8.12",
......
......@@ -94,9 +94,25 @@ class BasePosix(Platform):
return result
def get_multiarch(self):
from rpython.jit.backend import detect_cpu
model = detect_cpu.autodetect()
return model.replace('-', '_') + '-linux-gnu'
if 'PYPY_MULTIARCH' in os.environ:
return os.environ['PYPY_MULTIARCH']
if sys.platform == 'cygwin':
return ''
try:
ret = self.execute(self.cc, args=['--print-multiarch'])
except CompilationError:
ret = ''
else:
ret = ret.out.strip()
if not ret:
# some gcc, like on redhat, return ''
# the following may fail on non-JIT builds
from rpython.jit.backend import detect_cpu
model = detect_cpu.autodetect()
ret = model.replace('-', '_') + '-linux-gnu'
if not ret:
raise ValueError("cannot detect multiarch value on this platform")
return ret
def get_rpath_flags(self, rel_libdirs):
# needed for cross-compilation i.e. ARM
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment