From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id iJoIL5NR6GaSHQAAe85BDQ:P1 (envelope-from ) for ; Mon, 16 Sep 2024 15:41:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id iJoIL5NR6GaSHQAAe85BDQ (envelope-from ) for ; Mon, 16 Sep 2024 17:41:07 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=tdLQ44iq; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=RvELhoRu; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1726501267; h=from:from:sender:sender: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:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=L7ycULewj21LLIB8ON1fukN/NdADpbRliXnmwMwasDY=; b=KF8XyzIzJ40BOQXOEDSyxIEs3/rWZfvp+zNzl6tN5MgKQRU49NnfNtOgCPZhqPggrshQrA /wKxBKup3zm8cb4FRvjgse0oKtVfUFQ35sgb3R9fMYE4jZHZGwkYLkSB46n5oeKJXZHxQE v/PYlxUmQmotpKsoPPt43neJCi50Smwe7MYiDjAILDI6C324znrpj9HntR+BuDQr7syZx8 QTlw2npuJvoy5+aDlSyBghfo9b9gMn98rv/jT14IWvu/wJNzlkUV1FvBLE9PkQCkn8hwTT 5MPep5GqNAIzcxBQiX4eUJpGGP7Z41HZuwc9iQ8J2U2EvsIeuVDUQzVvF4gpZA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=tdLQ44iq; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=RvELhoRu; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1726501267; a=rsa-sha256; cv=none; b=C19kadMIt/eRPPP7ZESbgEca2QjGZ1AyGIT/tBnzipQUp1ptQM1jw8akNyUbZOGJpuPh1A OUAYtWi5aYV+ubFzav97cz0D4Bx+NJ/RIwUyIX4Fy3aB6T9LUGfB5FRE8Ib7yRWC5aNdO2 8lC9EI045aCZzNZUVLFXV109zI4f9dm71IVIyRTd5Hs3fhzu50bzpOEMoDnIRtKgApvqfl +/xKH2911Y6VzTU9sxNTdjYJdS/yTRe2KtFpp3361H3f+wvlbTVEzE8inm/AhLVWelyFYr 6cd+R8f/iB161Xi/b90w8dAp9hXW1Gwk9BuE61/gYa7VI3v/Aal6rm0r4zOWvg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4A76087206 for ; Mon, 16 Sep 2024 17:41:07 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqDqN-0008TP-Oh; Mon, 16 Sep 2024 11:40:51 -0400 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 1sqDqL-0008Sl-Ky for guix-patches@gnu.org; Mon, 16 Sep 2024 11:40:49 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqDqL-0007me-CE for guix-patches@gnu.org; Mon, 16 Sep 2024 11:40:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=L7ycULewj21LLIB8ON1fukN/NdADpbRliXnmwMwasDY=; b=tdLQ44iqU042eUGHNW9Op7Bw8/TC3Ei1GrCBrphX6ACmRYYQMxyI481szaApHF7OtUxsXeXgRjRXwdtVVtDEKOfMokHB6l+SohfnB4eOR+uxepUUVhbEQsR+bNyHIINyL62LlOcTLRjwo1VICm6/Io5rYVq3c5FrRf3Pd3RtVrQaULZHFHyK/z5BxafIQVAhjOB3rsb20u5tUsyW0tb1YTzHgNL31fYwavZ0NwMBamjXjAUQSqTIXhxUwGH1iFb/x8LsqC1pziQV0RrWbFbkPuVNF4cNgdbY3B9e7m8NH7vAgDN5660ygG2nF4NpUuiVtpxvvFT0f+20izua0Vj0VA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sqDqY-0007Tt-OX; Mon, 16 Sep 2024 11:41:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73299] [PATCH] build/go: Replace symlinks with a copy of the file. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: cox.katherine.e+guix@gmail.com, sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Mon, 16 Sep 2024 15:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73299 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73299@debbugs.gnu.org Cc: Sharlatan Hellseher , Efraim Flashner , 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.172650120928190 (code B ref -1); Mon, 16 Sep 2024 15:41:02 +0000 Received: (at submit) by debbugs.gnu.org; 16 Sep 2024 15:40:09 +0000 Received: from localhost ([127.0.0.1]:53089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqDph-0007Kb-8O for submit@debbugs.gnu.org; Mon, 16 Sep 2024 11:40:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:54554) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sqDpf-0007KR-20 for submit@debbugs.gnu.org; Mon, 16 Sep 2024 11:40:08 -0400 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 1sqDpR-0007Oj-9r for guix-patches@gnu.org; Mon, 16 Sep 2024 11:39:53 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sqDpO-0007Sr-SP for guix-patches@gnu.org; Mon, 16 Sep 2024 11:39:52 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-42ca4e0299eso35677985e9.2 for ; Mon, 16 Sep 2024 08:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726501188; x=1727105988; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=L7ycULewj21LLIB8ON1fukN/NdADpbRliXnmwMwasDY=; b=RvELhoRu6L/uGuwrqQ8SyBpJTZtJyPCChDonP0mFuHVXckcXurIdL3IVIMZHI0pMrV 0L2b4/yCLbVJWaSM31EEIvKJxHaMOssnB5iAGoM1Xg4d7lQqhKzVFptBqpbdluciCZPt GVTc4V5iKr2eVYddsL9EUxewk4qAAiukEj0DynT1m3Q3VvTE8qulTlZu+Qo1d2yM8uTl x64WjTBUCSA1GCKYh0YDAEF7VXtOr6dRg7nhZA3eOjwJZW8FO7olvQmVFHxI/Qrb/LSa sb+RKKgSijFGVGeFBFWlDSza9sg+zAFkX8gOhSduKQp+1s1WEt6FGG7ekH00XOQnoMBD 5rIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726501188; x=1727105988; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=L7ycULewj21LLIB8ON1fukN/NdADpbRliXnmwMwasDY=; b=F79NGQomUkhzyYTphee6ue9czS0UrpAfgxHcO9pH9fIx1V8VJRWvG0OpPjGGCA+OI4 r0WZH+UUvKXQnzMh3JMyiUDBnvzwMK73tyZgfj9xU9tj98sS0jkzxosKwq9FYllzkLQd gMxcEqhlfyX9G14b1MtEsStXIrT4zsZafdee4rgqoE/5kETyEZ8m87fRfmemaL7DKMvD kAfNLnVe7k96fDiki7u6OtZtr7IWP9SbaWiOtpUhzfhGrTX4pvFTLNPkQsI0yzqVAMtf J8NmeHwdmX5D2NhvE6pnKSCNXScw20kkt5+YKD/z3HMBveFEIOWmjgvYGjJo5umPmLlE +Oig== X-Gm-Message-State: AOJu0YxpMvk+pcSqx96FG5KD/NQJpHgttKsmtM9nTLNsE13N5dmdviVy sN4pIq5pGNgPwQOmYzP/gzs2cn1f+2qiRPKeu4RTU1cPB3mX3qHlLgPxhmZu X-Google-Smtp-Source: AGHT+IEwBazEgTnUj17k2JxkWHNWsLlGOtv33FEuYB6pc4iVPMXiI/1TdWXIzHXubFyJYsZ5+Cti8w== X-Received: by 2002:adf:b30e:0:b0:374:c3e4:d6c5 with SMTP id ffacd0b85a97d-378c2d59673mr7566151f8f.57.1726501187383; Mon, 16 Sep 2024 08:39:47 -0700 (PDT) Received: from localhost ([141.226.162.35]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-378e71f068esm7585470f8f.3.2024.09.16.08.39.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Sep 2024 08:39:46 -0700 (PDT) From: Efraim Flashner Date: Mon, 16 Sep 2024 18:38:46 +0300 Message-ID: X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=efraim.flashner@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 4A76087206 X-Migadu-Scanner: mx11.migadu.com X-Spam-Score: -5.94 X-Migadu-Spam-Score: -5.94 X-TUID: C8MeD7TSI22C * guix/build/go-build-system.scm (fix-embed-files): New procedure. (%standard-phases): Add 'fix-embed-files after 'unpack. Co-authored-by: Sharlatan Hellseher Change-Id: I27bc46fa1a3f4675ff73b6cba4ef5c3d177c22b1 --- I saw this pattern coming up a couple of times in the go-team branch so I figured I could factor it out, as the comment said. I figure later we can adjust it to match other symlinked files. guix/build/go-build-system.scm | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm index 3f0f5700a1e..c953976b485 100644 --- a/guix/build/go-build-system.scm +++ b/guix/build/go-build-system.scm @@ -4,10 +4,11 @@ ;;; Copyright © 2019 Maxim Cournoyer ;;; Copyright © 2020 Jack Hill ;;; Copyright © 2020 Jakub Kądziołka -;;; Copyright © 2020, 2021, 2023 Efraim Flashner +;;; Copyright © 2020, 2021, 2023, 2024 Efraim Flashner ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2024 Ekaitz Zarraga ;;; Copyright © 2024 Picnoir +;;; Copyright © 2024 Sharlatan Hellseher ;;; ;;; This file is part of GNU Guix. ;;; @@ -201,6 +202,23 @@ (define* (setup-go-environment #:key inputs outputs goos goarch #:allow-other-ke (delete-file-recursively tmpdir)) #t) +(define* (fix-embed-files #:rest args) + "Golang can't determine the valid directory of the module of embed file +which is symlinked during setup environment phase, but easy resolved after +coping file from the store to the build directory of the current package." +;; see details in Golang source: +;; +;; - URL: +;; - commit: 82c14346d89ec0eeca114f9ca0e88516b2cda454 +;; - file: src/cmd/go/internal/load/pkg.go#L2059 + (for-each (lambda (file) + (when (eq? (stat:type (lstat file)) + 'symlink) + (let ((file-store-path (readlink file))) + (delete-file file) + (copy-recursively file-store-path file)))) + (find-files "src" ".*(editions_defaults.binpb)$"))) + (define* (unpack #:key source import-path unpack-path #:allow-other-keys) "Relative to $GOPATH, unpack SOURCE in UNPACK-PATH, or IMPORT-PATH when UNPACK-PATH is unset. If the SOURCE archive has a single top level directory, @@ -321,6 +339,7 @@ (define %standard-phases (delete 'patch-generated-file-shebangs) (add-before 'unpack 'setup-go-environment setup-go-environment) (replace 'unpack unpack) + (add-after 'unpack 'fix-embed-files fix-embed-files) (replace 'build build) (replace 'check check) (replace 'install install) base-commit: 0091fa2cc2ac2104d7945b585e4eaec908ca742f -- Efraim Flashner רנשלפ םירפא GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted