Summary: | Namespace pollution in all python ports | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | sgk | ||||
Component: | Individual Port(s) | Assignee: | Tobias C. Berner <tcberner> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | dimpase+freebsd, imp, jrm, koobs, linimon, lwhsu, python, tcberner, w.schwarzenfeld | ||||
Priority: | --- | Keywords: | needs-qa | ||||
Version: | Latest | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
See Also: |
https://github.com/python/cpython/pull/12027 https://github.com/python/cpython/pull/12050 |
||||||
Attachments: |
|
Thank you for your report. Could you please submit this as an upstream bug (at https://bugs.python.org/) and add the resulting issue URL to this bugs URL field please. (In reply to Kubilay Kocak from comment #1) I went to https://bugs.python.org/, but could not find a "Submit Bug Report" link nor a FAQ on how to submit a bug report. I've previously sent emails (with patches) to freebsd-ports@ about this conflict https://lists.freebsd.org/pipermail/freebsd-ports/2017-June/109093.html https://lists.freebsd.org/pipermail/freebsd-ports/2017-September/110229.html Finally, gave up on those emails having any hope. Having once again recreated the patch for lang/python36, I decided to submit a (useless?) bug report. I will be returning to the code I submitted as bug #218514 to address a few issues raised by Bruce Evans (bde). Once I address those issues, I will seek to have the code committed to libm. The python ports will be broken at that time. I've tried to get patches committed to no avail. (In reply to sgk from comment #2) > Once I address those issues, I will seek to have the code committed to libm. > The python ports will be broken at that time. That's not how things work in a collaborative environment. I respect the work you do on FreeBSD, but you (or anyone else) don't get to unilaterally break Python. Remember POLA. (In reply to Mark Linimon from comment #3) I have submitted patches multiple times to deal with python's use of sinpi in mathmodules.c. See https://lists.freebsd.org/pipermail/freebsd-ports/2017-June/109093.html https://lists.freebsd.org/pipermail/freebsd-ports/2017-September/110229.html and the patch attached to this bug report. It's been over a year since I sent the original patch. How much more collaboration do you want. If freebsd-ports@ and freebsd-python@ refuse to committed my patches and a patch to libm breaks python, then that's not my problem. Have you tried emailing python@freebsd.org directly? They seem to be in charge of this port. Maybe that would be a better place to start than freebsd-ports@? Certainly wouldn't hurt to reach out to them first before you intentionally break something which will cause a chain reaction of people with hurt feelings which likely won't end well. Once you log in at https://bugs.python.org/ there is a 'Create New' link under 'Issues' in the menu on the left side of the main page. On the surface, I think I am repeating what Kubilay alluded to: this sounds like a Python issue and not a FreeBSD Python ports issue. Sigh. Closing. That's not to say that this patch is or isn't appropriate in the short term. I will re-open until someone from python@ or portmgr@ weighs in, OK? We don't want to see your contributions wasted, but we just have to be cautious with a big change like this. (In reply to Warner Losh from comment #5) Coming from the dirty mouth imp man. That is rich. Power trip to the max. and https://github.com/python/cpython/pull/12050 is the backport to python2.7 (In reply to Dima Pasechnik from comment #10) Thank you! It needs to be backported to 3.5 and 3.6 branches too. Hopefully upstream will do the backport to 3.6, see https://bugs.python.org/issue36106#msg340110 No word about 3.5 yet. Anyhow, what exactly is needed here? Patches for Python 2.7, 3.5, 3.6? A commit references this bug: Author: tcberner Date: Sat Dec 7 19:11:48 UTC 2019 New revision: 519233 URL: https://svnweb.freebsd.org/changeset/ports/519233 Log: Fix namespace pollution in python3.5 and python3.6 (upstreamed fix) 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 worked 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). - python2.7 and > 3.6 are already fixed PR: 232792 Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>, Dima Pasechnik <dimpase+freebsd@gmail.com> Approved by: python (maintainer timeout) Obtained from: https://github.com/python/cpython/commit/b545ba0a508a5980ab147ed2641a42be3b31a2db Changes: head/lang/python35/Makefile head/lang/python35/distinfo head/lang/python36/Makefile head/lang/python36/distinfo Thanks, committed. The other versions (2.7 and >3.6 already ship with the renamed function). A commit references this bug: Author: lwhsu Date: Mon Dec 9 09:24:15 UTC 2019 New revision: 519597 URL: https://svnweb.freebsd.org/changeset/ports/519597 Log: MFH: r519233 r519241 r519244 Fix namespace pollution in python3.5 and python3.6 (upstreamed fix) 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 worked 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). - python2.7 and > 3.6 are already fixed PR: 232792 Submitted by: Steve Kargl <sgk@troutmask.apl.washington.edu>, Dima Pasechnik <dimpase+freebsd@gmail.com> Approved by: python (maintainer timeout) Obtained from: https://github.com/python/cpython/commit/b545ba0a508a5980ab147ed2641a42be3b31a2db Backport fix of https://bugs.python.org/issue32849 This is needed for starting sysutils/azure-agent at boot: https://github.com/Azure/WALinuxAgent/issues/1687 Obtained from: https://github.com/python/cpython/pull/12852/commits/f9c01a16dae8aa15d264a1937fb589e8598d1c88 Sponsored by: The FreeBSD Foundation Fix makefile ordering. Reported by: mat Approved by: ports-secteam (miwi) Sponsored by: The FreeBSD Foundation Changes: branches/2019Q4/lang/python35/Makefile branches/2019Q4/lang/python35/distinfo branches/2019Q4/lang/python36/Makefile branches/2019Q4/lang/python36/distinfo |
Created attachment 198747 [details] patch The python languages contain a file named mathmodules.c, which defines a function named sinpi. sinpi is part of The Floating-point extensions for C - Part 4: Supplementary functions, ISO/IEC TS 18661-4:2015. For a libm that contains functions for TS-18661-4:2015, there is a conflict between math.h and the locally defined sinpi in mathmodules.c. The attached patch removes the conflict.