From unknown Tue Jun 17 03:39:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#43367] [core-updates]: [PATCH 0/5]: Prevent wrap-progam from double-wrapping. Resent-From: Brendan Tildesley Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Sep 2020 05:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43367 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43367@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15999755592811 (code B ref -1); Sun, 13 Sep 2020 05:40:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Sep 2020 05:39:19 +0000 Received: from localhost ([127.0.0.1]:49331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKjP-0000jG-Ax for submit@debbugs.gnu.org; Sun, 13 Sep 2020 01:39:19 -0400 Received: from lists.gnu.org ([209.51.188.17]:56400) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKjN-0000j8-1p for submit@debbugs.gnu.org; Sun, 13 Sep 2020 01:39:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kHKjM-0002qj-O3 for guix-patches@gnu.org; Sun, 13 Sep 2020 01:39:16 -0400 Received: from mout-p-101.mailbox.org ([2001:67c:2050::465:101]:33964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1kHKjJ-00014e-LP for guix-patches@gnu.org; Sun, 13 Sep 2020 01:39:15 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4BpywX2SL2zKmdk for ; Sun, 13 Sep 2020 07:39:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brendan.scot; s=MBO0001; t=1599975546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=2em40IVmbfEHVWi79TgETN7K0WHFJ5BZjilFTOfCeGc=; b=VCASaj/CTKTqmseGAIoikTfnaT1I0apjFuRq4gRy+Ok0at0w362EYsplG6aBTWjvMOBtui IBFwjzaYXM6NiGmnZf/7RIdMx9ukl0ZwufDHkn2jtmt19HvMNjhRQ0PdGh1kLPwaUZ/AUp OMuBPwK99aU/DLaKDx5XIGSXX8cRo86hJpUgzBYiNUNCPtpnHfTZyFX55Chx2/j2ypeIOQ KOeOuvquALv1cm6W3caJZCbwtObxg9AEv+tgTwJsjSO6o7R6YzW/cv3rcHbxXA05j2ZKLr MFoux157J+4cZmMxZpft9TjTcU+kg3JKl8ve3nsyxyjTBfYDjUeJYERaSSFzEw== Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id 5-z45EysO_Fb for ; Sun, 13 Sep 2020 07:39:05 +0200 (CEST) From: Brendan Tildesley Message-ID: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> Date: Sun, 13 Sep 2020 15:39:15 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-MBO-SPAM-Probability: X-Rspamd-Score: -3.36 / 15.00 / 15.00 X-Rspamd-Queue-Id: 593BF26E X-Rspamd-UID: 6838be Received-SPF: pass client-ip=2001:67c:2050::465:101; envelope-from=mail@brendan.scot; helo=mout-p-101.mailbox.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) I'm attempting to fix a bug where wrap-program produces ..X-real-real files by mistakenly wrapping already wrapped files. I haven't fully tested these because it requires rebuilding everything which takes hours to days and core-updates is stuck on mesa now anyway. Perhaps I'll try testing on master. Also there may be other places where .X-real files are accidentally wrapped, which will now error. From unknown Tue Jun 17 03:39:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#43367] [PATCH 1/5] utils: wrap-program: Refuse to wrap .X-real files. Resent-From: Brendan Tildesley Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Sep 2020 05:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43367 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43367@debbugs.gnu.org Received: via spool by 43367-submit@debbugs.gnu.org id=B43367.15999759843485 (code B ref 43367); Sun, 13 Sep 2020 05:47:02 +0000 Received: (at 43367) by debbugs.gnu.org; 13 Sep 2020 05:46:24 +0000 Received: from localhost ([127.0.0.1]:49336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKqG-0000u9-5z for submit@debbugs.gnu.org; Sun, 13 Sep 2020 01:46:24 -0400 Received: from mout-p-102.mailbox.org ([80.241.56.152]:50636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKqF-0000ts-0Y for 43367@debbugs.gnu.org; Sun, 13 Sep 2020 01:46:23 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4Bpz4m6Tr2zKmV1 for <43367@debbugs.gnu.org>; Sun, 13 Sep 2020 07:46:16 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brendan.scot; s=MBO0001; t=1599975975; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FSlbc1KMo1TRSTALdnQ1FHgRvX/spQIlHUx6WcN6IYk=; b=kOovU+aZdX//4Vk1Pw3vzi1l2PRsTnRO3arVDVg7Xj+pOsPeJ1kT5ELreqgBHajjM2ybwD /f3tCbhAzCZKDu6HdJ0NVEcTeir1/SrC7P/CD+XUiHHRYzBuoKaQ21XUn+43YnB1FZhtJD nIOuTtqt8uuqO9kyoyPpLpJexZQrp65QJQcbO3k3ohk/hcYCQu0PgeoWoMpaFIKe5uAR7U /+nyBZ2Od7d/CDDr7m9Z9czLGIKWPJX2Rrm+L07/e82b9KqLf/62NJc8iX7xUS1A0OZiuf lxzLfNLNFTldt38JJR99h006D1pmf67QMTTRZFT1fr88qqbhE6x26g4+5VLLug== Received: from smtp2.mailbox.org ([80.241.60.241]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id OD_Vp6VVa-P1 for <43367@debbugs.gnu.org>; Sun, 13 Sep 2020 07:46:13 +0200 (CEST) From: Brendan Tildesley Date: Sun, 13 Sep 2020 15:45:53 +1000 Message-Id: <20200913054557.12911-1-mail@brendan.scot> In-Reply-To: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> References: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MBO-SPAM-Probability: * X-Rspamd-Score: 1.48 / 15.00 / 15.00 X-Rspamd-Queue-Id: D85C0271 X-Rspamd-UID: 9d3abe X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/build/utils.scm: (wrap-program): Error if wrap-program was mistakenly passed a .X-real file. This prevents and forces us to fix cases where a double wrapped ..X-real-real file is created, such as can be seen with: find /gnu/ -iname '.*-real-real' --- guix/build/utils.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index e872cfffd3..822191f4de 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -1194,6 +1194,9 @@ with definitions for VARS." (format #f "export ~a=\"$~a${~a:+:}~a\"" var var var (string-join rest ":"))))) + (when (wrapped-program? prog) + (error (string-append prog " is a wrapper. Refusing to wrap."))) + (if already-wrapped? ;; PROG is already a wrapper: add the new "export VAR=VALUE" lines just -- 2.28.0 From unknown Tue Jun 17 03:39:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#43367] [PATCH 2/5] utils: Rename wrapper? to wrapped-program?. Resent-From: Brendan Tildesley Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Sep 2020 05:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43367 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43367@debbugs.gnu.org Received: via spool by 43367-submit@debbugs.gnu.org id=B43367.15999759873506 (code B ref 43367); Sun, 13 Sep 2020 05:47:02 +0000 Received: (at 43367) by debbugs.gnu.org; 13 Sep 2020 05:46:27 +0000 Received: from localhost ([127.0.0.1]:49340 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKqJ-0000uT-Fm for submit@debbugs.gnu.org; Sun, 13 Sep 2020 01:46:27 -0400 Received: from mout-p-202.mailbox.org ([80.241.56.172]:50346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKqG-0000tw-Sc for 43367@debbugs.gnu.org; Sun, 13 Sep 2020 01:46:25 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Bpz4p5cWPzQkmG for <43367@debbugs.gnu.org>; Sun, 13 Sep 2020 07:46:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brendan.scot; s=MBO0001; t=1599975976; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=z2gxQwUEosdiIO6kGilY/BWyNTtagfYFScxJn3j9RLI=; b=ej51wAzD3S9Y6lmXVEAlZuO1ky4K4Gqvw54vvoLTAyRYbq4I9XL25CBlp9iIGCqCA/dmjv tDEcNncMwdCGT+9HsEX0Hvcy1DU+gOVoQhLYBtjbwWF1NTDobVnfXhzFMmaDfhdXkEagth O9NcWvHf5kN5S9ZXBtQIqReYBkfZva3CUO5pYiSjIem3fIeDkKzR7x1m5268RuDUxuqQgp rDCVWsEqQYy5CQkOfTFo4AoPd+qcfhiSOe1S6aIMdJiDY4ExDRDOsKavNyB+MSu81ZnqxU BbY3+4CIJeGbLbrgyXkeo66cKAtp0VeDe9WdsIEVyS+O54UypIqa3v5mtm+izQ== Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id LJcBWiW7319K for <43367@debbugs.gnu.org>; Sun, 13 Sep 2020 07:46:15 +0200 (CEST) From: Brendan Tildesley Date: Sun, 13 Sep 2020 15:45:54 +1000 Message-Id: <20200913054557.12911-2-mail@brendan.scot> In-Reply-To: <20200913054557.12911-1-mail@brendan.scot> References: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> <20200913054557.12911-1-mail@brendan.scot> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MBO-SPAM-Probability: * X-Rspamd-Score: 0.80 / 15.00 / 15.00 X-Rspamd-Queue-Id: CC504273 X-Rspamd-UID: 42e5da X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/build/utils.scm (wrap-program): The wrapper? procedure is incorrectly named as it actually checks to see if prog is the original program that was moved, not the wrapper. * guix/build/python-build-system: (wrap): Use renamed wrapped-program?. --- guix/build/python-build-system.scm | 2 +- guix/build/utils.scm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm index 62e7a7b305..d1dbbc1de2 100644 --- a/guix/build/python-build-system.scm +++ b/guix/build/python-build-system.scm @@ -196,7 +196,7 @@ when running checks after installing the package." (define (list-of-files dir) (find-files dir (lambda (file stat) (and (eq? 'regular (stat:type stat)) - (not (wrapper? file)))))) + (not (wrapped-program? file)))))) (define bindirs (append-map (match-lambda diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 822191f4de..4cd227a668 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -90,7 +90,7 @@ patch-/usr/bin/file fold-port-matches remove-store-references - wrapper? + wrapped-program? wrap-program wrap-script @@ -1118,8 +1118,8 @@ known as `nuke-refs' in Nixpkgs." (program wrap-error-program) (type wrap-error-type)) -(define (wrapper? prog) - "Return #t if PROG is a wrapper as produced by 'wrap-program'." +(define (wrapped-program? prog) + "Return #t if PROG is a program that was moved and wrapped by 'wrap-program'." (and (file-exists? prog) (let ((base (basename prog))) (and (string-prefix? "." base) -- 2.28.0 From unknown Tue Jun 17 03:39:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#43367] [PATCH 3/5] glib-or-gtk-build-system: Don't double wrap programs. Resent-From: Brendan Tildesley Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Sep 2020 05:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43367 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43367@debbugs.gnu.org Received: via spool by 43367-submit@debbugs.gnu.org id=B43367.15999759883518 (code B ref 43367); Sun, 13 Sep 2020 05:47:02 +0000 Received: (at 43367) by debbugs.gnu.org; 13 Sep 2020 05:46:28 +0000 Received: from localhost ([127.0.0.1]:49343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKqJ-0000uW-Q5 for submit@debbugs.gnu.org; Sun, 13 Sep 2020 01:46:28 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]:31064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKqI-0000ty-EN for 43367@debbugs.gnu.org; Sun, 13 Sep 2020 01:46:26 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Bpz4r2WVCzQkkJ for <43367@debbugs.gnu.org>; Sun, 13 Sep 2020 07:46:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brendan.scot; s=MBO0001; t=1599975978; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GDXmgOMbs3D4zP72xGN8NM0+tHTbLwgy8rtz/dY09vc=; b=Q3wAc9i6clSohE6FlxhTwVtb5fhf1WjqlYPWrbSVWIQROUV0Ml+HilP/NSJKkAqPClpuuX yMfjhxQZFbqI/4tWNQOQtRQ95a+fmnb0tJlde25Ah6Y2gcVoMOR5CAu11ijTWR8KMh1iif R4S0XeIVOAj+GUhzkduqhFSx9t2slSgL0R5MWla+jBjzhGsL1jlyVr5NHPHpXlMHzu/jBS OpiCk4LxjHZiKGY7QMGdH2HIj9L1lU0EFjzNCKIOLiCdUiaiFTLj3XyQRkg8CxWzceksmE KciWrR9MflDrbNvZOjtvSDG3RJwrljevigkrPF/Mhy2595VQji0EGueN9TlpNQ== Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id SavwKnaseiS0 for <43367@debbugs.gnu.org>; Sun, 13 Sep 2020 07:46:17 +0200 (CEST) From: Brendan Tildesley Date: Sun, 13 Sep 2020 15:45:55 +1000 Message-Id: <20200913054557.12911-3-mail@brendan.scot> In-Reply-To: <20200913054557.12911-1-mail@brendan.scot> References: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> <20200913054557.12911-1-mail@brendan.scot> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MBO-SPAM-Probability: * X-Rspamd-Score: 0.53 / 15.00 / 15.00 X-Rspamd-Queue-Id: 631E8271 X-Rspamd-UID: 6ce4ee X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/build/glib-or-gtk-build-system.scm (wrap-all-programs): If a package definition was modified to insert an additional wrap phase before glib-or-gtk...'s wrap phase instead of after, glib-or-gtk...'s wrap phase will double wrap the .X-real file from the earlier wrap phase. Filtering out such wrapped programs means these .X-real files should fix this and mean packagers don't have to worry about ensuring their wrap phases are put afterwards. --- guix/build/glib-or-gtk-build-system.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guix/build/glib-or-gtk-build-system.scm b/guix/build/glib-or-gtk-build-system.scm index ba680fd1a9..ccb3138fe2 100644 --- a/guix/build/glib-or-gtk-build-system.scm +++ b/guix/build/glib-or-gtk-build-system.scm @@ -142,8 +142,9 @@ add a dependency of that output on GLib and GTK+." (unless (member output glib-or-gtk-wrap-excluded-outputs) (let* ((bindir (string-append directory "/bin")) (libexecdir (string-append directory "/libexec")) - (bin-list (append (find-files bindir ".*") - (find-files libexecdir ".*"))) + (bin-list (filter (negate wrapped-program?) + (append (find-files bindir ".*") + (find-files libexecdir ".*")))) (datadirs (data-directories (alist-cons output directory inputs))) (gtk-mod-dirs (gtk-module-directories -- 2.28.0 From unknown Tue Jun 17 03:39:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#43367] [PATCH 4/5] rakudo-build-system: Don't double wrap programs. Resent-From: Brendan Tildesley Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Sep 2020 05:47:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43367 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43367@debbugs.gnu.org Received: via spool by 43367-submit@debbugs.gnu.org id=B43367.15999759923535 (code B ref 43367); Sun, 13 Sep 2020 05:47:03 +0000 Received: (at 43367) by debbugs.gnu.org; 13 Sep 2020 05:46:32 +0000 Received: from localhost ([127.0.0.1]:49346 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKqO-0000uw-3H for submit@debbugs.gnu.org; Sun, 13 Sep 2020 01:46:32 -0400 Received: from mout-p-101.mailbox.org ([80.241.56.151]:64818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKqJ-0000u0-HV for 43367@debbugs.gnu.org; Sun, 13 Sep 2020 01:46:27 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Bpz4s4XxhzKmc3 for <43367@debbugs.gnu.org>; Sun, 13 Sep 2020 07:46:21 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brendan.scot; s=MBO0001; t=1599975979; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ur2jpyG4b+NO01Y6UbYtAKyVgRPbQrk9jUkfdt5VRyA=; b=dgQT1JIrK3d47hACEwzTZwbHDYTUkRdiM0Rnamz9w8rVAvHwAYc6yau/uZ1OVTHVQfzP/C T5IdA2I46qbplD1vlZwkFQwql/uFt6ofxnYIYZoUh5imub4byaRLbi9xple9zgSNq5kTaC dGid1t4hB/KAZink6hVPOFKmp4P0NCg1RbW5Cnute6BhWjPih4zlGHkxuWjhciIJdeIFkc LlXBVDrSIrqbrdFxSVIrPbHT8YU2CqOQGxKLpUvuDp0V8e1aVCxW+GkVuTMY5c1WCcKzHh CZDbnadKsZfSlju1BqtEm+lKU8BQyLXYYIroP+G/6CoLjmB9ypV5W1XaqmcyEA== Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id c5Ix7i6P-ZDh for <43367@debbugs.gnu.org>; Sun, 13 Sep 2020 07:46:19 +0200 (CEST) From: Brendan Tildesley Date: Sun, 13 Sep 2020 15:45:56 +1000 Message-Id: <20200913054557.12911-4-mail@brendan.scot> In-Reply-To: <20200913054557.12911-1-mail@brendan.scot> References: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> <20200913054557.12911-1-mail@brendan.scot> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MBO-SPAM-Probability: * X-Rspamd-Score: 0.15 / 15.00 / 15.00 X-Rspamd-Queue-Id: 9F05326E X-Rspamd-UID: 6cc3e5 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/build/rakudo-build-system.scm (wrap): Don't return any potential already wrapped-programs in the list-of-files to wrap. --- guix/build/rakudo-build-system.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/build/rakudo-build-system.scm b/guix/build/rakudo-build-system.scm index dbdeb1ccd2..b2c090f946 100644 --- a/guix/build/rakudo-build-system.scm +++ b/guix/build/rakudo-build-system.scm @@ -97,7 +97,8 @@ (map (cut string-append dir "/" <>) (or (scandir dir (lambda (f) (let ((s (stat (string-append dir "/" f)))) - (eq? 'regular (stat:type s))))) + (and (eq? 'regular (stat:type s)) + (not (wrapped-program? f)))))) '()))) (define bindirs -- 2.28.0 From unknown Tue Jun 17 03:39:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#43367] [PATCH 5/5] qt-build-system: Don't double wrap programs. Resent-From: Brendan Tildesley Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Sep 2020 05:47:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43367 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43367@debbugs.gnu.org Received: via spool by 43367-submit@debbugs.gnu.org id=B43367.15999759923542 (code B ref 43367); Sun, 13 Sep 2020 05:47:03 +0000 Received: (at 43367) by debbugs.gnu.org; 13 Sep 2020 05:46:32 +0000 Received: from localhost ([127.0.0.1]:49348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKqO-0000uy-A9 for submit@debbugs.gnu.org; Sun, 13 Sep 2020 01:46:32 -0400 Received: from mout-p-102.mailbox.org ([80.241.56.152]:50640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHKqL-0000u8-7t for 43367@debbugs.gnu.org; Sun, 13 Sep 2020 01:46:29 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4Bpz4v5mN1zKmV1 for <43367@debbugs.gnu.org>; Sun, 13 Sep 2020 07:46:23 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brendan.scot; s=MBO0001; t=1599975982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qORu6FXXehCXwr9WEUG2YpCClc1TBn/W+Bm2zKyYZwo=; b=X6FKTJmscx+ZLs7NaKn1DUo7GVKe6xgCcrydCbASkaqpMTozWk5kxUUL32UAJbUG9OZrj+ Y5xY05TD8Ip/ju3XExXh8FyyLQAah5zabvo4WUgTlH558Uw64Cl6Zfvl1jZIlA/jp3vWY1 R5Yn7iK23yNrdjs9w3S83lZFwSJa083zGwjZ/h/GqO2SVXwp39KRNFJ05TcHb/BJ45kFdp 016MnGB/1MfxfDfEUUIzW04OdGC0lEmvHnpws7cLhmP+qXaMi9kvXpn5P8kvo/QEfJZTie Mb05NxcsAJGuUNR2gLWQWCAkh3dpnzR+1l5OCuRbdvE8qPtIXiwAZfnlerTTcA== Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id S3JG-BPHjXm3 for <43367@debbugs.gnu.org>; Sun, 13 Sep 2020 07:46:20 +0200 (CEST) From: Brendan Tildesley Date: Sun, 13 Sep 2020 15:45:57 +1000 Message-Id: <20200913054557.12911-5-mail@brendan.scot> In-Reply-To: <20200913054557.12911-1-mail@brendan.scot> References: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> <20200913054557.12911-1-mail@brendan.scot> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MBO-SPAM-Probability: * X-Rspamd-Score: 0.56 / 15.00 / 15.00 X-Rspamd-Queue-Id: C99D126C X-Rspamd-UID: d90505 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) * guix/build/qt-build-system.scm (wrap-all-programs): Excluded wrapped programs from the list of files to wrap if they exist to avoid double wrapping. --- guix/build/qt-build-system.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guix/build/qt-build-system.scm b/guix/build/qt-build-system.scm index 005157b0a4..4738ca09c9 100644 --- a/guix/build/qt-build-system.scm +++ b/guix/build/qt-build-system.scm @@ -83,7 +83,10 @@ add a dependency of that output on Qt." (define (find-files-to-wrap directory) (append-map (lambda (dir) - (if (directory-exists? dir) (find-files dir ".*") (list))) + (if (directory-exists? dir) + (find-files dir (lambda (file stat) + (not (wrapped-program? file)))) + '())) (list (string-append directory "/bin") (string-append directory "/sbin") (string-append directory "/libexec") -- 2.28.0 From unknown Tue Jun 17 03:39:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#43367] [core-updates]: [PATCH 0/5]: Prevent wrap-progam from double-wrapping. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Sep 2020 09:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43367 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brendan Tildesley Cc: 43367@debbugs.gnu.org Received: via spool by 43367-submit@debbugs.gnu.org id=B43367.159999002425664 (code B ref 43367); Sun, 13 Sep 2020 09:41:02 +0000 Received: (at 43367) by debbugs.gnu.org; 13 Sep 2020 09:40:24 +0000 Received: from localhost ([127.0.0.1]:49450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHOUi-0006fs-Fp for submit@debbugs.gnu.org; Sun, 13 Sep 2020 05:40:24 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:34212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHOUg-0006fj-PZ for 43367@debbugs.gnu.org; Sun, 13 Sep 2020 05:40:23 -0400 Received: from localhost (80-110-126-103.cgn.dynamic.surfer.at [80.110.126.103]) by dd26836.kasserver.com (Postfix) with ESMTPSA id DF12F336893E; Sun, 13 Sep 2020 11:40:20 +0200 (CEST) Date: Sun, 13 Sep 2020 11:40:19 +0200 From: Danny Milosavljevic Message-ID: <20200913114019.58a6bda0@scratchpost.org> In-Reply-To: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> References: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/aX31ISni.LNImQXOfUzPM5X"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Sig_/aX31ISni.LNImQXOfUzPM5X Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Sun, 13 Sep 2020 15:39:15 +1000 Brendan Tildesley wrote: > I'm attempting to fix a bug where wrap-program produces ..X-real-real=20 > files by mistakenly wrapping already wrapped files. I haven't fully=20 > tested these because it requires rebuilding everything which takes hours= =20 > to days and core-updates is stuck on mesa now anyway. Perhaps I'll try=20 > testing on master. Also there may be other places where .X-real files=20 > are accidentally wrapped, which will now error. But can't a thing be wrapped once for one reason and another time for anoth= er reason and that should be fine? --Sig_/aX31ISni.LNImQXOfUzPM5X Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl9d6QMACgkQ5xo1VCww uqXYBAf/SYsAR5A4AYq/DdVDnV1V2ZqmOEBgR2bBwvk65kl2ZFJuFr5AzXvhw59O DVVVhDUtx4I+yk8oq3o/ySovtnOUDEwIaukAsxWZekQt2/+6fAE3iFI3lVZCvO5x LQdpIIGJpqIBPgPyZqaxF/pMM7MpVkKi3MmHYk1+QoAgYKhv/Hz1lUdZ/BPoDs5Z +EoJq8vOsmm9c5zLn+SXO5R5bPEvWrItRxVeWXHaulbR/T5j8hJLBSLoR3do55og 47tdFZDZ8wrk+KfLrUQ358XoycB+vcfhE7204XRzd9i4zjY4taoggnGg+Y13WDS5 gpbrAvic3KNROJ/QfmADkVgkkukjfA== =G/xm -----END PGP SIGNATURE----- --Sig_/aX31ISni.LNImQXOfUzPM5X-- From unknown Tue Jun 17 03:39:58 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#43367] [core-updates]: [PATCH 0/5]: Prevent wrap-progam from double-wrapping. Resent-From: Brendan Tildesley Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 13 Sep 2020 12:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43367 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Danny Milosavljevic Cc: 43367@debbugs.gnu.org Received: via spool by 43367-submit@debbugs.gnu.org id=B43367.160000025426488 (code B ref 43367); Sun, 13 Sep 2020 12:31:02 +0000 Received: (at 43367) by debbugs.gnu.org; 13 Sep 2020 12:30:54 +0000 Received: from localhost ([127.0.0.1]:49629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHR9h-0006t9-OQ for submit@debbugs.gnu.org; Sun, 13 Sep 2020 08:30:54 -0400 Received: from mout-p-202.mailbox.org ([80.241.56.172]:57644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kHR9f-0006sv-5P for 43367@debbugs.gnu.org; Sun, 13 Sep 2020 08:30:53 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:105:465:1:2:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Bq83S4hDrzQlCD; Sun, 13 Sep 2020 14:30:44 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brendan.scot; s=MBO0001; t=1600000242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=tRuW+V+WefVEkxjDfu+DweLR/5Jyoz7XaiAb6acE2Sw=; b=dus1NkkC/2yLgF+9Ub3SSYHylmzGHhQlHSf5ZCSErc63ZIriovArDDvHI2ckBgFVMqjolg eleyXAgssodq1JUxmEjMJHWEocw8p1j5OoSYNUcI3lX4yv7tBXnSuM44qY6ofuBJvTvEyK BwzfQp2jHMf++jIdQ/5RGTmNsHHDQHIFgWNK5X0n18rlXEWsj/GqcYSfH2KlBaXfBVth7H SuFZ61P1UbdOwoHezpjkTF/IwFP8tTpVEWYlM97DimGmkbhiGcKBGpnNJL/WuAP9p/9MCM MQT1kOMO57Ha1rQh1KmxaP/7DMS2R2S/PBw1qUnEwIFkcOsRy61eoEbRD/MKeQ== Received: from smtp2.mailbox.org ([80.241.60.241]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id q8l3pfA_tjvK; Sun, 13 Sep 2020 14:30:40 +0200 (CEST) References: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> <20200913114019.58a6bda0@scratchpost.org> From: Brendan Tildesley Message-ID: <6c55ad27-6661-c84f-53ec-0baaa9c9ce91@brendan.scot> Date: Sun, 13 Sep 2020 22:30:50 +1000 MIME-Version: 1.0 In-Reply-To: <20200913114019.58a6bda0@scratchpost.org> Content-Type: multipart/alternative; boundary="------------04BF2234FA3FE86895F88359" Content-Language: en-US X-MBO-SPAM-Probability: X-Rspamd-Score: -5.24 / 15.00 / 15.00 X-Rspamd-Queue-Id: 49290274 X-Rspamd-UID: b38f96 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) This is a multi-part message in MIME format. --------------04BF2234FA3FE86895F88359 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit On 13/9/20 7:40 pm, Danny Milosavljevic wrote: > On Sun, 13 Sep 2020 15:39:15 +1000 > Brendan Tildesley wrote: > >> I'm attempting to fix a bug where wrap-program produces ..X-real-real >> files by mistakenly wrapping already wrapped files. I haven't fully >> tested these because it requires rebuilding everything which takes hours >> to days and core-updates is stuck on mesa now anyway. Perhaps I'll try >> testing on master. Also there may be other places where .X-real files >> are accidentally wrapped, which will now error. > But can't a thing be wrapped once for one reason and another time for another > reason and that should be fine? Yes, perhaps I should have explained that this is still possible and works fine. When a program is wrapped a second time, it will append to the existed wrapper, rather than creating a new file and moving the old one. repeated applications of wrap-program after the first one simply append. I'll illustrate how this can go wrong though: suppose we have /bin/foo and we we are in a repl and run: (wrap-program "/bin/foo" `("BAR" = ("baz")) => /bin/.foo-real doesn't exist so /bin/foo is moved to /bin/.foo-real, a new /bin/foo is created that is a wrapper that then launches /bin.foo-real. (wrap-program "/bin/foo" `("BAR" = ("baz")) => /bin/.foo-real exists so /bin/foo is assumed to already be a wrapper so variables are appended to /bin/foo. (wrap-program "/bin/foo" `("BAR" = ("baz")) => same thing again, variables are appended ; Now suppose we then run: (wrap-program "/bin/.foo-real" `("BAR" = ("baz")) => /bin/..foo-real-real doesn't exist, so /bin/.foo-real is moved to /bin/..foo-real-real and /bin/.foo-real is created again as another wrapper. This should never be done intentionally I think, but sometimes there is code that uses (find-files dir ".") to find binaries to wrap, and this is run after a previous existing wrap phase, so the both /bin/foo and /bin/.foo-real are wrapped again. Generally everything will continue working though despite all this though. You run this to find some of these double wrapped packages: find /gnu/ -maxdepth 4 -iname '.*-real-real' So I thought it best to error whenever this happens instead of allowing it. An example of this causing an issue is when Prafulla Giri posted a patch[0] to fix a bug with Calibre. Their code ought to be correct, but it resulted in double wrapping. I created my own patch by overwriting the python-build-systems wrap phase and duplicating some code. Andreas ended up accepting my patch instead. ... Actually I just realised Prafulla's patch could have been fixed in a much simpler way by adjusting the (find-files ...) bit and avoided duplication. ... Anyway, with these patches, Prafulla's patch would have caused an error and forced them to fix it, for example, by changing (find-files "." ".") to (find-files "." (lambda (file stat) (not (wrapper? file)))) or (find-files "." (lambda (file stat) (not (string-prefix "." (basename file)))) ---------- So, the main change here is making (wrap-program ".foo-real") an error. If you cannot think of a good reason why that should ever be run, I think its good to block it. bugs that can slip through easily and lurk in the background usually not causing problems are not good in my opinion. After that has been decided we need to ensure all build systems don't misuse wrap-program that way. I notice some build systems actually only pass 'regular files, others allow symlinks or any file. I'm not really sure what the exact find-files filter should be. [0] https://lists.gnu.org/archive/html/guix-patches/2020-09/msg00219.html --------------04BF2234FA3FE86895F88359 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 7bit
On 13/9/20 7:40 pm, Danny Milosavljevic wrote:
On Sun, 13 Sep 2020 15:39:15 +1000
Brendan Tildesley <mail@brendan.scot> wrote:

