From unknown Mon Aug 18 21:16:59 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68423] [PATCH] guix: go-build-system: use trimpath go flag Resent-From: Ekaitz Zarraga Original-Sender: "Debbugs-submit" Resent-CC: cox.katherine.e+guix@gmail.com, sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Sat, 13 Jan 2024 11:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68423 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68423@debbugs.gnu.org Cc: Picnoir , Ekaitz Zarraga , Katherine Cox-Buday , Sharlatan Hellseher X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Katherine Cox-Buday , Sharlatan Hellseher Received: via spool by submit@debbugs.gnu.org id=B.17051464469243 (code B ref -1); Sat, 13 Jan 2024 11:48:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Jan 2024 11:47:26 +0000 Received: from localhost ([127.0.0.1]:38627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOcU1-0002P0-QB for submit@debbugs.gnu.org; Sat, 13 Jan 2024 06:47:26 -0500 Received: from lists.gnu.org ([2001:470:142::17]:43402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOcTy-0002Ok-6J for submit@debbugs.gnu.org; Sat, 13 Jan 2024 06:47:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOcTs-0000h1-Ir for guix-patches@gnu.org; Sat, 13 Jan 2024 06:47:17 -0500 Received: from dane.soverin.net ([2a10:de80:1:4091:b9e9:2218:0:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rOcTo-0004Bn-JY for guix-patches@gnu.org; Sat, 13 Jan 2024 06:47:16 -0500 Received: from smtp.soverin.net (unknown [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4TBxTQ2rykzyRc; Sat, 13 Jan 2024 11:47:06 +0000 (UTC) Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.100]) by soverin.net (Postfix) with ESMTPSA id 4TBxTP3R0WzF1; Sat, 13 Jan 2024 11:47:05 +0000 (UTC) Authentication-Results: smtp.soverin.net; dkim=pass (2048-bit key; unprotected) header.d=elenq.tech header.i=@elenq.tech header.a=rsa-sha256 header.s=soverin1 header.b=n9wUX3Vw; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=soverin1; t=1705146425; 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: content-transfer-encoding:content-transfer-encoding; bh=tt7HZDrRxfiyAGQDqr74yxqzqHIxcVF3/3ermHAf8Wc=; b=n9wUX3Vwfwp7OGNYyibpdgHuuWACX65qBEgYZFXSgSVdQEwmCx+deUeDeYq2AjkAHbbW4a xA0YE7TtJNXmaQ4gDakTIDysJTdBWlejMdrEqjCnnQe6g+ROvmy4NEcjgX7Qmz/ZMWub7B hd+RiLmTssX+lrga+PJu5E9jQIAa9wIqicXwZXKyXCq2rUzB7MI2C+KpP8X5ZWeUcPibeW d7cJt/HuM/j5MtYesHiIk4oD6VuUqFHZh8rCAh/lTMBZ3okM+AD8pGmef0YvdlmYmrdsR9 uP8jPDu901y7CPOe9e15GZkq30W2vsa0I27qpCAW6O81limayW2lpAzCAosSIw== From: Ekaitz Zarraga Date: Sat, 13 Jan 2024 12:46:15 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a10:de80:1:4091:b9e9:2218:0:1; envelope-from=ekaitz@elenq.tech; helo=dane.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) 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: -0.0 (/) Go 1.13 introduced[1] a new "trimpath" flag in charge of removing the references to the go toolchain in the produced ELFs. We used to remove these references using the "remove-go-reference" function. This function was executed after go install. By using this new trimpath flag, we don't have to remove any store path from the ELFs produced by go install. We're not using any go older than 1.13 anymore, it's safe to remove these functions. [1] https://go.dev/doc/go1.13 -trimpath remove all file system paths from the resulting executable. Instead of absolute file system paths, the recorded file names will begin either a module path@version (when using modules), or a plain import path (when using the standard library, or GOPATH). * guix/build/go-build-system.scm (build): Add -trimpath (%standard-phases): Remove remove-go-references. (remove-go-references): Remove. Change-Id: Idcae366d226da5ce095693f81fd33133fd1d70d6 Co-authored-by: Picnoir --- guix/build/go-build-system.scm | 59 +++------------------------------- 1 file changed, 4 insertions(+), 55 deletions(-) diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index 7f25e05d0d..70ddcd07cd 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -6,6 +6,8 @@ ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020, 2021 Efraim Flashner ;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2024 Ekaitz Zarraga +;;; Copyright © 2024 Picnoir ;;; ;;; This file is part of GNU Guix. ;;; @@ -90,7 +92,6 @@ (define-module (guix build go-build-system) ;; * Use Go modules [4] ;; * Re-use compiled packages [5] ;; * Avoid the go-inputs hack -;; * Stop needing remove-go-references (-trimpath ? ) ;; * Remove module packages, only offering the full Git repos? This is ;; more idiomatic, I think, because Go downloads Git repos, not modules. ;; What are the trade-offs? @@ -265,6 +266,7 @@ (define* (build #:key import-path build-flags #:allow-other-keys) ;; Respectively, strip the symbol table and debug ;; information, and the DWARF symbol table. "-ldflags=-s -w" + "-trimpath" `(,@build-flags ,import-path))) (lambda (key . args) (display (string-append "Building '" import-path "' failed.\n" @@ -304,58 +306,6 @@ (define* (install-license-files #:key unpack-path unpack-path)) (apply (assoc-ref gnu:%standard-phases 'install-license-files) args))) -(define* (remove-store-reference file file-name - #:optional (store (%store-directory))) - "Remove from FILE occurrences of FILE-NAME in STORE; return #t when FILE-NAME -is encountered in FILE, #f otherwise. This implementation reads FILE one byte at -a time, which is slow. Instead, we should use the Boyer-Moore string search -algorithm; there is an example in (guix build grafts)." - (define pattern - (string-take file-name - (+ 34 (string-length (%store-directory))))) - - (with-fluids ((%default-port-encoding #f)) - (with-atomic-file-replacement file - (lambda (in out) - ;; We cannot use `regexp-exec' here because it cannot deal with - ;; strings containing NUL characters. - (format #t "removing references to `~a' from `~a'...~%" file-name file) - (setvbuf in 'block 65536) - (setvbuf out 'block 65536) - (fold-port-matches (lambda (match result) - (put-bytevector out (string->utf8 store)) - (put-u8 out (char->integer #\/)) - (put-bytevector out - (string->utf8 - "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-")) - #t) - #f - pattern - in - (lambda (char result) - (put-u8 out (char->integer char)) - result)))))) - -(define* (remove-go-references #:key allow-go-reference? - inputs outputs #:allow-other-keys) - "Remove any references to the Go compiler from the compiled Go executable -files in OUTPUTS." -;; We remove this spurious reference to save bandwidth when installing Go -;; executables. It would be better to not embed the reference in the first -;; place, but I'm not sure how to do that. The subject was discussed at: -;; - (if allow-go-reference? - #t - (let ((go (assoc-ref inputs "go")) - (bin "/bin")) - (for-each (lambda (output) - (when (file-exists? (string-append (cdr output) - bin)) - (for-each (lambda (file) - (remove-store-reference file go)) - (find-files (string-append (cdr output) bin))))) - outputs) - #t))) (define %standard-phases (modify-phases gnu:%standard-phases @@ -367,8 +317,7 @@ (define %standard-phases (replace 'build build) (replace 'check check) (replace 'install install) - (replace 'install-license-files install-license-files) - (add-after 'install 'remove-go-references remove-go-references))) + (replace 'install-license-files install-license-files))) (define* (go-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) base-commit: c0b303aaa3d6154acbe054120d11467eb98e6d33 -- 2.41.0 From unknown Mon Aug 18 21:16:59 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68423] [PATCH] guix: go-build-system: use trimpath go flag Resent-From: Sharlatan Hellseher Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 13 Jan 2024 12:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68423 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ekaitz Zarraga Cc: 68423@debbugs.gnu.org, Picnoir , Katherine Cox-Buday Received: via spool by 68423-submit@debbugs.gnu.org id=B68423.170515073526724 (code B ref 68423); Sat, 13 Jan 2024 12:59:01 +0000 Received: (at 68423) by debbugs.gnu.org; 13 Jan 2024 12:58:55 +0000 Received: from localhost ([127.0.0.1]:38701 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOdbC-0006wx-9v for submit@debbugs.gnu.org; Sat, 13 Jan 2024 07:58:55 -0500 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:50561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOdb9-0006wh-Ko for 68423@debbugs.gnu.org; Sat, 13 Jan 2024 07:58:53 -0500 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-50e7ddd999bso8109889e87.1 for <68423@debbugs.gnu.org>; Sat, 13 Jan 2024 04:58:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705150727; x=1705755527; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wN7tMhPg1MZbzuUTKaKkgpAe3Vv82+sFWbdqoxHhp9M=; b=JSkL0kXzGxd8EcrSE2tdYR2IjvXOhI7mDiL3bWGcr4ecG0RfX4HLFyusBshlVZjPFI ajCb7sJUa16KHjCckoKOB7xQptD5CMvexUxyP7WslJ+YsibIhsgxZsuqwZ4WR5xdYAkQ wqzzkliaLhC04Roft8x1cHBN3NiL33CmhPb+KGBsFf3K4OQvCxagpzL8QKlhGy2TodY2 ULn//4OdDIWniFe0rwsdsaJ0ctxaP/0mVPtcEhM5dYzZfe5WcMoQH97wDeFb1WGK/NgI j4o5dUwzRiRL3WPinLjQBGdnhZ+BxrEsfoNWwXaqnhKMjKE4ZrsGE+pG/GsCihiR+8l3 KldQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705150727; x=1705755527; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wN7tMhPg1MZbzuUTKaKkgpAe3Vv82+sFWbdqoxHhp9M=; b=u1gTQy068K3+6uaMQxWxSXSg+MKefnn/TQmbMk8VoXYSJmv+25gqlTWdJgKdmyYWyk iadugsrFtIizyiob+qFDTL+9daRBCimqawFmza11pKbFkpEOhmfjtRxhQkn5kO4vQFXq HBLF/GCmUTlqjtUmxfmcgtDC7sncBeBzr5Ln65NS3e95SElWzkmEIZrHLy+hWYWScXV3 qA15xiCvvqeHAxtvujMEjkPYL+Hq7H4XGd2UDR3hL9PvEGRo38VrupxOhksrs1MSsC4S SJrtC0ytzbjQrdv8sYtNTOtJsERx78TEN5lXqrEf6x7CMxO12hAgEMwuqkE1jWT89IAW HLww== X-Gm-Message-State: AOJu0Yz/gecnrsMS581PbxzJ3TNbdYzaxoxYcdJSjtTaIDFBmS++phO8 KG/ZEptm7nqhO6goIgMHz1z9gD2Gl1mrFcoWDBw= X-Google-Smtp-Source: AGHT+IFFV1/NsctKc5sSG5jk0uuWkc21Vlzk4pvCWmInSF/fBDiOryg5M4sAj4AbIf9iFkw4wD30Xkpm91x0lJ5dcfI= X-Received: by 2002:ac2:548e:0:b0:50e:59cf:e548 with SMTP id t14-20020ac2548e000000b0050e59cfe548mr1129685lfk.94.1705150726603; Sat, 13 Jan 2024 04:58:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Sharlatan Hellseher Date: Sat, 13 Jan 2024 12:58:34 +0000 Message-ID: Content-Type: multipart/alternative; boundary="0000000000005907cc060ed357b1" X-Spam-Score: -0.0 (/) 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.0 (-) --0000000000005907cc060ed357b1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Ekaitz, Thanks for the patch. I think this is more suitable for core updates brunch as triggers rebuild the world for all golang packages as far as I see. Regards, Oleg On Sat, 13 Jan 2024, 11:48 Ekaitz Zarraga, wrote: > Go 1.13 introduced[1] a new "trimpath" flag in charge of removing the > references to the go toolchain in the produced ELFs. We used to remove > these references using the "remove-go-reference" function. This function > was executed after go install. By using this new trimpath flag, we don't > have to remove any store path from the ELFs produced by go install. > > We're not using any go older than 1.13 anymore, it's safe to remove > these functions. > > [1] https://go.dev/doc/go1.13 > > -trimpath > remove all file system paths from the resulting executable. > Instead of absolute file system paths, the recorded file names > will begin either a module path@version (when using modules), > or a plain import path (when using the standard library, or > GOPATH). > > * guix/build/go-build-system.scm (build): Add -trimpath > (%standard-phases): Remove remove-go-references. > (remove-go-references): Remove. > > Change-Id: Idcae366d226da5ce095693f81fd33133fd1d70d6 > Co-authored-by: Picnoir > --- > guix/build/go-build-system.scm | 59 +++------------------------------- > 1 file changed, 4 insertions(+), 55 deletions(-) > > diff --git a/guix/build/go-build-system.scm > b/guix/build/go-build-system.scm > index 7f25e05d0d..70ddcd07cd 100644 > --- a/guix/build/go-build-system.scm > +++ b/guix/build/go-build-system.scm > @@ -6,6 +6,8 @@ > ;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka > ;;; Copyright =C2=A9 2020, 2021 Efraim Flashner > ;;; Copyright =C2=A9 2021 Sarah Morgensen > +;;; Copyright =C2=A9 2024 Ekaitz Zarraga > +;;; Copyright =C2=A9 2024 Picnoir > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -90,7 +92,6 @@ (define-module (guix build go-build-system) > ;; * Use Go modules [4] > ;; * Re-use compiled packages [5] > ;; * Avoid the go-inputs hack > -;; * Stop needing remove-go-references (-trimpath ? ) > ;; * Remove module packages, only offering the full Git repos? This is > ;; more idiomatic, I think, because Go downloads Git repos, not modules. > ;; What are the trade-offs? > @@ -265,6 +266,7 @@ (define* (build #:key import-path build-flags > #:allow-other-keys) > ;; Respectively, strip the symbol table and debug > ;; information, and the DWARF symbol table. > "-ldflags=3D-s -w" > + "-trimpath" > `(,@build-flags ,import-path))) > (lambda (key . args) > (display (string-append "Building '" import-path "' failed.\n" > @@ -304,58 +306,6 @@ (define* (install-license-files #:key unpack-path > unpack-path)) > (apply (assoc-ref gnu:%standard-phases 'install-license-files) args)= )) > > -(define* (remove-store-reference file file-name > - #:optional (store (%store-directory))) > - "Remove from FILE occurrences of FILE-NAME in STORE; return #t when > FILE-NAME > -is encountered in FILE, #f otherwise. This implementation reads FILE one > byte at > -a time, which is slow. Instead, we should use the Boyer-Moore string > search > -algorithm; there is an example in (guix build grafts)." > - (define pattern > - (string-take file-name > - (+ 34 (string-length (%store-directory))))) > - > - (with-fluids ((%default-port-encoding #f)) > - (with-atomic-file-replacement file > - (lambda (in out) > - ;; We cannot use `regexp-exec' here because it cannot deal with > - ;; strings containing NUL characters. > - (format #t "removing references to `~a' from `~a'...~%" file-nam= e > file) > - (setvbuf in 'block 65536) > - (setvbuf out 'block 65536) > - (fold-port-matches (lambda (match result) > - (put-bytevector out (string->utf8 store)) > - (put-u8 out (char->integer #\/)) > - (put-bytevector out > - (string->utf8 > - > "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-")) > - #t) > - #f > - pattern > - in > - (lambda (char result) > - (put-u8 out (char->integer char)) > - result)))))) > - > -(define* (remove-go-references #:key allow-go-reference? > - inputs outputs #:allow-other-keys) > - "Remove any references to the Go compiler from the compiled Go > executable > -files in OUTPUTS." > -;; We remove this spurious reference to save bandwidth when installing G= o > -;; executables. It would be better to not embed the reference in the fir= st > -;; place, but I'm not sure how to do that. The subject was discussed at: > -;; > - (if allow-go-reference? > - #t > - (let ((go (assoc-ref inputs "go")) > - (bin "/bin")) > - (for-each (lambda (output) > - (when (file-exists? (string-append (cdr output) > - bin)) > - (for-each (lambda (file) > - (remove-store-reference file go)) > - (find-files (string-append (cdr output) > bin))))) > - outputs) > - #t))) > > (define %standard-phases > (modify-phases gnu:%standard-phases > @@ -367,8 +317,7 @@ (define %standard-phases > (replace 'build build) > (replace 'check check) > (replace 'install install) > - (replace 'install-license-files install-license-files) > - (add-after 'install 'remove-go-references remove-go-references))) > + (replace 'install-license-files install-license-files))) > > (define* (go-build #:key inputs (phases %standard-phases) > #:allow-other-keys #:rest args) > > base-commit: c0b303aaa3d6154acbe054120d11467eb98e6d33 > -- > 2.41.0 > > > > --0000000000005907cc060ed357b1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Ekaitz,

T= hanks for the patch.

I t= hink this is more suitable for core updates brunch as triggers rebuild the = world for all golang packages as far as I see.

<= /div>
Regards,
Oleg

=
On Sat, 13= Jan 2024, 11:48 Ekaitz Zarraga, <ekaitz@elenq.tech> wrote:
=
Go 1.13 introduced[1] a new "trimpath&q= uot; flag in charge of removing the
references to the go toolchain in the produced ELFs. We used to remove
these references using the "remove-go-reference" function. This f= unction
was executed after go install. By using this new trimpath flag, we don'= t
have to remove any store path from the ELFs produced by go install.

We're not using any go older than 1.13 anymore, it's safe to remove=
these functions.

[1] https://go.dev/doc/go1.13

=C2=A0 =C2=A0 -trimpath
=C2=A0 =C2=A0 =C2=A0 =C2=A0 remove all file system paths from the resulting= executable.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Instead of absolute file system paths, the reco= rded file names
=C2=A0 =C2=A0 =C2=A0 =C2=A0 will begin either a module path@version (when u= sing modules),
=C2=A0 =C2=A0 =C2=A0 =C2=A0 or a plain import path (when using the standard= library, or
=C2=A0 =C2=A0 =C2=A0 =C2=A0 GOPATH).

* guix/build/go-build-system.scm (build): Add -trimpath
(%standard-phases): Remove remove-go-references.
(remove-go-references): Remove.

Change-Id: Idcae366d226da5ce095693f81fd33133fd1d70d6
Co-authored-by: Picnoir <picnoir@alternativebit.fr>
---
=C2=A0guix/build/go-build-system.scm | 59 +++------------------------------= -
=C2=A01 file changed, 4 insertions(+), 55 deletions(-)

diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.sc= m
index 7f25e05d0d..70ddcd07cd 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -6,6 +6,8 @@
=C2=A0;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka <kuba@kadziolk= a.net>
=C2=A0;;; Copyright =C2=A9 2020, 2021 Efraim Flashner <efraim@flashne= r.co.il>
=C2=A0;;; Copyright =C2=A9 2021 Sarah Morgensen <iskarian@mgsn.dev>= ;
+;;; Copyright =C2=A9 2024 Ekaitz Zarraga <ekaitz@elenq.tech>
+;;; Copyright =C2=A9 2024 Picnoir <picnoir@alternativebit.fr= >
=C2=A0;;;
=C2=A0;;; This file is part of GNU Guix.
=C2=A0;;;
@@ -90,7 +92,6 @@ (define-module (guix build go-build-system)
=C2=A0;; * Use Go modules [4]
=C2=A0;; * Re-use compiled packages [5]
=C2=A0;; * Avoid the go-inputs hack
-;; * Stop needing remove-go-references (-trimpath ? )
=C2=A0;; * Remove module packages, only offering the full Git repos? This i= s
=C2=A0;; more idiomatic, I think, because Go downloads Git repos, not modul= es.
=C2=A0;; What are the trade-offs?
@@ -265,6 +266,7 @@ (define* (build #:key import-path build-flags #:allow-o= ther-keys)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; Respectively, str= ip the symbol table and debug
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; information, and = the DWARF symbol table.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"-ldflags=3D-s = -w"
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "-trimpath"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0`(,@build-flags ,imp= ort-path)))
=C2=A0 =C2=A0 =C2=A0(lambda (key . args)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(display (string-append "Building '&quo= t; import-path "' failed.\n"
@@ -304,58 +306,6 @@ (define* (install-license-files #:key unpack-path
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0unpack-path))
=C2=A0 =C2=A0 =C2=A0(apply (assoc-ref gnu:%standard-phases 'install-lic= ense-files) args)))

-(define* (remove-store-reference file file-name
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 #:optional (store (%store-dir= ectory)))
-=C2=A0 "Remove from FILE occurrences of FILE-NAME in STORE; return #t= when FILE-NAME
-is encountered in FILE, #f otherwise. This implementation reads FILE one b= yte at
-a time, which is slow. Instead, we should use the Boyer-Moore string searc= h
-algorithm; there is an example in (guix build grafts)."
-=C2=A0 (define pattern
-=C2=A0 =C2=A0 (string-take file-name
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(+ 34 (strin= g-length (%store-directory)))))
-
-=C2=A0 (with-fluids ((%default-port-encoding #f))
-=C2=A0 =C2=A0 (with-atomic-file-replacement file
-=C2=A0 =C2=A0 =C2=A0 (lambda (in out)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; We cannot use `regexp-exec' here becaus= e it cannot deal with
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; strings containing NUL characters.
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 (format #t "removing references to `~a= 9; from `~a'...~%" file-name file)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setvbuf in 'block 65536)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 (setvbuf out 'block 65536)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 (fold-port-matches (lambda (match result)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(put-bytevector out (string->utf8 store))=
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(put-u8 out (char->integer #\/))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(put-bytevector out
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(string->utf8
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-"))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0#t)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0#f
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0pattern
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0in
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0(lambda (char result)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(put-u8 out (char->integer char))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0result))))))
-
-(define* (remove-go-references #:key allow-go-reference?
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0inputs outputs #:allow-other-keys) -=C2=A0 "Remove any references to the Go compiler from the compiled Go= executable
-files in OUTPUTS."
-;; We remove this spurious reference to save bandwidth when installing Go<= br> -;; executables. It would be better to not embed the reference in the first=
-;; place, but I'm not sure how to do that. The subject was discussed a= t:
-;; <https://lists.= gnu.org/archive/html/guix-devel/2017-10/msg00207.html>
-=C2=A0 (if allow-go-reference?
-=C2=A0 =C2=A0 #t
-=C2=A0 =C2=A0 (let ((go (assoc-ref inputs "go"))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (bin "/bin"))
-=C2=A0 =C2=A0 =C2=A0 (for-each (lambda (output)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when (file= -exists? (string-append (cdr output)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0bin))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (for= -each (lambda (file)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (remove-store-reference file go)) -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (find-files (string-append (cdr output) bin= )))))
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 outputs)
-=C2=A0 =C2=A0 =C2=A0 #t)))

=C2=A0(define %standard-phases
=C2=A0 =C2=A0(modify-phases gnu:%standard-phases
@@ -367,8 +317,7 @@ (define %standard-phases
=C2=A0 =C2=A0 =C2=A0(replace 'build build)
=C2=A0 =C2=A0 =C2=A0(replace 'check check)
=C2=A0 =C2=A0 =C2=A0(replace 'install install)
-=C2=A0 =C2=A0 (replace 'install-license-files install-license-files) -=C2=A0 =C2=A0 (add-after 'install 'remove-go-references remove-go-= references)))
+=C2=A0 =C2=A0 (replace 'install-license-files install-license-files)))=

=C2=A0(define* (go-build #:key inputs (phases %standard-phases)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0#:allow-other-keys #:rest args)

base-commit: c0b303aaa3d6154acbe054120d11467eb98e6d33
--
2.41.0



--0000000000005907cc060ed357b1-- From unknown Mon Aug 18 21:16:59 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68423] [PATCH] guix: go-build-system: use trimpath go flag Resent-From: Ekaitz Zarraga Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 13 Jan 2024 13:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68423 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sharlatan Hellseher Cc: 68423@debbugs.gnu.org, Picnoir , Katherine Cox-Buday Received: via spool by 68423-submit@debbugs.gnu.org id=B68423.170515270928531 (code B ref 68423); Sat, 13 Jan 2024 13:32:01 +0000 Received: (at 68423) by debbugs.gnu.org; 13 Jan 2024 13:31:49 +0000 Received: from localhost ([127.0.0.1]:38741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOe73-0007Ps-3o for submit@debbugs.gnu.org; Sat, 13 Jan 2024 08:31:49 -0500 Received: from dane.soverin.net ([185.233.34.158]:36603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOe71-0007Kg-DJ for 68423@debbugs.gnu.org; Sat, 13 Jan 2024 08:31:48 -0500 Received: from smtp.soverin.net (unknown [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4TBzp62kYRzyWT; Sat, 13 Jan 2024 13:31:42 +0000 (UTC) Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.99]) by soverin.net (Postfix) with ESMTPSA id 4TBzp55JNjz44; Sat, 13 Jan 2024 13:31:41 +0000 (UTC) Authentication-Results: smtp.soverin.net; dkim=pass (2048-bit key; unprotected) header.d=elenq.tech header.i=@elenq.tech header.a=rsa-sha256 header.s=soverin1 header.b=EVdOv4nN; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=soverin1; t=1705152702; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=Cu+5C7sI5zd2+ELUNfj7rRXt2Ra/B04EzJr7Cm49E2I=; b=EVdOv4nNccv5JLP4JTw7xI4yq4RYXr6fafsK7+IIFlS7FaPs3VkWaqefCFzvgKn0CrHgG/ N0tM/qS3A0pvTtIjteVjcfYyC37H7obnQF80Jya2Ql71+uBcalxG1wu74cmbLE0Vn4roVL PGKipMfVs4tkROnlLlT63pKSC4zjApKL4zC77CnMdKMlk9l2asqM+qjsE46zXYSbyXgsD4 P1mbVGkrE8Ng6ere649bXdLgTZkKfjz7vfsDWKteam8QXwn53jMLtM+2D5JxJSyHgqZfkq 4E/pQJP5NzzFrDY3zGIJRkmVEMmSD4DzAyXszce8nOLiK8meRWpZjegryBtNZw== Message-ID: <5171475c-288e-24c2-a91c-94ee9b7627af@elenq.tech> Date: Sat, 13 Jan 2024 14:31:39 +0100 MIME-Version: 1.0 References: Content-Language: en-US, es-ES, eu From: Ekaitz Zarraga Autocrypt: addr=ekaitz@elenq.tech; keydata= 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 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 (-) Hi, On 2024-01-13 13:58, Sharlatan Hellseher wrote: > Hi Ekaitz, > > Thanks for the patch. > > I think this is more suitable for core updates brunch as triggers > rebuild the world for all golang packages as far as I see. Yeah, probably. We also thought after the patch that would be interesting to provide a way to disable this behavior. Or maybe it's ok? With the previous alternative the packager would just remove the phase, but hardcoding the option as we did doesn't provide any way to do that... Some kind of flag should be enough. Are you ok with the patch, thought? If this is ok we'll make those small changes and send a v2. Thanks From unknown Mon Aug 18 21:16:59 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#68423] [PATCH] guix: go-build-system: use trimpath go flag Resent-From: Sharlatan Hellseher Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Jan 2024 20:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68423 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ekaitz Zarraga Cc: 68423@debbugs.gnu.org, Picnoir , Katherine Cox-Buday Received: via spool by 68423-submit@debbugs.gnu.org id=B68423.17060421157173 (code B ref 68423); Tue, 23 Jan 2024 20:36:02 +0000 Received: (at 68423) by debbugs.gnu.org; 23 Jan 2024 20:35:15 +0000 Received: from localhost ([127.0.0.1]:44040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSNUI-0001rb-Vm for submit@debbugs.gnu.org; Tue, 23 Jan 2024 15:35:15 -0500 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:42385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rSNUH-0001rM-DC for 68423@debbugs.gnu.org; Tue, 23 Jan 2024 15:35:14 -0500 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-5100c2f7a16so712608e87.1 for <68423@debbugs.gnu.org>; Tue, 23 Jan 2024 12:35:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706042102; x=1706646902; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oTUfifj2VzPBpK94efv3w70Dg5OnjTpA9MaU//Z8pBM=; b=OdyT2cH0EC80pHei15Dovwqlzl+TS43lajvfQVTA5ijpkrIYHkVJO0+wD8ReYVT1xS +AYQuaBqxgnAw7TRsoyOvw2xnFYGEZEUWJiJCVWcm3iChrduxg1iknIT9cyg5JgUU4th xhPyfMoXi9fn5rLGimEcdf5NyS2IwDpOcpzwmOlZW3thgP7JEv7Mb8J+UigBLbJUDmsI YbAjkfhDCeIVXE8CjBIbrEV+Vw/4ov/kwrQE8GUs4Pnog9iBS4ze+5/FoGh3GSkmteeE JLkZ91i3arR8DVsoJhEAHogRtCGk/zU7JzOlA1aEK8jO/3QaM0xuOccqHUre7r5I6nkW 37TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706042102; x=1706646902; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oTUfifj2VzPBpK94efv3w70Dg5OnjTpA9MaU//Z8pBM=; b=ZuRU16/QFbBKuiajEA4/4yDWvhIo1sgVsa5EGSl6tq2uIYxud3IwywDcbm/0/FYKjF YAWLMLOtvETgynTKjQUpByETTMcV1uuuwzFQsTUv+jXqPakwZT1OGGi5/ZfpKVfDSMLb YkBG4evyUoD9eu9Zcwy5SwaDnAMWj0RhBl27467gDSrujMkPUlogdxHvp2UQXNXFvEWC rJrQcq4a2BSTXECtLrYzw+4+4kLCil1vdeXzVIscyMFrgYRCc0OnYZ4On/nKG/gdoTRV yggxGpXx3oT9TnoDUL70tK1us0S+kzcj3RzBEGoD13wDAick/hB+r7qh7q86Y05oXGLS UhYA== X-Gm-Message-State: AOJu0YyJQKXWorYG1Zcd8N6jBH7FzgN/+bqUhJtQ1bVrEhqTU1cFvmCZ Iq/Iq7RKIi+D54TgKGSeRP/sYrn/yFbH9MWiuzsR9oaKHLHcmnc7SdalPnfX3ITFIK2wxO/ywQb AOS2mep2OwQ4z65Eh/FfCUZ4MzdI= X-Google-Smtp-Source: AGHT+IEnP7cUGy4erhHOzXr9jXtJNjm1vw1jRKIY0Su55upaXP54mAzbfXBRr9dgVelb/NPpsrwep5SjjjDSSuk9vVw= X-Received: by 2002:a19:9103:0:b0:510:36c:d78c with SMTP id t3-20020a199103000000b00510036cd78cmr66336lfd.31.1706042102245; Tue, 23 Jan 2024 12:35:02 -0800 (PST) MIME-Version: 1.0 References: <5171475c-288e-24c2-a91c-94ee9b7627af@elenq.tech> In-Reply-To: <5171475c-288e-24c2-a91c-94ee9b7627af@elenq.tech> From: Sharlatan Hellseher Date: Tue, 23 Jan 2024 20:34:50 +0000 Message-ID: Content-Type: multipart/alternative; boundary="00000000000079ec06060fa2e144" X-Spam-Score: -0.0 (/) 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.0 (-) --00000000000079ec06060fa2e144 Content-Type: text/plain; charset="UTF-8" Hi Ekaitz, > With the previous alternative the packager would just remove > the phase, but hardcoding the option as we did doesn't provide > any way to do that... Some kind of flag should be enough. It would be great to have more control over golang build envars and build flags, like it happen in gnu-build-system or cmake-build-system via #:make-flags and #:configure-flags. Having some common defaults hardcoded and kind of #:build-flags as a way to path anything else to compiler. There is a similar thread referring go test flags, I've listed all in here: https://mail.gnu.org/archive/html/guix-devel/2024-01/msg00235.html Thanks, Oleg --00000000000079ec06060fa2e144 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Ekaitz,

<= div dir=3D"auto">
> With the previous alternative the p= ackager would just remove
> the phase, but hardco= ding the option as we did doesn't provide
> a= ny way to do that...=C2=A0 Some kind of flag should be enough.

It would be great to have more contr= ol over golang build envars
and build flags, like it= happen in gnu-build-system or cmake-build-system via #:make-flags and #:co= nfigure-flags.

Having so= me common defaults hardcoded and kind of #:build-flags as a way to path any= thing else to compiler.

= There is a similar thread referring go test flags, I've listed all in h= ere:=C2=A0https://mail.gnu.org/archive/html/guix-devel/2024-01/msg00235= .html

Thanks,
<= div dir=3D"auto">Oleg
--00000000000079ec06060fa2e144-- From unknown Mon Aug 18 21:16:59 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: Ekaitz Zarraga Subject: bug#68423: closed ([PATCH] guix: go-build-system: use trimpath go flag) Message-ID: References: <87h6hi44i5.fsf@gmail.com> X-Gnu-PR-Message: they-closed 68423 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 68423@debbugs.gnu.org Date: Thu, 07 Mar 2024 12:23:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1709814182-28313-1" This is a multi-part message in MIME format... ------------=_1709814182-28313-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #68423: [PATCH] guix: go-build-system: use trimpath go flag 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 68423@debbugs.gnu.org. --=20 68423: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D68423 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1709814182-28313-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 68423-done) by debbugs.gnu.org; 7 Mar 2024 12:22:58 +0000 Received: from localhost ([127.0.0.1]:52769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riCm1-0007MC-Lv for submit@debbugs.gnu.org; Thu, 07 Mar 2024 07:22:57 -0500 Received: from mail-wm1-f43.google.com ([209.85.128.43]:56654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1riCm0-0007Ls-G9 for 68423-done@debbugs.gnu.org; Thu, 07 Mar 2024 07:22:56 -0500 Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-41312880f8dso2774485e9.1 for <68423-done@debbugs.gnu.org>; Thu, 07 Mar 2024 04:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709814079; x=1710418879; darn=debbugs.gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=LHoOOkfvq7FvjA8nuV2GdGednWKsUCwRx95OVIaLHO4=; b=UZfWP8rgxO/R6b/W29pSyaMqL27DVO3orp+PuPNTf6WM1CYMnDabh5xurjQVhPxpvN gHFfiKrRn8lqQwzOlOedLseAZWMPIVjl3UPdxUSiTUupoP54bbA8VA/MOgamw5mtHqF+ AiwWrkOc+AGiYVP3JVBpqKRJYCqogPf7N79QPBs4ju3cfeBN+5YnPoUOn602p+Fi081Q j+fcuKD8r7dLzlvqhH1U+5H6fG9i9oAtpMLtCizoWmpnT5KpVTkme2noJ5i5DLIgIchQ lkHTCLQ46W1XIl813V4B7IcELxEnj/iXFYVf5J2Ye0viPhmBAV8vluk5RlKNAkf0JIF2 xcLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709814079; x=1710418879; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=LHoOOkfvq7FvjA8nuV2GdGednWKsUCwRx95OVIaLHO4=; b=DMHOqctUcSfxJJSOsy7z+b6EzDd7jOQEiey0L9L/98H4Vv+M0GKW87UepQ5z0uPxN/ kByDyIzbKlIwm+B02+oysU23WD6mV2ikWV0tzokSQOqzKbDpp+VuEJT9YqxRpDzkn2mx yvBPvVkODzWC5s55xtimThiwwgpF8HURQbgXhNuvEz7TaV6H2kIUXOZsTQc88JuKK75v 9zTdtDb6yJAD3CDsbAo4eYpvjNvkfn74JLekx+Oh8FfzkDfg24WqNEtkh2bZ4c0eJLtC zMNbYgf3VCZIaKDWOEBLmAK1nx0+yxyjNxYVhe7AUIiaXcPGm2h3enL3A293MX9yzzg0 F6nA== X-Gm-Message-State: AOJu0YyU66CRtW5Bu6YcCjD9Nnm3D7KZWayAEgIPfWbtkpMPno00oh5A nfX2gHxG9tCFUhMdjbWt/m8E3y1A5oaxqnDKT4tp/C8RjIfhfBkpHWgvyhz1lqfKYw== X-Google-Smtp-Source: AGHT+IHQlt5/TvPxHMMXra1UEW31i36vQ9NNTqqIS5NEXEjMSfMY6eZwZUWmwn4lwSeKOiGje+tTfA== X-Received: by 2002:a05:600c:c14:b0:412:f5e9:3f6 with SMTP id fm20-20020a05600c0c1400b00412f5e903f6mr3055586wmb.21.1709814079151; Thu, 07 Mar 2024 04:21:19 -0800 (PST) Received: from guxtil (cpc100856-bagu15-2-0-cust368.1-3.cable.virginm.net. [82.25.93.113]) by smtp.gmail.com with ESMTPSA id er15-20020a05600c84cf00b00412ff07df2bsm2440583wmb.37.2024.03.07.04.21.18 for <68423-done@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 04:21:18 -0800 (PST) From: Sharlatan Hellseher To: 68423-done@debbugs.gnu.org Subject: [PATCH] guix: go-build-system: use trimpath go flag Date: Thu, 07 Mar 2024 12:21:06 +0000 Message-ID: <87h6hi44i5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 68423-done 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.0 (-) --=-=-= Content-Type: text/plain Pushed as 998588599aa46e384b664ec576ab124b83fc16bd to go-team. -- Oleg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmXpsTIACgkQdtcnv/Ys 0rUhpw/+O7E0MoY0m/HN5CLovWECCwm3DIBb0ps51B+aoVt4avWeh9ZGM9UtUHO2 m2/W31DaQTXWu8NmpWtyQRgbGnfn5gLF/uX1XRIZ8JTxEsmt1rA7iuky6XC4mvDq 1jaJXytYQtQS+5QWFJeAV7pefEPwy8X5MkvCwGhXY1qkSyHW8r0nhxJ1XhhOAHoP qd8pbhZ5osXf/hiZZJFEDrFFYM4vAYHCYnd8PWFg54TWRaSCHaONZ7XOXJfdR9nW PaCUXo/a0ANcoSdiFDADlOnHGIY5AONjmJ4eWsE3ZfyhOMiTJEfoMl7CCmloTt06 OSWqo+y5AuzTdpzERPjqFT5nPLgEsTHb0RR5h1+YAloDPoY7PbbCWuCQ6J6j0lD7 Ctt2wXGBjFEsEH/vDBUlMowwcrEKuyla/QLHiClsblF0bxF2+ImizZgK4XhvRP+0 H0z12fetRoPqOi7TG+fsQ1ZtJvpmiqJXgKGM0AxF/Ulws7YHCfvspsQOkASfaRxl d8oIa2fbOoewO+ee7lsojrCv6vkL50zhQ8tpqAQAn9qd/MhePKjU3UD6qfgiIShY My5GIehhkPrX8IrI6xM7LwkVl52qlbyljLDL2yVQqcwLk4ZhLCoeck0T9v27GHO3 Za96Gx3kA5bkvyREFeACNGDw0AWm3u2xa3jFHm4WfyC9I6S24Zc= =9UXM -----END PGP SIGNATURE----- --=-=-=-- ------------=_1709814182-28313-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 Jan 2024 11:47:26 +0000 Received: from localhost ([127.0.0.1]:38627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOcU1-0002P0-QB for submit@debbugs.gnu.org; Sat, 13 Jan 2024 06:47:26 -0500 Received: from lists.gnu.org ([2001:470:142::17]:43402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOcTy-0002Ok-6J for submit@debbugs.gnu.org; Sat, 13 Jan 2024 06:47:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOcTs-0000h1-Ir for guix-patches@gnu.org; Sat, 13 Jan 2024 06:47:17 -0500 Received: from dane.soverin.net ([2a10:de80:1:4091:b9e9:2218:0:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rOcTo-0004Bn-JY for guix-patches@gnu.org; Sat, 13 Jan 2024 06:47:16 -0500 Received: from smtp.soverin.net (unknown [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4TBxTQ2rykzyRc; Sat, 13 Jan 2024 11:47:06 +0000 (UTC) Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.100]) by soverin.net (Postfix) with ESMTPSA id 4TBxTP3R0WzF1; Sat, 13 Jan 2024 11:47:05 +0000 (UTC) Authentication-Results: smtp.soverin.net; dkim=pass (2048-bit key; unprotected) header.d=elenq.tech header.i=@elenq.tech header.a=rsa-sha256 header.s=soverin1 header.b=n9wUX3Vw; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=soverin1; t=1705146425; 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: content-transfer-encoding:content-transfer-encoding; bh=tt7HZDrRxfiyAGQDqr74yxqzqHIxcVF3/3ermHAf8Wc=; b=n9wUX3Vwfwp7OGNYyibpdgHuuWACX65qBEgYZFXSgSVdQEwmCx+deUeDeYq2AjkAHbbW4a xA0YE7TtJNXmaQ4gDakTIDysJTdBWlejMdrEqjCnnQe6g+ROvmy4NEcjgX7Qmz/ZMWub7B hd+RiLmTssX+lrga+PJu5E9jQIAa9wIqicXwZXKyXCq2rUzB7MI2C+KpP8X5ZWeUcPibeW d7cJt/HuM/j5MtYesHiIk4oD6VuUqFHZh8rCAh/lTMBZ3okM+AD8pGmef0YvdlmYmrdsR9 uP8jPDu901y7CPOe9e15GZkq30W2vsa0I27qpCAW6O81limayW2lpAzCAosSIw== From: Ekaitz Zarraga To: guix-patches@gnu.org Subject: [PATCH] guix: go-build-system: use trimpath go flag Date: Sat, 13 Jan 2024 12:46:15 +0100 Message-ID: MIME-Version: 1.0 X-Debbugs-Cc: Katherine Cox-Buday , Sharlatan Hellseher Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a10:de80:1:4091:b9e9:2218:0:1; envelope-from=ekaitz@elenq.tech; helo=dane.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: Picnoir , Ekaitz Zarraga 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: -0.0 (/) Go 1.13 introduced[1] a new "trimpath" flag in charge of removing the references to the go toolchain in the produced ELFs. We used to remove these references using the "remove-go-reference" function. This function was executed after go install. By using this new trimpath flag, we don't have to remove any store path from the ELFs produced by go install. We're not using any go older than 1.13 anymore, it's safe to remove these functions. [1] https://go.dev/doc/go1.13 -trimpath remove all file system paths from the resulting executable. Instead of absolute file system paths, the recorded file names will begin either a module path@version (when using modules), or a plain import path (when using the standard library, or GOPATH). * guix/build/go-build-system.scm (build): Add -trimpath (%standard-phases): Remove remove-go-references. (remove-go-references): Remove. Change-Id: Idcae366d226da5ce095693f81fd33133fd1d70d6 Co-authored-by: Picnoir --- guix/build/go-build-system.scm | 59 +++------------------------------- 1 file changed, 4 insertions(+), 55 deletions(-) diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index 7f25e05d0d..70ddcd07cd 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -6,6 +6,8 @@ ;;; Copyright © 2020 Jakub Kądziołka ;;; Copyright © 2020, 2021 Efraim Flashner ;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2024 Ekaitz Zarraga +;;; Copyright © 2024 Picnoir ;;; ;;; This file is part of GNU Guix. ;;; @@ -90,7 +92,6 @@ (define-module (guix build go-build-system) ;; * Use Go modules [4] ;; * Re-use compiled packages [5] ;; * Avoid the go-inputs hack -;; * Stop needing remove-go-references (-trimpath ? ) ;; * Remove module packages, only offering the full Git repos? This is ;; more idiomatic, I think, because Go downloads Git repos, not modules. ;; What are the trade-offs? @@ -265,6 +266,7 @@ (define* (build #:key import-path build-flags #:allow-other-keys) ;; Respectively, strip the symbol table and debug ;; information, and the DWARF symbol table. "-ldflags=-s -w" + "-trimpath" `(,@build-flags ,import-path))) (lambda (key . args) (display (string-append "Building '" import-path "' failed.\n" @@ -304,58 +306,6 @@ (define* (install-license-files #:key unpack-path unpack-path)) (apply (assoc-ref gnu:%standard-phases 'install-license-files) args))) -(define* (remove-store-reference file file-name - #:optional (store (%store-directory))) - "Remove from FILE occurrences of FILE-NAME in STORE; return #t when FILE-NAME -is encountered in FILE, #f otherwise. This implementation reads FILE one byte at -a time, which is slow. Instead, we should use the Boyer-Moore string search -algorithm; there is an example in (guix build grafts)." - (define pattern - (string-take file-name - (+ 34 (string-length (%store-directory))))) - - (with-fluids ((%default-port-encoding #f)) - (with-atomic-file-replacement file - (lambda (in out) - ;; We cannot use `regexp-exec' here because it cannot deal with - ;; strings containing NUL characters. - (format #t "removing references to `~a' from `~a'...~%" file-name file) - (setvbuf in 'block 65536) - (setvbuf out 'block 65536) - (fold-port-matches (lambda (match result) - (put-bytevector out (string->utf8 store)) - (put-u8 out (char->integer #\/)) - (put-bytevector out - (string->utf8 - "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-")) - #t) - #f - pattern - in - (lambda (char result) - (put-u8 out (char->integer char)) - result)))))) - -(define* (remove-go-references #:key allow-go-reference? - inputs outputs #:allow-other-keys) - "Remove any references to the Go compiler from the compiled Go executable -files in OUTPUTS." -;; We remove this spurious reference to save bandwidth when installing Go -;; executables. It would be better to not embed the reference in the first -;; place, but I'm not sure how to do that. The subject was discussed at: -;; - (if allow-go-reference? - #t - (let ((go (assoc-ref inputs "go")) - (bin "/bin")) - (for-each (lambda (output) - (when (file-exists? (string-append (cdr output) - bin)) - (for-each (lambda (file) - (remove-store-reference file go)) - (find-files (string-append (cdr output) bin))))) - outputs) - #t))) (define %standard-phases (modify-phases gnu:%standard-phases @@ -367,8 +317,7 @@ (define %standard-phases (replace 'build build) (replace 'check check) (replace 'install install) - (replace 'install-license-files install-license-files) - (add-after 'install 'remove-go-references remove-go-references))) + (replace 'install-license-files install-license-files))) (define* (go-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) base-commit: c0b303aaa3d6154acbe054120d11467eb98e6d33 -- 2.41.0 ------------=_1709814182-28313-1--