diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-11-25 22:39:15 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-11-25 22:39:15 +0000 |
commit | d934827bf44b7cfcf6711964418148fa60877668 (patch) | |
tree | 0625f358789b5e015e49db139cc1dbc9be00428f /dev-python/pypy-exe | |
parent | 2e34d110f164bf74d55fced27fe0000201b3eec5 (diff) |
gentoo resync : 25.11.2020
Diffstat (limited to 'dev-python/pypy-exe')
-rw-r--r-- | dev-python/pypy-exe/Manifest | 7 | ||||
-rw-r--r-- | dev-python/pypy-exe/files/pypy-7.3.2-ppc64-segfault.patch | 64 | ||||
-rw-r--r-- | dev-python/pypy-exe/pypy-exe-7.3.2.ebuild | 4 | ||||
-rw-r--r-- | dev-python/pypy-exe/pypy-exe-7.3.3.ebuild | 167 | ||||
-rw-r--r-- | dev-python/pypy-exe/pypy-exe-7.3.3_rc1.ebuild | 167 |
5 files changed, 408 insertions, 1 deletions
diff --git a/dev-python/pypy-exe/Manifest b/dev-python/pypy-exe/Manifest index 069b899afc43..f1b368df293c 100644 --- a/dev-python/pypy-exe/Manifest +++ b/dev-python/pypy-exe/Manifest @@ -1,5 +1,10 @@ +AUX pypy-7.3.2-ppc64-segfault.patch 3077 BLAKE2B 88085062fb0db4641f995a560386fb3adca7ef9d54225ad42a9a52c0bb976a816366c1f94e1a17616b49213635ebb9305e090e7e1dcb9f8c05cf5dcb9a08e6f1 SHA512 c07698452b0c88959a08ecc3730980dc1899f39b43d71b62b455ed0c8fb863717f0d8555c7f96d2c465c790fecfedb0c06afc5bb8b5b6255ee04c66a7ac1c377 DIST pypy2.7-v7.3.1-src.tar.bz2 21053306 BLAKE2B 071d59b7978c98e9ed9243d9a64d93d21b524351cb9a45e0f7d48828f919c84585a1164e7c38739fdd8828ab4b1eedade96dff7d64d0d9cbfe00c74d88d532bb SHA512 1bec44fa0fc4b1186e25f69303f9e332df32184be990d86fba41c40152664a93bd65eabf4dded133371271402cea9b150b60c13bce89d1004b276f0908c0b8f1 DIST pypy2.7-v7.3.2-src.tar.bz2 21142873 BLAKE2B e6bcd2dc28ef740962d053753ccd172e3895fc83fe23a319c003248e0986f9805839daddd13a0f480f1e9ee813979742699cb0bc8c42b6b05c193fedf67aea4f SHA512 b40d93d615a27e3a035007307a8ab2b49ff90f3047af914b268a80feb8219d372eca14c04a8b0dea91efb992653457b7c6d088c784de32c414cc48879f2d15fc +DIST pypy2.7-v7.3.3-src.tar.bz2 20881821 BLAKE2B ce1ecdd1fffe40574c7662da6038b84d2bca47ab168939ef0c12be2c6348317f17a94a3026e7fa53c71601edc153aefd98f770bd148e7af07ca751c0a5fc1252 SHA512 c2b6c44fdcac5f9445fab01572f859228fc286891fd09a4ddb95d283683d805276c853ec8e61fcd04cb9ee811d0e959d19bb03fdd7442c044f28a773633122e7 +DIST pypy2.7-v7.3.3rc1-src.tar.bz2 20933100 BLAKE2B afbf3c15924e6a215b6323fe97e9782912f09ba1e1db6652b37897ead07deaaa97f591a91f3695e958e8e2dee2626bbda94c4043c025b3f52a12279dc66e483c SHA512 0ddbdcf7ef825888ff748ebdd84cb501653e3a4a0e506e35810f9693b5d3b388c2f636396616f0c8fcc96dc806fa02d74830c1f37ca11fdcfdfd32c3bcd1fdd0 EBUILD pypy-exe-7.3.1.ebuild 3891 BLAKE2B 1121625d5422a1d52114e58fd7f1632f175fc1623b2b931c3fb528acb1f18fdfc1a0859218330fe3e7c20bc539ff2819ea21cac2cb41328a4d295e7f5e9f684a SHA512 6bff225e427ae47b014a20ae7ab3893e55a893d5ce0670dc0474b4e6626113f5cbeef893e8585d42c8be78a64a051addbbbff1eb90b2266284d6064e73feeb2f -EBUILD pypy-exe-7.3.2.ebuild 4074 BLAKE2B 2e5f26deca32905d708882f50edca4ec1af675c61a4284f6a6cd174ca7d7dd09b9b2693b67afedaf30fca54db7640c083d88a69ae6f1e75b30f5d4ed0f575a4f SHA512 bb74c3250fc5d9d9d393923925a317b2c155c209f54c97f7f353a5860c778e3a0b999f4f58cbb89cd94204440c91f4cc70ffa96f99fc61e986cbe9e49898d994 +EBUILD pypy-exe-7.3.2.ebuild 4134 BLAKE2B 41a510875ed28bda552ddd80609ffe31c2d5eea78416af1dedade3616cca89f472c96968013b4855a7a2f5367530ca35a773cbb25cdaa7b6fb60d4de2ee01ae4 SHA512 addda776a9aabdcc9dcfabd2b59ee1d6b7c1938824abed3e69e912d09325669fc61959edf74c4ba15c1704e7e7282c7de386dcedc4265ba62868dbf01a7c1b99 +EBUILD pypy-exe-7.3.3.ebuild 4074 BLAKE2B 2e5f26deca32905d708882f50edca4ec1af675c61a4284f6a6cd174ca7d7dd09b9b2693b67afedaf30fca54db7640c083d88a69ae6f1e75b30f5d4ed0f575a4f SHA512 bb74c3250fc5d9d9d393923925a317b2c155c209f54c97f7f353a5860c778e3a0b999f4f58cbb89cd94204440c91f4cc70ffa96f99fc61e986cbe9e49898d994 +EBUILD pypy-exe-7.3.3_rc1.ebuild 4025 BLAKE2B f383d2e0f5f5c2041998e5c2dd2bdc77fd29a29895cd78bcdc4ba4f831bd675dc7b1d09e04f58f86bc72467fe076cce01292faaf79a373ed4c1dcc197253b63e SHA512 6a470cd309e2bf810afe9b903779ac1f4894da9acf50dc5afcc0f5d2e4fc0d70d59df40507ef15eb9412957c38c0c4070289dba86347f01940780791fed0bd2c MISC metadata.xml 497 BLAKE2B 02040ea95327971e16090c00e5771bc684710e90000ca07b366226fedbae8973a1f4bdd9d37506446a2fe3caea4fdf83ca186d2706747adccd14ea24a19486b3 SHA512 816621f5288b822fc1c7b360ac6f1e5f7b464a60c9b6e58fc464860bb8a4f44be932fe6562625006925ddda2b5cc14feeaef587303642d894494ddea6472cd2a diff --git a/dev-python/pypy-exe/files/pypy-7.3.2-ppc64-segfault.patch b/dev-python/pypy-exe/files/pypy-7.3.2-ppc64-segfault.patch new file mode 100644 index 000000000000..c143a3765cdf --- /dev/null +++ b/dev-python/pypy-exe/files/pypy-7.3.2-ppc64-segfault.patch @@ -0,0 +1,64 @@ +From 913e0dae8ac7ce8219a5f31126fee8a794cc314c Mon Sep 17 00:00:00 2001 +From: Armin Rigo <arigo@tunes.org> +Date: Sat, 26 Sep 2020 09:26:24 +0200 +Subject: [PATCH] oops, fix for test_gc_indexed_box_plus_large_offset + +--- + rpython/jit/backend/ppc/opassembler.py | 16 +++++++++++----- + rpython/jit/backend/ppc/regalloc.py | 4 ++-- + 2 files changed, 13 insertions(+), 7 deletions(-) + +diff --git a/rpython/jit/backend/ppc/opassembler.py b/rpython/jit/backend/ppc/opassembler.py +index b79b18e530..4bbfbba93a 100644 +--- a/rpython/jit/backend/ppc/opassembler.py ++++ b/rpython/jit/backend/ppc/opassembler.py +@@ -755,13 +755,19 @@ class FieldOpAssembler(object): + def _apply_offset(self, index_loc, ofs_loc): + # If offset != 0 then we have to add it here. Note that + # mc.addi() would not be valid with operand r0. +- assert ofs_loc.is_imm() # must be an immediate... +- assert _check_imm_arg(ofs_loc.getint()) # ...that fits 16 bits + assert index_loc.is_core_reg() + assert index_loc is not r.SCRATCH2 +- # (simplified version of _apply_scale()) +- if ofs_loc.value > 0: +- self.mc.addi(r.SCRATCH2.value, index_loc.value, ofs_loc.value) ++ if ofs_loc.is_imm(): ++ # if it is an immediate, it must fit into 16 bits ++ assert _check_imm_arg(ofs_loc.getint()) ++ # (simplified version of _apply_scale()) ++ if ofs_loc.value != 0: ++ self.mc.addi(r.SCRATCH2.value, index_loc.value, ofs_loc.value) ++ index_loc = r.SCRATCH2 ++ else: ++ # larger immediates are loaded into a register in regalloc.py ++ assert ofs_loc.is_core_reg() ++ self.mc.add(r.SCRATCH2.value, index_loc.value, ofs_loc.value) + index_loc = r.SCRATCH2 + return index_loc + +diff --git a/rpython/jit/backend/ppc/regalloc.py b/rpython/jit/backend/ppc/regalloc.py +index f3ee1129e4..827953cf12 100644 +--- a/rpython/jit/backend/ppc/regalloc.py ++++ b/rpython/jit/backend/ppc/regalloc.py +@@ -771,7 +771,7 @@ class Regalloc(BaseRegalloc, VectorRegalloc): + value_loc = self.ensure_reg(op.getarg(2)) + assert op.getarg(3).getint() == 1 # scale + ofs_loc = self.ensure_reg_or_16bit_imm(op.getarg(4)) +- assert ofs_loc.is_imm() # the arg(4) should always be a small constant ++ # the arg(4) is often a small constant, but it may be too large + size_loc = self.ensure_reg_or_any_imm(op.getarg(5)) + return [base_loc, index_loc, value_loc, ofs_loc, size_loc] + +@@ -780,7 +780,7 @@ class Regalloc(BaseRegalloc, VectorRegalloc): + index_loc = self.ensure_reg(op.getarg(1)) + assert op.getarg(2).getint() == 1 # scale + ofs_loc = self.ensure_reg_or_16bit_imm(op.getarg(3)) +- assert ofs_loc.is_imm() # the arg(3) should always be a small constant ++ # the arg(3) is often a small constant, but it may be too large + self.free_op_vars() + res_loc = self.force_allocate_reg(op) + size_box = op.getarg(4) +-- +GitLab + diff --git a/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild index c0dee5cf1c60..5f8b73f349d8 100644 --- a/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild +++ b/dev-python/pypy-exe/pypy-exe-7.3.2.ebuild @@ -59,6 +59,10 @@ check_env() { check-reqs_pkg_pretend } +PATCHES=( + "${FILESDIR}"/pypy-7.3.2-ppc64-segfault.patch +) + pkg_pretend() { [[ ${MERGE_TYPE} != binary ]] && check_env } diff --git a/dev-python/pypy-exe/pypy-exe-7.3.3.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.3.ebuild new file mode 100644 index 000000000000..c0dee5cf1c60 --- /dev/null +++ b/dev-python/pypy-exe/pypy-exe-7.3.3.ebuild @@ -0,0 +1,167 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) +inherit check-reqs pax-utils python-any-r1 toolchain-funcs + +MY_P=pypy2.7-v${PV/_/} +DESCRIPTION="PyPy executable (build from source)" +HOMEPAGE="https://pypy.org/" +SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2" +S="${WORKDIR}/${MY_P}-src" + +LICENSE="MIT" +SLOT="${PV}" +KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux" +IUSE="bzip2 +jit low-memory ncurses cpu_flags_x86_sse2" + +RDEPEND=">=sys-libs/zlib-1.1.3:0= + dev-libs/libffi:0= + virtual/libintl:0= + dev-libs/expat:0= + bzip2? ( app-arch/bzip2:0= ) + ncurses? ( sys-libs/ncurses:0= ) + !dev-python/pypy-exe-bin:${PV}" +# don't enforce the dep on pypy with USE=low-memory since it's going +# to cause either collisions or circular dep on itself +DEPEND="${RDEPEND}" +BDEPEND=" + !low-memory? ( + || ( + dev-python/pypy + dev-lang/python:2.7 + ) + )" + +check_env() { + if use low-memory; then + if ! has_version -b dev-python/pypy && + ! has_version -b dev-python/pypy-bin + then + eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy" + eerror "being installed. Please install it using e.g.:" + eerror + eerror " $ emerge -1v dev-python/pypy dev-python/pypy-exe-bin" + eerror + eerror "before attempting to build dev-python/pypy-exe[low-memory]." + die "dev-python/pypy needs to be installed for USE=low-memory" + fi + + CHECKREQS_MEMORY="1750M" + use amd64 && CHECKREQS_MEMORY="3500M" + else + CHECKREQS_MEMORY="3G" + use amd64 && CHECKREQS_MEMORY="6G" + fi + + check-reqs_pkg_pretend +} + +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && check_env +} + +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]]; then + check_env + + use low-memory && EPYTHON= + if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] && + { has_version -b dev-python/pypy || + has_version -b dev-python/pypy-bin; } + then + einfo "Using already-installed PyPy to perform the translation." + EPYTHON=pypy + else + einfo "Using ${EPYTHON} to perform the translation. Please note that upstream" + einfo "recommends using PyPy for that. If you wish to do so, please unset" + einfo "the EPYTHON variable." + python-any-r1_pkg_setup + fi + fi +} + +src_configure() { + tc-export CC + + local jit_backend + if use jit; then + jit_backend='--jit-backend=' + + # We only need the explicit sse2 switch for x86. + # On other arches we can rely on autodetection which uses + # compiler macros. Plus, --jit-backend= doesn't accept all + # the modern values... + + if use x86; then + if use cpu_flags_x86_sse2; then + jit_backend+=x86 + else + jit_backend+=x86-without-sse2 + fi + else + jit_backend+=auto + fi + fi + + local args=( + --no-shared + $(usex jit -Ojit -O2) + + ${jit_backend} + + pypy/goal/targetpypystandalone + ) + + # Avoid linking against libraries disabled by use flags + local opts=( + bzip2:bz2 + ncurses:_minimal_curses + ) + + local opt + for opt in "${opts[@]}"; do + local flag=${opt%:*} + local mod=${opt#*:} + + args+=( + $(usex ${flag} --withmod --withoutmod)-${mod} + ) + done + + local interp=( "${EPYTHON}" ) + if use low-memory; then + interp=( env PYPY_GC_MAX_DELTA=200MB + "${EPYTHON}" --jit loop_longevity=300 ) + fi + + if [[ ${EPYTHON} != pypy ]]; then + # reuse bundled pycparser to avoid external dep + mkdir -p "${T}"/pymod/cffi || die + : > "${T}"/pymod/cffi/__init__.py || die + cp -r lib_pypy/cffi/_pycparser "${T}"/pymod/cffi/ || die + local -x PYTHONPATH=${T}/pymod:${PYTHONPATH} + fi + + # translate into the C sources + # we're going to build them ourselves since otherwise pypy does not + # free up the unneeded memory before spawning the compiler + set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}" + echo -e "\033[1m${@}\033[0m" + "${@}" || die "translation failed" +} + +src_compile() { + emake -C "${T}"/usession*-0/testing_1 +} + +src_install() { + local dest=/usr/lib/pypy2.7 + exeinto "${dest}" + newexe "${T}"/usession*-0/testing_1/pypy-c pypy-c-${PV} + insinto "${dest}"/include/${PV} + doins include/pypy_* + pax-mark m "${ED}${dest}/pypy-c-${PV}" +} diff --git a/dev-python/pypy-exe/pypy-exe-7.3.3_rc1.ebuild b/dev-python/pypy-exe/pypy-exe-7.3.3_rc1.ebuild new file mode 100644 index 000000000000..b3cba7450ed2 --- /dev/null +++ b/dev-python/pypy-exe/pypy-exe-7.3.3_rc1.ebuild @@ -0,0 +1,167 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) +inherit check-reqs pax-utils python-any-r1 toolchain-funcs + +MY_P=pypy2.7-v${PV/_/} +DESCRIPTION="PyPy executable (build from source)" +HOMEPAGE="https://pypy.org/" +SRC_URI="https://buildbot.pypy.org/pypy/${MY_P}-src.tar.bz2" +S="${WORKDIR}/${MY_P}-src" + +LICENSE="MIT" +SLOT="${PV}" +KEYWORDS="" +IUSE="bzip2 +jit low-memory ncurses cpu_flags_x86_sse2" + +RDEPEND=">=sys-libs/zlib-1.1.3:0= + dev-libs/libffi:0= + virtual/libintl:0= + dev-libs/expat:0= + bzip2? ( app-arch/bzip2:0= ) + ncurses? ( sys-libs/ncurses:0= ) + !dev-python/pypy-exe-bin:${PV}" +# don't enforce the dep on pypy with USE=low-memory since it's going +# to cause either collisions or circular dep on itself +DEPEND="${RDEPEND}" +BDEPEND=" + !low-memory? ( + || ( + dev-python/pypy + dev-lang/python:2.7 + ) + )" + +check_env() { + if use low-memory; then + if ! has_version -b dev-python/pypy && + ! has_version -b dev-python/pypy-bin + then + eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy" + eerror "being installed. Please install it using e.g.:" + eerror + eerror " $ emerge -1v dev-python/pypy dev-python/pypy-exe-bin" + eerror + eerror "before attempting to build dev-python/pypy-exe[low-memory]." + die "dev-python/pypy needs to be installed for USE=low-memory" + fi + + CHECKREQS_MEMORY="1750M" + use amd64 && CHECKREQS_MEMORY="3500M" + else + CHECKREQS_MEMORY="3G" + use amd64 && CHECKREQS_MEMORY="6G" + fi + + check-reqs_pkg_pretend +} + +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && check_env +} + +pkg_setup() { + if [[ ${MERGE_TYPE} != binary ]]; then + check_env + + use low-memory && EPYTHON= + if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] && + { has_version -b dev-python/pypy || + has_version -b dev-python/pypy-bin; } + then + einfo "Using already-installed PyPy to perform the translation." + EPYTHON=pypy + else + einfo "Using ${EPYTHON} to perform the translation. Please note that upstream" + einfo "recommends using PyPy for that. If you wish to do so, please unset" + einfo "the EPYTHON variable." + python-any-r1_pkg_setup + fi + fi +} + +src_configure() { + tc-export CC + + local jit_backend + if use jit; then + jit_backend='--jit-backend=' + + # We only need the explicit sse2 switch for x86. + # On other arches we can rely on autodetection which uses + # compiler macros. Plus, --jit-backend= doesn't accept all + # the modern values... + + if use x86; then + if use cpu_flags_x86_sse2; then + jit_backend+=x86 + else + jit_backend+=x86-without-sse2 + fi + else + jit_backend+=auto + fi + fi + + local args=( + --no-shared + $(usex jit -Ojit -O2) + + ${jit_backend} + + pypy/goal/targetpypystandalone + ) + + # Avoid linking against libraries disabled by use flags + local opts=( + bzip2:bz2 + ncurses:_minimal_curses + ) + + local opt + for opt in "${opts[@]}"; do + local flag=${opt%:*} + local mod=${opt#*:} + + args+=( + $(usex ${flag} --withmod --withoutmod)-${mod} + ) + done + + local interp=( "${EPYTHON}" ) + if use low-memory; then + interp=( env PYPY_GC_MAX_DELTA=200MB + "${EPYTHON}" --jit loop_longevity=300 ) + fi + + if [[ ${EPYTHON} != pypy ]]; then + # reuse bundled pycparser to avoid external dep + mkdir -p "${T}"/pymod/cffi || die + : > "${T}"/pymod/cffi/__init__.py || die + cp -r lib_pypy/cffi/_pycparser "${T}"/pymod/cffi/ || die + local -x PYTHONPATH=${T}/pymod:${PYTHONPATH} + fi + + # translate into the C sources + # we're going to build them ourselves since otherwise pypy does not + # free up the unneeded memory before spawning the compiler + set -- "${interp[@]}" rpython/bin/rpython --batch --source "${args[@]}" + echo -e "\033[1m${@}\033[0m" + "${@}" || die "translation failed" +} + +src_compile() { + emake -C "${T}"/usession*-0/testing_1 +} + +src_install() { + local dest=/usr/lib/pypy2.7 + exeinto "${dest}" + newexe "${T}"/usession*-0/testing_1/pypy-c pypy-c-${PV} + insinto "${dest}"/include/${PV} + doins include/pypy_* + pax-mark m "${ED}${dest}/pypy-c-${PV}" +} |