I'm attempting to fix a bug where wrap-program produces ..X-real-real 
files by mistakenly wrapping already wrapped files. I haven't fully 
tested these because it requires rebuilding everything which takes hours 
to days and core-updates is stuck on mesa now anyway. Perhaps I'll try 
testing on master. Also there may be other places where .X-real files 
are accidentally wrapped, which will now error.
But can't a thing be wrapped once for one reason and another time for another
reason and that should be fine?

Yes, perhaps I should have explained that this is still possible and works fine. When a program is wrapped a second time, it will append to the existed wrapper, rather than creating a new file and moving the old one. repeated applications of wrap-program after the first one simply append. I'll illustrate how this can go wrong though: suppose we have /bin/foo and we we are in a repl and run:

(wrap-program "/bin/foo" `("BAR" = ("baz")) => /bin/.foo-real doesn't exist so /bin/foo is moved to /bin/.foo-real, a new /bin/foo is created that is a wrapper that then launches /bin.foo-real.

(wrap-program "/bin/foo" `("BAR" = ("baz")) => /bin/.foo-real exists so /bin/foo is assumed to already be a wrapper so variables are appended to /bin/foo.

(wrap-program "/bin/foo" `("BAR" = ("baz")) => same thing again, variables are appended

; Now suppose we then run:

(wrap-program "/bin/.foo-real" `("BAR" = ("baz")) => /bin/..foo-real-real doesn't exist, so /bin/.foo-real is moved to /bin/..foo-real-real and /bin/.foo-real is created again as another wrapper.

This should never be done intentionally I think, but sometimes there is code that uses (find-files dir ".") to find binaries to wrap, and this is run after a previous existing wrap phase, so the both /bin/foo and /bin/.foo-real are wrapped again. Generally everything will continue working though despite all this though.

You run this to find some of these double wrapped packages:

find /gnu/ -maxdepth 4 -iname '.*-real-real'

So I thought it best to error whenever this happens instead of allowing it.

An example of this causing an issue is when Prafulla Giri posted a patch[0] to fix a bug with Calibre. Their code ought to be correct, but it resulted in double wrapping. I created my own patch by overwriting the python-build-systems wrap phase and duplicating some code. Andreas ended up accepting my patch instead.

... Actually I just realised Prafulla's patch could have been fixed in a much simpler way by adjusting the (find-files ...) bit and avoided duplication. ...

Anyway, with these patches, Prafulla's patch would have caused an error and forced them to fix it, for example, by changing

(find-files "." ".")

to

(find-files "." (lambda (file stat) (not (wrapper? file))))
or 
(find-files "." (lambda (file stat) (not (string-prefix "." (basename file))))

----------

So, the main change here is making (wrap-program ".foo-real") an error. If you cannot think of a good reason why that should ever be run, I think its good to block it. bugs that can slip through easily and lurk in the background usually not causing problems are not good in my opinion. After that has been decided we need to ensure all build systems don't misuse wrap-program that way. I notice some build systems actually only pass 'regular files, others allow symlinks or any file. I'm not really sure what the exact find-files filter should be.

[0] https://lists.gnu.org/archive/html/guix-patches/2020-09/msg00219.html


  


--------------04BF2234FA3FE86895F88359--




From unknown Tue Jun 17 03:39:58 2025
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
X-Loop: help-debbugs@gnu.org
From: help-debbugs@gnu.org (GNU bug Tracking System)
To: Brendan Tildesley 
Subject: bug#43367: closed (Re: bug#43367: [core-updates]: [PATCH 0/5]:
 Prevent wrap-progam from double-wrapping.)
Message-ID: 
References: <87im4e1yfa.fsf@gnu.org>
 <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot>
X-Gnu-PR-Message: they-closed 43367
X-Gnu-PR-Package: guix-patches
X-Gnu-PR-Keywords: patch
Reply-To: 43367@debbugs.gnu.org
Date: Thu, 22 Apr 2021 09:07:02 +0000
Content-Type: multipart/mixed; boundary="----------=_1619082422-14346-1"

This is a multi-part message in MIME format...

------------=_1619082422-14346-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

Your bug report

#43367: [core-updates]: [PATCH 0/5]: Prevent wrap-progam from double-wrappi=
ng.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 43367@debbugs.gnu.org.

--=20
43367: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D43367
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems

------------=_1619082422-14346-1
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 43367-done) by debbugs.gnu.org; 22 Apr 2021 09:06:12 +0000
Received: from localhost ([127.0.0.1]:60854 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from )
	id 1lZVHn-0003iG-TP
	for submit@debbugs.gnu.org; Thu, 22 Apr 2021 05:06:12 -0400
Received: from eggs.gnu.org ([209.51.188.92]:45100)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from ) id 1lZVHm-0003i2-QZ
 for 43367-done@debbugs.gnu.org; Thu, 22 Apr 2021 05:06:11 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e]:45868)
 by eggs.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from )
 id 1lZVHh-0004Q4-Bu; Thu, 22 Apr 2021 05:06:05 -0400
Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57444 helo=ribbon)
 by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256)
 (Exim 4.82) (envelope-from )
 id 1lZVHf-0001NU-37; Thu, 22 Apr 2021 05:06:03 -0400
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= 
To: Brendan Tildesley 
Subject: Re: bug#43367: [core-updates]: [PATCH 0/5]: Prevent wrap-progam
 from double-wrapping.
