From owner-freebsd-ports@freebsd.org Fri Apr 12 19:57:00 2019 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 299D81584C7B for ; Fri, 12 Apr 2019 19:57:00 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 883448A207 for ; Fri, 12 Apr 2019 19:56:58 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id x3CJutPA012844 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 12 Apr 2019 12:56:55 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id x3CJutUA012843; Fri, 12 Apr 2019 12:56:55 -0700 (PDT) (envelope-from sgk) Date: Fri, 12 Apr 2019 12:56:55 -0700 From: Steve Kargl To: Dima Pasechnik Cc: FreeBSD Ports Subject: Re: Default python is 3.6? Message-ID: <20190412195655.GA59279@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <20190412161112.GA5963@troutmask.apl.washington.edu> <20190412161742.GA21349@troutmask.apl.washington.edu> <20190412162810.GA24821@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) X-Rspamd-Queue-Id: 883448A207 X-Spamd-Bar: ++ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [2.01 / 15.00]; HAS_REPLYTO(0.00)[sgk@troutmask.apl.washington.edu]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_MED(-0.20)[21.76.95.128.list.dnswl.org : 127.0.11.2]; MX_GOOD(-0.01)[cached: troutmask.apl.washington.edu]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.01)[ip: (0.08), ipnet: 128.95.0.0/16(0.08), asn: 73(-0.05), country: US(-0.06)]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:73, ipnet:128.95.0.0/16, country:US]; SUBJECT_ENDS_QUESTION(1.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.73)[-0.733,0]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.52)[0.522,0]; TAGGED_RCPT(0.00)[freebsd]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[washington.edu]; MIME_GOOD(-0.10)[text/plain]; AUTH_NA(1.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.52)[0.516,0]; R_SPF_NA(0.00)[] X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Apr 2019 19:57:00 -0000 On Fri, Apr 12, 2019 at 09:19:30PM +0200, Dima Pasechnik wrote: > On Fri, Apr 12, 2019 at 6:29 PM Steve Kargl > wrote: > > > > On Fri, Apr 12, 2019 at 09:17:42AM -0700, Steve Kargl wrote: > > > > > > % find . -name math\* > > > ./work/Python-3.6.8/Doc/library/math.rst > > > ./work/Python-3.6.8/Modules/mathmodule.c > > > ./work/Python-3.6.8/Lib/test/math_testcases.txt > > > ./work/stage/usr/local/lib/python3.6/test/math_testcases.txt > > > > > > > Well, this one is easy to fix. I've sent this patch for 2 to 3 > > years now. I've opened a PR about it. Someday you guys might > > actually fix this, because I will contacting core to get my > > commit bit back. > > > This one is fixed in Python 3.7: > https://github.com/python/cpython/blob/3.7/Modules/mathmodule.c > via this commit: > https://github.com/python/cpython/commit/4e6646fef5d2cc53422e4eca0b18201ed5a5c4b6 > > It is also fixed in Python 2.7. > See https://github.com/python/cpython/pull/12027 for details. Doesn't matter what the python developer have done. A patch is still required to build lang/python27. Here's yet another copy of the patch. --- ./Modules/mathmodule.c.orig 2019-04-12 10:00:28.518460000 -0700 +++ ./Modules/mathmodule.c 2019-04-12 10:01:24.846412000 -0700 @@ -71,7 +71,7 @@ static const double sqrtpi = 1.772453850905516027298167483341145182798; static double -sinpi(double x) +_freebsd_ports_are_broken_sinpi(double x) { double y, r; int n; @@ -270,7 +270,7 @@ integer. */ if (absx > 200.0) { if (x < 0.0) { - return 0.0/sinpi(x); + return 0.0/_freebsd_ports_are_broken_sinpi(x); } else { errno = ERANGE; @@ -294,7 +294,7 @@ } z = z * lanczos_g / y; if (x < 0.0) { - r = -pi / sinpi(absx) / absx * exp(y) / lanczos_sum(absx); + r = -pi / _freebsd_ports_are_broken_sinpi(absx) / absx * exp(y) / lanczos_sum(absx); r -= z * r; if (absx < 140.0) { r /= pow(y, absx - 0.5); @@ -366,7 +366,7 @@ (x-0.5)*(log(x+lanczos_g-0.5)-1); } else { - r = log(pi) - log(fabs(sinpi(absx))) - log(absx) - + r = log(pi) - log(fabs(_freebsd_ports_are_broken_sinpi(absx))) - log(absx) - (log(lanczos_sum(absx)) - lanczos_g + (absx-0.5)*(log(absx+lanczos_g-0.5)-1)); } -- Steve