mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 11:33:49 -05:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c680e8ede | ||
|
|
20296fc53a | ||
|
|
7725fe2cf2 | ||
|
|
d8384fcc05 | ||
|
|
e150257413 | ||
|
|
798d21e0ca | ||
|
|
9114929e4f | ||
|
|
f1c5371752 | ||
|
|
907cd78f35 | ||
|
|
e13b5848be | ||
|
|
bf19366669 |
54
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
54
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
### Prerequisites
|
||||
* [ ] Make sure your problem is not listed in [the common build problems](https://github.com/pyenv/pyenv/wiki/Common-build-problems).
|
||||
* [ ] Make sure no duplicated issue has already been reported in [the pyenv issues](https://github.com/pyenv/pyenv/issues?q=is%3Aissue). For build errors, a reported issue typically mentions a key error message. This key error message is often not in the 10 last build log lines reported to the console but is rather earlier in the build log -- typically, it's the first error message encountered in the log.
|
||||
* [ ] Make sure you are reporting a problem in Pyenv and not seeking consultation with Pyenv usage.
|
||||
* GitHub issues are intended mainly for Pyenv development purposes. If you are seeking help with Pyenv usage, check [Pyenv documentation](https://github.com/pyenv/pyenv?tab=readme-ov-file#simple-python-version-management-pyenv), go to a user community site like [Gitter](https://gitter.im/yyuu/pyenv), [StackOverflow](https://stackoverflow.com/questions/tagged/pyenv), etc, or to [Discussions](https://github.com/orgs/pyenv/discussions).
|
||||
* [ ] Make sure your problem is not derived from packaging (e.g. [Homebrew](https://brew.sh)).
|
||||
* Please refer to the package documentation for the installation issues, etc.
|
||||
* [ ] Make sure your problem is not derived from plugins.
|
||||
* This repository is maintaining `pyenv` and the default `python-build` plugin only. Please refrain from reporting issues of other plugins here.
|
||||
|
||||
### Describe the bug
|
||||
A clear and concise description of what the bug is.
|
||||
Do specify what the expected behaviour is if that's not obvious from the bug's nature.
|
||||
|
||||
#### Reproduction steps
|
||||
Listing the commands to run in a new console session and their output is usually sufficient.
|
||||
Please use a Markdown code block (three backticks on a line by themselves before and after the text) to denote a console output excerpt.
|
||||
Usually not needed for build errors (since the arguments can already be seen in the debug trace) unless you are using an unusual invocation (e.g. setting environment variables that affect the build).
|
||||
|
||||
#### Diagnostic details
|
||||
- [ ] Platform information (e.g. Ubuntu Linux 24.04):
|
||||
- [ ] OS architecture (e.g. amd64):
|
||||
- [ ] pyenv version:
|
||||
- [ ] Python version:
|
||||
- [ ] C Compiler information (e.g. gcc 7.3):
|
||||
- [ ] Please attach the debug trace of the failing command as a [gist](https://gist.github.com/):
|
||||
* Run `env PYENV_DEBUG=1 <faulty command> 2>&1 | tee trace.log` and attach `trace.log`. E.g. if you have a problem with installing Python, run `env PYENV_DEBUG=1 pyenv install -v <version> 2>&1 | tee trace.log` (note the `-v` option to `pyenv install`).
|
||||
- [ ] If you have a problem with installing Python, please also attach `config.log` from the build directory
|
||||
* The build directory is reported after the "BUILD FAILED" message and is usually under `/tmp`.
|
||||
- [ ] If the build succeeds but the problem is still with the build process (e.g. the resulting Python is missing a feature), please attach
|
||||
* the debug trace from reinstalling the faulty version with `env PYENV_DEBUG=1 pyenv install -f -k -v <version> 2>&1 | tee trace.log`
|
||||
* `config.log` from the build directory. When using `pyenv install` with `-k` as per above, the build directory will be under `$PYENV_ROOT/sources`.
|
||||
- [ ] If the problem happens in another Pyenv invocation, turn on debug logging by setting `PYENV_DEBUG=1`, e.g. `env PYENV_DEBUG=1 pyenv local 3.6.4`, and attach the resulting trace as a gist
|
||||
- [ ] If the problem happens outside of a Pyenv invocation, get the debug trace like this:
|
||||
```
|
||||
export PYENV_DEBUG=1
|
||||
# for Bash
|
||||
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
|
||||
# for Zsh
|
||||
export PS4='+(%x:%I): %N(%i): '
|
||||
|
||||
set -x
|
||||
<reproduce the problem>
|
||||
set +x
|
||||
```
|
||||
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
24
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the intended use case**
|
||||
* What your general environment is if it's relevant to the feature request and is not a generic console with a typical Pyenv installation (CI, server with a custom setup, cloud environment, IDE)
|
||||
* What you are trying to achieve
|
||||
* What specifically you are doing for that regarding Pyenv
|
||||
* Where you are stuck
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
[ ] In particular, did you consider [writing a plugin](https://github.com/pyenv/pyenv/blob/master/README.md#pyenv-plugins)? Note that if your plugin has general applicability, you can publish it in the 3rd-party plugin catalog on the Pyenv Wiki as per the link above.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
11
CHANGELOG.md
11
CHANGELOG.md
@@ -1,5 +1,16 @@
|
||||
# Version History
|
||||
|
||||
## Release v2.6.4
|
||||
* Backport bpo_36106 to 3.5.10 and 3.6.15 by @native-api in https://github.com/pyenv/pyenv/pull/3280
|
||||
* (regression) Use Zlib from XCode SDK in MacOS without Homebrew or Macports by @native-api in https://github.com/pyenv/pyenv/pull/3282
|
||||
* Add PyPy v7.3.20 by @jsirois in https://github.com/pyenv/pyenv/pull/3284
|
||||
* Add CPython 3.14.0b4 by @edgarrmondragon in https://github.com/pyenv/pyenv/pull/3285
|
||||
|
||||
## Release v2.6.3
|
||||
* README: Re-promote "Python versions with extended support" to a section by @native-api in https://github.com/pyenv/pyenv/pull/3276
|
||||
* Support linking to MacPorts ports installed from binary archives by @0916dhkim in https://github.com/pyenv/pyenv/pull/3272
|
||||
* Add CPython 3.14.0b3 by @nedbat in https://github.com/pyenv/pyenv/pull/3278
|
||||
|
||||
## Release v2.6.2
|
||||
* Add CPython 3.13.5 by @nedbat in https://github.com/pyenv/pyenv/pull/3269
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ This project was forked from [rbenv](https://github.com/rbenv/rbenv) and
|
||||
* **[Usage](#usage)**
|
||||
* [Install additional Python versions](#install-additional-python-versions)
|
||||
* [Prefix auto-resolution to the latest version](#prefix-auto-resolution-to-the-latest-version)
|
||||
* [Python versions with extended support](#python-versions-with-extended-support)
|
||||
* [Switch between Python versions](#switch-between-python-versions)
|
||||
* [Making multiple versions available](#making-multiple-versions-available)
|
||||
* [Uninstall Python versions](#uninstall-python-versions)
|
||||
@@ -367,8 +368,9 @@ You can run [`pyenv latest -k <prefix>`](COMMANDS.md#pyenv-latest) to see how `p
|
||||
|
||||
See the [`pyenv latest` documentation](COMMANDS.md#pyenv-latest) for details.
|
||||
|
||||
----
|
||||
|
||||
<details> <summary> Python versions with extended support </summary>
|
||||
#### Python versions with extended support
|
||||
|
||||
For the following Python releases, Pyenv applies user-provided patches that add support for some newer environments.
|
||||
Though we don't actively maintain those patches, since existing releases never change,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
version="2.6.2"
|
||||
version="2.6.4"
|
||||
git_revision=""
|
||||
|
||||
if cd "${BASH_SOURCE%/*}" 2>/dev/null && git remote -v 2>/dev/null | grep -q pyenv; then
|
||||
|
||||
@@ -884,6 +884,9 @@ build_package_standard_build() {
|
||||
if can_use_macports; then
|
||||
use_macports || true
|
||||
fi
|
||||
if is_mac -ge 1014 && ! can_use_homebrew && ! can_use_macports; then
|
||||
use_xcode_sdk_zlib || true
|
||||
fi
|
||||
|
||||
use_freebsd_pkg || true
|
||||
|
||||
@@ -1507,8 +1510,9 @@ use_macports() {
|
||||
local port_location="$(command -v port)"
|
||||
if [ -n "$port_location" ]; then
|
||||
local prefix="${port_location%/bin/port}"
|
||||
export CPPFLAGS="${CPPFLAGS:+$CPPFLAGS }-I${prefix}/include"
|
||||
append_ldflags_libs "-L${prefix}/lib -Wl,-rpath,${prefix}/lib"
|
||||
export CPPFLAGS="-I${prefix}/include${CPPFLAGS:+ $CPPFLAGS}"
|
||||
prepend_ldflags_libs "-L${prefix}/lib -Wl,-rpath,${prefix}/lib"
|
||||
export PKG_CONFIG_PATH="$prefix/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
|
||||
lock_in macports
|
||||
fi
|
||||
}
|
||||
@@ -1538,15 +1542,9 @@ use_homebrew_yaml() {
|
||||
|
||||
use_macports_yaml() {
|
||||
can_use_macports || return 1
|
||||
local prefix="$(port -q location libyaml 2>/dev/null || true)"
|
||||
if [ -n "$prefix" ]; then
|
||||
local libdir="$prefix/opt/local"
|
||||
if [ -d "$libdir" ]; then
|
||||
echo "python-build: use libyaml from MacPorts"
|
||||
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
|
||||
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ ${LDFLAGS% }}"
|
||||
lock_in macports
|
||||
fi
|
||||
if [[ $(port -q installed libyaml | awk '{print $3}') == "(active)" ]]; then
|
||||
echo "python-build: use libyaml from MacPorts"
|
||||
lock_in macports
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
@@ -1615,15 +1613,9 @@ use_homebrew_readline() {
|
||||
use_macports_readline() {
|
||||
can_use_macports || return 1
|
||||
if ! configured_with_package_dir "python" "readline/rlconf.h"; then
|
||||
local prefix="$(port -q location readline 2>/dev/null || true)"
|
||||
if [ -n "$prefix" ]; then
|
||||
local libdir="$prefix/opt/local"
|
||||
if [ -d "$libdir" ]; then
|
||||
echo "python-build: use readline from MacPorts"
|
||||
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
|
||||
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ $LDFLAGS}"
|
||||
lock_in macports
|
||||
fi
|
||||
if [[ $(port -q installed readline | awk '{print $3}') == "(active)" ]]; then
|
||||
echo "python-build: use readline from MacPorts"
|
||||
lock_in macports
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
@@ -1645,15 +1637,9 @@ use_homebrew_ncurses() {
|
||||
|
||||
use_macports_ncurses() {
|
||||
can_use_macports || return 1
|
||||
local prefix="$(port -q location ncurses 2>/dev/null || true)"
|
||||
if [[ -n "$prefix" ]]; then
|
||||
local libdir="$prefix/opt/local"
|
||||
if [ -d "$libdir" ]; then
|
||||
echo "python-build: use ncurses from MacPorts"
|
||||
export CPPFLAGS="-I$libdir/include${CPPFLAGS:+ $CPPFLAGS}"
|
||||
export LDFLAGS="-L$libdir/lib${LDFLAGS:+ $LDFLAGS}"
|
||||
lock_in macports
|
||||
fi
|
||||
if [[ $(port -q installed ncurses | awk '{print $3}') == "(active)" ]]; then
|
||||
echo "python-build: use ncurses from MacPorts"
|
||||
lock_in macports
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
@@ -1724,22 +1710,16 @@ use_homebrew_openssl() {
|
||||
use_macports_openssl() {
|
||||
can_use_macports || return 1
|
||||
command -v port >/dev/null || return 1
|
||||
local port_location="$(command -v port)"
|
||||
local prefix="${port_location%/bin/port}"
|
||||
for openssl in ${PYTHON_BUILD_HOMEBREW_OPENSSL_FORMULA:-openssl}; do
|
||||
local ssldir="$(port -q location "${openssl}" 2>/dev/null || true)"
|
||||
if [ -n "$ssldir" ]; then
|
||||
ssldir="${ssldir}/opt/local"
|
||||
if [ -d "$ssldir" ]; then
|
||||
echo "python-build: use ${openssl} from MacPorts"
|
||||
if [[ -n "${PYTHON_BUILD_CONFIGURE_WITH_OPENSSL:-}" ]]; then
|
||||
# configure script of newer CPython versions support `--with-openssl`
|
||||
# https://bugs.python.org/issue21541
|
||||
package_option python configure --with-openssl="${ssldir}"
|
||||
else
|
||||
export CPPFLAGS="-I$ssldir/include ${CPPFLAGS:+ $CPPFLAGS}"
|
||||
export LDFLAGS="-L$ssldir/lib${LDFLAGS:+ $LDFLAGS}"
|
||||
fi
|
||||
if [[ $(port -q installed ${openssl} | awk '{print $3}') == "(active)" ]]; then
|
||||
echo "python-build: use ${openssl} from MacPorts"
|
||||
if [[ -n "${PYTHON_BUILD_CONFIGURE_WITH_OPENSSL:-}" ]]; then
|
||||
# configure script of newer CPython versions support `--with-openssl`
|
||||
# https://bugs.python.org/issue21541
|
||||
package_option python configure --with-openssl="${prefix}"
|
||||
fi
|
||||
export PKG_CONFIG_PATH="$ssldir/lib/pkgconfig/:${PKG_CONFIG_PATH}"
|
||||
lock_in macports
|
||||
return 0
|
||||
fi
|
||||
@@ -1863,15 +1843,9 @@ use_xcode_sdk_zlib() {
|
||||
|
||||
use_macports_zlib() {
|
||||
can_use_macports || return 1
|
||||
local prefix="$(port -q location zlib 2>/dev/null || true)"
|
||||
if [[ -n "$prefix" ]]; then
|
||||
local libdir="$prefix/opt/local"
|
||||
if [[ -d "$libdir" ]]; then
|
||||
echo "python-build: use zlib from MacPorts"
|
||||
export CPPFLAGS="-I$prefix/include ${CPPFLAGS}"
|
||||
export LDFLAGS="-L$prefix/lib ${LDFLAGS}"
|
||||
lock_in macports
|
||||
fi
|
||||
if [[ $(port -q installed zlib | awk '{print $3}') == "(active)" ]]; then
|
||||
echo "python-build: use zlib from MacPorts"
|
||||
lock_in macports
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
prefer_openssl3
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-3.4.1" "https://github.com/openssl/openssl/releases/download/openssl-3.4.1/openssl-3.4.1.tar.gz#002a2d6b30b58bf4bea46c43bdd96365aaf8daa6c428782aa4feee06da197df3" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.14.0b2" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0b2.tar.xz#7ac9e84844bbc0a5a8f1f79a37a68b3b8caf2a58b4aa5999c49227cb36e70ea6" standard verify_py314 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.14.0b2" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0b2.tgz#395e0daf993ddd6010dddef9ac6851996f69c2681a88c20190fa0dfe3e633930" standard verify_py314 copy_python_gdb ensurepip
|
||||
fi
|
||||
@@ -1,2 +0,0 @@
|
||||
export PYTHON_BUILD_FREE_THREADING=1
|
||||
source "$(dirname "${BASH_SOURCE[0]}")"/3.14.0b2
|
||||
9
plugins/python-build/share/python-build/3.14.0b4
Normal file
9
plugins/python-build/share/python-build/3.14.0b4
Normal file
@@ -0,0 +1,9 @@
|
||||
prefer_openssl3
|
||||
export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1
|
||||
install_package "openssl-3.4.2" "https://github.com/openssl/openssl/releases/download/openssl-3.4.2/openssl-3.4.2.tar.gz#17b02459fc28be415470cccaae7434f3496cac1306b86b52c83886580e82834c" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "readline-8.2" "https://ftpmirror.gnu.org/readline/readline-8.2.tar.gz#3feb7171f16a84ee82ca18a36d7b9be109a52c04f492a053331d7d1095007c35" mac_readline --if has_broken_mac_readline
|
||||
if has_tar_xz_support; then
|
||||
install_package "Python-3.14.0b4" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0b4.tar.xz#15e123e056abebba6de5e73cfa304459a8c82cafa85d4fc7fc6de80e6a3e1b39" standard verify_py314 copy_python_gdb ensurepip
|
||||
else
|
||||
install_package "Python-3.14.0b4" "https://www.python.org/ftp/python/3.14.0/Python-3.14.0b4.tgz#bd46b9bf6c1552542e8d36afc7661a3101ded03665228cf3f78c929737bb8ddb" standard verify_py314 copy_python_gdb ensurepip
|
||||
fi
|
||||
2
plugins/python-build/share/python-build/3.14.0b4t
Normal file
2
plugins/python-build/share/python-build/3.14.0b4t
Normal file
@@ -0,0 +1,2 @@
|
||||
export PYTHON_BUILD_FREE_THREADING=1
|
||||
source "${BASH_SOURCE[0]%t}"
|
||||
@@ -0,0 +1,68 @@
|
||||
From f57cd8288dbe6aba99c057f37ad6d58f8db75350 Mon Sep 17 00:00:00 2001
|
||||
From: Dima Pasechnik <dimpase@gmail.com>
|
||||
Date: Tue, 26 Feb 2019 06:36:11 +0000
|
||||
Subject: [PATCH] bpo-36106: Resolve sinpi name clash with libm (IEEE-754
|
||||
violation). (GH-12027)
|
||||
|
||||
The standard math library (libm) may follow IEEE-754 recommendation to
|
||||
include an implementation of sinPi(), i.e. sinPi(x):=sin(pi*x).
|
||||
And this triggers a name clash, found by FreeBSD developer
|
||||
Steve Kargl, who worken on putting sinpi into libm used on FreeBSD
|
||||
(it has to be named "sinpi", not "sinPi", cf. e.g.
|
||||
https://en.cppreference.com/w/c/experimental/fpext4).
|
||||
---
|
||||
.../next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst | 1 +
|
||||
Modules/mathmodule.c | 8 ++++----
|
||||
2 files changed, 5 insertions(+), 4 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst b/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
|
||||
new file mode 100644
|
||||
index 00000000000..36e17508cd4
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
|
||||
@@ -0,0 +1 @@
|
||||
+Resolve potential name clash with libm's sinpi(). Patch by Dmitrii Pasechnik.
|
||||
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
|
||||
index 2272f622f0b..fd0eb327c74 100644
|
||||
--- a/Modules/mathmodule.c
|
||||
+++ b/Modules/mathmodule.c
|
||||
@@ -100,7 +100,7 @@ static const double sqrtpi = 1.772453850905516027298167483341145182798;
|
||||
}
|
||||
|
||||
static double
|
||||
-sinpi(double x)
|
||||
+m_sinpi(double x)
|
||||
{
|
||||
double y, r;
|
||||
int n;
|
||||
@@ -328,7 +328,7 @@ m_tgamma(double x)
|
||||
integer. */
|
||||
if (absx > 200.0) {
|
||||
if (x < 0.0) {
|
||||
- return 0.0/sinpi(x);
|
||||
+ return 0.0/m_sinpi(x);
|
||||
}
|
||||
else {
|
||||
errno = ERANGE;
|
||||
@@ -352,7 +352,7 @@ m_tgamma(double x)
|
||||
}
|
||||
z = z * lanczos_g / y;
|
||||
if (x < 0.0) {
|
||||
- r = -pi / sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
|
||||
+ r = -pi / m_sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
|
||||
r -= z * r;
|
||||
if (absx < 140.0) {
|
||||
r /= pow(y, absx - 0.5);
|
||||
@@ -423,7 +423,7 @@ m_lgamma(double x)
|
||||
r += (absx - 0.5) * (log(absx + lanczos_g - 0.5) - 1);
|
||||
if (x < 0.0)
|
||||
/* Use reflection formula to get value for negative x. */
|
||||
- r = logpi - log(fabs(sinpi(absx))) - log(absx) - r;
|
||||
+ r = logpi - log(fabs(m_sinpi(absx))) - log(absx) - r;
|
||||
if (Py_IS_INFINITY(r))
|
||||
errno = ERANGE;
|
||||
return r;
|
||||
--
|
||||
2.36.1.windows.1
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
From f57cd8288dbe6aba99c057f37ad6d58f8db75350 Mon Sep 17 00:00:00 2001
|
||||
From: Dima Pasechnik <dimpase@gmail.com>
|
||||
Date: Tue, 26 Feb 2019 06:36:11 +0000
|
||||
Subject: [PATCH] bpo-36106: Resolve sinpi name clash with libm (IEEE-754
|
||||
violation). (GH-12027)
|
||||
|
||||
The standard math library (libm) may follow IEEE-754 recommendation to
|
||||
include an implementation of sinPi(), i.e. sinPi(x):=sin(pi*x).
|
||||
And this triggers a name clash, found by FreeBSD developer
|
||||
Steve Kargl, who worken on putting sinpi into libm used on FreeBSD
|
||||
(it has to be named "sinpi", not "sinPi", cf. e.g.
|
||||
https://en.cppreference.com/w/c/experimental/fpext4).
|
||||
---
|
||||
.../next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst | 1 +
|
||||
Modules/mathmodule.c | 8 ++++----
|
||||
2 files changed, 5 insertions(+), 4 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
|
||||
|
||||
diff --git a/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst b/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
|
||||
new file mode 100644
|
||||
index 00000000000..36e17508cd4
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Library/2019-02-25-13-21-43.bpo-36106.VuhEiQ.rst
|
||||
@@ -0,0 +1 @@
|
||||
+Resolve potential name clash with libm's sinpi(). Patch by Dmitrii Pasechnik.
|
||||
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
|
||||
index 2272f622f0b..fd0eb327c74 100644
|
||||
--- a/Modules/mathmodule.c
|
||||
+++ b/Modules/mathmodule.c
|
||||
@@ -100,7 +100,7 @@ static const double sqrtpi = 1.772453850905516027298167483341145182798;
|
||||
}
|
||||
|
||||
static double
|
||||
-sinpi(double x)
|
||||
+m_sinpi(double x)
|
||||
{
|
||||
double y, r;
|
||||
int n;
|
||||
@@ -328,7 +328,7 @@ m_tgamma(double x)
|
||||
integer. */
|
||||
if (absx > 200.0) {
|
||||
if (x < 0.0) {
|
||||
- return 0.0/sinpi(x);
|
||||
+ return 0.0/m_sinpi(x);
|
||||
}
|
||||
else {
|
||||
errno = ERANGE;
|
||||
@@ -352,7 +352,7 @@ m_tgamma(double x)
|
||||
}
|
||||
z = z * lanczos_g / y;
|
||||
if (x < 0.0) {
|
||||
- r = -pi / sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
|
||||
+ r = -pi / m_sinpi(absx) / absx * exp(y) / lanczos_sum(absx);
|
||||
r -= z * r;
|
||||
if (absx < 140.0) {
|
||||
r /= pow(y, absx - 0.5);
|
||||
@@ -423,7 +423,7 @@ m_lgamma(double x)
|
||||
r += (absx - 0.5) * (log(absx + lanczos_g - 0.5) - 1);
|
||||
if (x < 0.0)
|
||||
/* Use reflection formula to get value for negative x. */
|
||||
- r = logpi - log(fabs(sinpi(absx))) - log(absx) - r;
|
||||
+ r = logpi - log(fabs(m_sinpi(absx))) - log(absx) - r;
|
||||
if (Py_IS_INFINITY(r))
|
||||
errno = ERANGE;
|
||||
return r;
|
||||
--
|
||||
2.36.1.windows.1
|
||||
|
||||
77
plugins/python-build/share/python-build/pypy2.7-7.3.20
Normal file
77
plugins/python-build/share/python-build/pypy2.7-7.3.20
Normal file
@@ -0,0 +1,77 @@
|
||||
VERSION='7.3.20'
|
||||
PYVER='2.7'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
aarch64_hash=f22a1be607deeaa4f9be6bc63aae09fe4fb5b990d6a23aa4e7c5960dc5d93c96
|
||||
linux32_hash=9d554c5efcb6ef80146bb82965f5d8404d6848e6f04b25c378852a095768a69c
|
||||
linux64_hash=aa3bb92dbb529fa2d4920895b16d67a810b0c709207857d56cfe4a6e3b41e02a
|
||||
osarm64_hash=be3ffbb243316b1ffbf63ac60d72e099d5b64702e4429eeeb18a0608fb3b8dcc
|
||||
osx64_hash=9e7cf34e9d4c8d890439fcd10b09a2c0825d8709c63dd4cbf85645711bfb15b7
|
||||
|
||||
### end of manual settings - following lines same for every download
|
||||
|
||||
function err_no_binary {
|
||||
local archmsg="${1}"
|
||||
local ver="pypy${PYVER}-v${VERSION}-src"
|
||||
local url="https://downloads.python.org/pypy/${ver}.tar.bz2"
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for ${archmsg}."
|
||||
echo "try '${url}' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function pypy_pkg_data {
|
||||
# pypy architecture tag
|
||||
local ARCH="${1}"
|
||||
|
||||
# defaults
|
||||
local cmd='install_package' # use bz2
|
||||
local pkg="${ARCH}" # assume matches
|
||||
local ext='tar.bz2'
|
||||
local hash='' # undefined
|
||||
|
||||
# select the hash, fix pkg if not match ARCH
|
||||
case "${ARCH}" in
|
||||
'linux-aarch64' )
|
||||
hash="${aarch64_hash}"
|
||||
pkg='aarch64'
|
||||
;;
|
||||
'linux' )
|
||||
hash="${linux32_hash}"
|
||||
pkg='linux32'
|
||||
;;
|
||||
'linux64' )
|
||||
hash="${linux64_hash}"
|
||||
;;
|
||||
'osarm64' )
|
||||
hash="${osarm64_hash}"
|
||||
pkg='macos_arm64'
|
||||
;;
|
||||
'osx64' )
|
||||
if require_osx_version "10.13"; then
|
||||
hash="${osx64_hash}"
|
||||
pkg='macos_x86_64'
|
||||
else
|
||||
err_no_binary "${ARCH}, OS X < 10.13"
|
||||
fi
|
||||
;;
|
||||
* )
|
||||
err_no_binary "${ARCH}"
|
||||
;;
|
||||
esac
|
||||
|
||||
local basever="pypy${PYVER}-v${VERSION}"
|
||||
local baseurl="https://downloads.python.org/pypy/${basever}"
|
||||
|
||||
# result - command, package dir, url+hash
|
||||
echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}"
|
||||
}
|
||||
|
||||
# determine command, package directory, url+hash
|
||||
declare -a pd="$(pypy_pkg_data "$(pypy_architecture 2>/dev/null || true)")"
|
||||
|
||||
# install
|
||||
${pd[0]} "${pd[1]}" "${pd[2]}" 'pypy' "verify_py${PYVER//./}" 'ensurepip_lt21'
|
||||
14
plugins/python-build/share/python-build/pypy2.7-7.3.20-src
Normal file
14
plugins/python-build/share/python-build/pypy2.7-7.3.20-src
Normal file
@@ -0,0 +1,14 @@
|
||||
VERSION='7.3.20'
|
||||
PYVER='2.7'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
hash=bf958498445f7bf78338723c8d86bd6711e8792461725d2481df77a9566a3e62
|
||||
|
||||
### end of manual settings - following lines same for every download
|
||||
|
||||
ver="pypy${PYVER}-v${VERSION}-src"
|
||||
url="https://downloads.python.org/pypy/${ver}.tar.bz2"
|
||||
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "${ver}" "${url}#${hash}" 'pypy_builder' "verify_py${PYVER//./}" 'ensurepip_lt21'
|
||||
77
plugins/python-build/share/python-build/pypy3.11-7.3.20
Normal file
77
plugins/python-build/share/python-build/pypy3.11-7.3.20
Normal file
@@ -0,0 +1,77 @@
|
||||
VERSION='7.3.20'
|
||||
PYVER='3.11'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
aarch64_hash=9347fe691a07fd9df17a1b186554fb9d9e6210178ffef19520a579ce1f9eb741
|
||||
linux32_hash=d08ce15dd61e9ace5e010b047104f0137110a258184e448ea8239472f10cf99b
|
||||
linux64_hash=1410db3a7ae47603e2b7cbfd7ff6390b891b2e041c9eb4f1599f333677bccb3e
|
||||
osarm64_hash=84a48e09c97f57df62cc9f01b7a6d8c3e306b6270671d871aa8ab8c06945940d
|
||||
osx64_hash=bb3ae80cf5fca5044af2e42933e7692c7c5e76a828ce0eb6404a5d5da83b313c
|
||||
|
||||
### end of manual settings - following lines same for every download
|
||||
|
||||
function err_no_binary {
|
||||
local archmsg="${1}"
|
||||
local ver="pypy${PYVER}-v${VERSION}-src"
|
||||
local url="https://downloads.python.org/pypy/${ver}.tar.bz2"
|
||||
{ echo
|
||||
colorize 1 "ERROR"
|
||||
echo ": The binary distribution of PyPy is not available for ${archmsg}."
|
||||
echo "try '${url}' to build from source."
|
||||
echo
|
||||
} >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function pypy_pkg_data {
|
||||
# pypy architecture tag
|
||||
local ARCH="${1}"
|
||||
|
||||
# defaults
|
||||
local cmd='install_package' # use bz2
|
||||
local pkg="${ARCH}" # assume matches
|
||||
local ext='tar.bz2'
|
||||
local hash='' # undefined
|
||||
|
||||
# select the hash, fix pkg if not match ARCH
|
||||
case "${ARCH}" in
|
||||
'linux-aarch64' )
|
||||
hash="${aarch64_hash}"
|
||||
pkg='aarch64'
|
||||
;;
|
||||
'linux' )
|
||||
hash="${linux32_hash}"
|
||||
pkg='linux32'
|
||||
;;
|
||||
'linux64' )
|
||||
hash="${linux64_hash}"
|
||||
;;
|
||||
'osarm64' )
|
||||
hash="${osarm64_hash}"
|
||||
pkg='macos_arm64'
|
||||
;;
|
||||
'osx64' )
|
||||
if require_osx_version "10.13"; then
|
||||
hash="${osx64_hash}"
|
||||
pkg='macos_x86_64'
|
||||
else
|
||||
err_no_binary "${ARCH}, OS X < 10.13"
|
||||
fi
|
||||
;;
|
||||
* )
|
||||
err_no_binary "${ARCH}"
|
||||
;;
|
||||
esac
|
||||
|
||||
local basever="pypy${PYVER}-v${VERSION}"
|
||||
local baseurl="https://downloads.python.org/pypy/${basever}"
|
||||
|
||||
# result - command, package dir, url+hash
|
||||
echo "${cmd}" "${basever}-${pkg}" "${baseurl}-${pkg}.${ext}#${hash}"
|
||||
}
|
||||
|
||||
# determine command, package directory, url+hash
|
||||
declare -a pd="$(pypy_pkg_data "$(pypy_architecture 2>/dev/null || true)")"
|
||||
|
||||
# install
|
||||
${pd[0]} "${pd[1]}" "${pd[2]}" 'pypy' "verify_py${PYVER//./}" 'ensurepip'
|
||||
14
plugins/python-build/share/python-build/pypy3.11-7.3.20-src
Normal file
14
plugins/python-build/share/python-build/pypy3.11-7.3.20-src
Normal file
@@ -0,0 +1,14 @@
|
||||
VERSION='7.3.20'
|
||||
PYVER='3.11'
|
||||
|
||||
# https://www.pypy.org/checksums.html
|
||||
hash=7786dda760003e2ea7409c1037e50200c578ec427ce0245ac4cd758710b206fb
|
||||
|
||||
### end of manual settings - following lines same for every download
|
||||
|
||||
ver="pypy${PYVER}-v${VERSION}-src"
|
||||
url="https://downloads.python.org/pypy/${ver}.tar.bz2"
|
||||
|
||||
prefer_openssl11
|
||||
install_package "openssl-1.1.1f" "https://www.openssl.org/source/openssl-1.1.1f.tar.gz#186c6bfe6ecfba7a5b48c47f8a1673d0f3b0e5ba2e25602dd23b629975da3f35" mac_openssl --if has_broken_mac_openssl
|
||||
install_package "${ver}" "${url}#${hash}" 'pypy_builder' "verify_py${PYVER//./}" 'ensurepip'
|
||||
@@ -275,7 +275,7 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$PORT_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$PORT_PREFIX/lib -Wl,-rpath,$PORT_PREFIX/lib" PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: CFLAGS="" CPPFLAGS="-I$PORT_PREFIX/include -I${TMP}/install/include" LDFLAGS="-L$PORT_PREFIX/lib -Wl,-rpath,$PORT_PREFIX/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/lib/pkgconfig"
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
@@ -373,12 +373,9 @@ OUT
|
||||
@test "yaml is linked from MacPorts" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
yaml_libdir="$TMP/port-yaml"
|
||||
mkdir -p "$yaml_libdir/opt/local"
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 1010'
|
||||
stub port "-q location libyaml : echo '$yaml_libdir'"
|
||||
stub port "-q installed libyaml : echo ' libyaml @0.2.5_0 (active)'"
|
||||
for i in {1..3}; do stub port false; done
|
||||
stub_make_install
|
||||
|
||||
@@ -391,7 +388,7 @@ OUT
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CFLAGS="" CPPFLAGS="-I$yaml_libdir/opt/local/include -I${TMP}/install/include -I${TMP}/include" LDFLAGS="-L$yaml_libdir/opt/local/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L${TMP}/lib -Wl,-rpath,${TMP}/lib" PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/include -I${TMP}/install/include" LDFLAGS="-L${TMP}/lib -Wl,-rpath,${TMP}/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/lib/pkgconfig"
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
@@ -401,12 +398,9 @@ OUT
|
||||
@test "readline is linked from MacPorts" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
readline_libdir="$TMP/port-readline"
|
||||
mkdir -p "$readline_libdir/opt/local"
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 1010'
|
||||
stub port "-q location readline : echo '$readline_libdir'"
|
||||
stub port "-q installed readline : echo ' readline @8.2.013_0 (active)'"
|
||||
for i in {1..2}; do stub port false; done
|
||||
stub_make_install
|
||||
|
||||
@@ -421,7 +415,7 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CFLAGS="" CPPFLAGS="-I$readline_libdir/opt/local/include -I${TMP}/install/include -I${TMP}/include" LDFLAGS="-L$readline_libdir/opt/local/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L${TMP}/lib -Wl,-rpath,${TMP}/lib" PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/include -I${TMP}/install/include" LDFLAGS="-L${TMP}/lib -Wl,-rpath,${TMP}/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/lib/pkgconfig"
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
@@ -431,13 +425,10 @@ OUT
|
||||
@test "ncurses is linked from MacPorts" {
|
||||
cached_tarball "Python-3.6.2"
|
||||
|
||||
ncurses_libdir="$TMP/port-ncurses"
|
||||
mkdir -p "$ncurses_libdir/opt/local"
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 1010'
|
||||
stub port false
|
||||
stub port "-q location ncurses : echo '$ncurses_libdir'"
|
||||
stub port "-q installed ncurses : echo '$ncurses_libdir'"
|
||||
stub port false
|
||||
stub_make_install
|
||||
|
||||
@@ -452,7 +443,7 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CFLAGS="" CPPFLAGS="-I$ncurses_libdir/opt/local/include -I${TMP}/install/include -I${TMP}/include" LDFLAGS="-L$ncurses_libdir/opt/local/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L${TMP}/lib -Wl,-rpath,${TMP}/lib" PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/include -I${TMP}/install/include" LDFLAGS="-L${TMP}/lib -Wl,-rpath,${TMP}/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/lib/pkgconfig"
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
@@ -626,7 +617,7 @@ DEF
|
||||
unstub make
|
||||
|
||||
assert_build_log <<OUT
|
||||
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/install/include -I$PORT_PREFIX/include" LDFLAGS="-L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib -L$PORT_PREFIX/lib -Wl,-rpath,$PORT_PREFIX/lib" PKG_CONFIG_PATH=""
|
||||
Python-3.6.2: CFLAGS="" CPPFLAGS="-I${TMP}/include -I${TMP}/install/include" LDFLAGS="-L${TMP}/lib -Wl,-rpath,${TMP}/lib -L${TMP}/install/lib -Wl,-rpath,${TMP}/install/lib" PKG_CONFIG_PATH="${TMP}/lib/pkgconfig"
|
||||
Python-3.6.2: --prefix=$INSTALL_ROOT --enable-shared --libdir=$INSTALL_ROOT/lib
|
||||
make -j 2
|
||||
make install
|
||||
|
||||
Reference in New Issue
Block a user