References: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot>
Date: Thu, 22 Apr 2021 11:06:01 +0200
In-Reply-To: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot> (Brendan
 Tildesley's message of "Sun, 13 Sep 2020 15:39:15 +1000")
Message-ID: <87im4e1yfa.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43367-done
Cc: 43367-done@debbugs.gnu.org
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: -3.3 (---)

Hi Brendan,

Brendan Tildesley  skribis:

> I'm attempting to fix a bug where wrap-program produces ..X-real-real
> files by mistakenly wrapping already wrapped files. I haven't fully=20
> tested these because it requires rebuilding everything which takes
> hours to days and core-updates is stuck on mesa now anyway. Perhaps
> I'll try testing on master. Also there may be other places where
> .X-real files are accidentally wrapped, which will now error.

The patch series LGTM and I=E2=80=99ve applied it on =E2=80=98core-updates=
=E2=80=99.  I=E2=80=99m
building things now and will push shortly if everything goes well.

Thank you and sorry for the loooong delay!

Ludo=E2=80=99.


------------=_1619082422-14346-1
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by debbugs.gnu.org; 13 Sep 2020 05:39:19 +0000
Received: from localhost ([127.0.0.1]:49331 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from )
	id 1kHKjP-0000jG-Ax
	for submit@debbugs.gnu.org; Sun, 13 Sep 2020 01:39:19 -0400
Received: from lists.gnu.org ([209.51.188.17]:56400)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from ) id 1kHKjN-0000j8-1p
 for submit@debbugs.gnu.org; Sun, 13 Sep 2020 01:39:17 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:57590)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from ) id 1kHKjM-0002qj-O3
 for guix-patches@gnu.org; Sun, 13 Sep 2020 01:39:16 -0400
