From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id KOrUJzaB4V91GwAA0tVLHw (envelope-from ) for ; Tue, 22 Dec 2020 05:16:38 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yOaHIzaB4V+iGwAAbx9fmQ (envelope-from ) for ; Tue, 22 Dec 2020 05:16:38 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 28B4194014B for ; Tue, 22 Dec 2020 05:16:38 +0000 (UTC) Received: from localhost ([::1]:38428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kra2G-0006Lx-SB for larch@yhetil.org; Tue, 22 Dec 2020 00:16:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kra27-0006Lf-6e for guix-devel@gnu.org; Tue, 22 Dec 2020 00:16:27 -0500 Received: from world.peace.net ([64.112.178.59]:48604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kra24-0000yN-MM for guix-devel@gnu.org; Tue, 22 Dec 2020 00:16:26 -0500 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kra22-0000g0-89; Tue, 22 Dec 2020 00:16:22 -0500 From: Mark H Weaver To: John Doe , Chris Marusich Subject: Re: [PATCH] gnu: libffi: Add unreleased patch to fix float128 on powerpc64le. Date: Tue, 22 Dec 2020 00:15:25 -0500 Message-ID: <87y2hqifp3.fsf@netris.org> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=64.112.178.59; envelope-from=mhw@netris.org; helo=world.peace.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org, 45252@debbugs.gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 28B4194014B X-Spam-Score: -1.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: ZARGk8drbMgJ Hi, There's a problem with the following commit: > commit 7eaa2f24ea77cddbb4bbc2d6a6905673a36f8f99 > Author: John Doe > Date: Tue Dec 15 10:23:44 2020 +0100 > > gnu: libffi: Add unreleased patch to fix float128 on powerpc64le. > > Fixes . > > * gnu/packages/patches/libffi-float128-powerpc64le.patch: Import patch file > from . > * gnu/packages/libffi.scm (libffi)[arguments]: Apply patch conditionally for > powerpc64le-* systems in a phase. > [inputs]: Add patch as input conditionally for powerpc64le-* systems. > * gnu/local.mk (dist_patch_DATA): Add patch file to build system. > > Signed-off-by: Chris Marusich The problem is in how the 'patch' program is invoked, here: > diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm > index d324892330..66239e0363 100644 > --- a/gnu/packages/libffi.scm > +++ b/gnu/packages/libffi.scm [...] > @@ -67,13 +68,28 @@ > "powerpc-patch"))) > (invoke "patch" "--batch" "-p1" > "-i" patch)))))) > + '()) > + ,@(if (string-prefix? "powerpc64le-" (or (%current-target-system) > + (%current-system))) > + '(#:phases (modify-phases %standard-phases > + (add-after 'unpack 'apply-patch2 > + (lambda* (#:key inputs #:allow-other-keys) > + (let ((patch (assoc-ref inputs > + "powerpc64le-patch"))) > + (invoke "patch" "--batch" "-p1" > + "-i" patch)))))) > '()))) When invoking 'patch' in Guix, you should *always* use "--force" instead of "--batch". There's a crucial difference between these two options: If 'patch' finds that the given patch has already been applied, then "--batch" will automatically *revert* the patch, whereas "--force" will raise an error. Here's the relevant section of the 'diffutils' manual: > 10.11.2 Inhibiting Keyboard Input > --------------------------------- > > There are two ways you can prevent 'patch' from asking you any > questions. The '--force' ('-f') option assumes that you know what you > are doing. It causes 'patch' to do the following: > > * Skip patches that do not contain file names in their headers. > > * Patch files even though they have the wrong version for the > 'Prereq:' line in the patch; > > * Assume that patches are not reversed even if they look like they > are. > > The '--batch' ('-t') option is similar to '-f', in that it suppresses > questions, but it makes somewhat different assumptions: > > * Skip patches that do not contain file names in their headers (the > same as '-f'). > > * Skip patches for which the file has the wrong version for the > 'Prereq:' line in the patch; > > * Assume that patches are reversed if they look like they are. Now consider what will happen when we upgrade 'libffi' to a newer version that already includes this fix. If the Guix developer who performs the upgrade forgets to remove this patch, the 'patch' invocation above will start silently re-inserting the old bug. We ran into this exact problem in the early years of Guix, and henceforth changed all of the invocations of 'patch' to use '--force'. Can we fix this right away, before many powerpc64le-* binaries are built on top of it? In any case, thanks very much for working on the powerpc64le port! Regards, Mark