Received: from mout-p-101.mailbox.org ([2001:67c:2050::465:101]:33964)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256)
 (Exim 4.90_1) (envelope-from ) id 1kHKjJ-00014e-LP
 for guix-patches@gnu.org; Sun, 13 Sep 2020 01:39:15 -0400
Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest
 SHA256) (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4BpywX2SL2zKmdk
 for ; Sun, 13 Sep 2020 07:39:08 +0200 (CEST)
X-Virus-Scanned: amavisd-new at heinlein-support.de
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brendan.scot;
 s=MBO0001; t=1599975546;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=2em40IVmbfEHVWi79TgETN7K0WHFJ5BZjilFTOfCeGc=;
 b=VCASaj/CTKTqmseGAIoikTfnaT1I0apjFuRq4gRy+Ok0at0w362EYsplG6aBTWjvMOBtui
 IBFwjzaYXM6NiGmnZf/7RIdMx9ukl0ZwufDHkn2jtmt19HvMNjhRQ0PdGh1kLPwaUZ/AUp
 OMuBPwK99aU/DLaKDx5XIGSXX8cRo86hJpUgzBYiNUNCPtpnHfTZyFX55Chx2/j2ypeIOQ
 KOeOuvquALv1cm6W3caJZCbwtObxg9AEv+tgTwJsjSO6o7R6YzW/cv3rcHbxXA05j2ZKLr
 MFoux157J+4cZmMxZpft9TjTcU+kg3JKl8ve3nsyxyjTBfYDjUeJYERaSSFzEw==
Received: from smtp2.mailbox.org ([80.241.60.241])
 by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de
 [80.241.56.125]) (amavisd-new, port 10030)
 with ESMTP id 5-z45EysO_Fb for ;
 Sun, 13 Sep 2020 07:39:05 +0200 (CEST)
To: guix-patches@gnu.org
From: Brendan Tildesley 
Subject: [core-updates]: [PATCH 0/5]: Prevent wrap-progam from double-wrapping.
Message-ID: <83311dc4-6e9b-e70b-e379-9993bfcd0554@brendan.scot>
Date: Sun, 13 Sep 2020 15:39:15 +1000
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Language: en-US
X-MBO-SPAM-Probability: 
X-Rspamd-Score: -3.36 / 15.00 / 15.00
X-Rspamd-Queue-Id: 593BF26E
X-Rspamd-UID: 6838be
Received-SPF: pass client-ip=2001:67c:2050::465:101;
 envelope-from=mail@brendan.scot; helo=mout-p-101.mailbox.org
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: 
List-Unsubscribe: , 
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: , 
 
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" 
X-Spam-Score: -2.6 (--)

I'm attempting to fix a bug where wrap-program produces ..X-real-real 
files by mistakenly wrapping already wrapped files. I haven't fully 
tested these because it requires rebuilding everything which takes hours 
to days and core-updates is stuck on mesa now anyway. Perhaps I'll try 
testing on master. Also there may be other places where .X-real files 
are accidentally wrapped, which will now error.




------------=_1619082422-14346-1--