From unknown Sat Jun 14 19:44:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52316: Package example from cookbook has bugs Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 05 Dec 2021 19:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52316 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 52316@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16387319089161 (code B ref -1); Sun, 05 Dec 2021 19:19:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 Dec 2021 19:18:28 +0000 Received: from localhost ([127.0.0.1]:59482 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtx1o-0002Nh-FE for submit@debbugs.gnu.org; Sun, 05 Dec 2021 14:18:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:43874) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mtx1m-0002Na-Od for submit@debbugs.gnu.org; Sun, 05 Dec 2021 14:18:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mtx1l-00012H-SF for bug-guix@gnu.org; Sun, 05 Dec 2021 14:18:26 -0500 Received: from [2a02:1800:110:4::f00:18] (port=45352 helo=michel.telenet-ops.be) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mtx1j-0006CE-2f for bug-guix@gnu.org; Sun, 05 Dec 2021 14:18:24 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id SjJH2600D4UW6Th06jJHNw; Sun, 05 Dec 2021 20:18:18 +0100 Message-ID: From: Maxime Devos Date: Sun, 05 Dec 2021 19:18:17 +0000 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1638731898; bh=uUwCHp6ciNQwFyZjf7vVPIlw/tFs9fzAdbgemR0Ge5E=; h=Subject:From:To:Date; b=WMskKCBtAOMDo9Y7bHMv3WrQzG2indQcsrVouTIVmAmH5vz6VE395L9kCblyLVt4a 2gS6gjbQxmoqkRHB1avEC9orOcR6GPwd0m9oQMGrVBMd/ZL0Lj12E6TFNteGLCrI4X hj4Hgfg6XvesenciJw5HJTxmmsbFecfZVhVlgCJtvuXv4ecy/0OaPjBcr5ikZtta/5 zozqYo8XuOWEZkal+1f5geNGay1pc7E97ua372XDeE3e+mVCbPq04/SAw+4vSZRX0w BtQBuuBpFDzto+3ReWVNj6Gf0YDE/78IOcOuA5dADQGZc1Iztpa0ro8A6Wl+k+toQt 2aHa7ZP5WFNaA== X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:1800:110:4::f00:18 (failed) Received-SPF: pass client-ip=2a02:1800:110:4::f00:18; envelope-from=maximedevos@telenet.be; helo=michel.telenet-ops.be X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: -2.3 (--) Hi guix, The example at https://guix.gnu.org/cookbook/en/html_node/Extended-example.html has two bugs: #:tests? is unconditionally set to #true. This is bad for cross- compilation and --without-tests=PACKAGE reasons, and would be flagged by the linter. In the new 'check' phase, libgit2_clar is invoked unconditionally. This would be flagged by the linter. Also, not exactly a bug, but still bad practice: the web page suggests: #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")) "CC=gcc") however, hardcoding gcc is bad for cross-compilation reasons. It should use (cc-for-target) instead. Greetings, Maxime From unknown Sat Jun 14 19:44:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52316: Package example from cookbook has bugs Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 06 Dec 2021 14:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52316 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxime Devos , 52316@debbugs.gnu.org Received: via spool by 52316-submit@debbugs.gnu.org id=B52316.163880115314948 (code B ref 52316); Mon, 06 Dec 2021 14:33:02 +0000 Received: (at 52316) by debbugs.gnu.org; 6 Dec 2021 14:32:33 +0000 Received: from localhost ([127.0.0.1]:60917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muF2e-0003t2-NZ for submit@debbugs.gnu.org; Mon, 06 Dec 2021 09:32:32 -0500 Received: from mail-wr1-f41.google.com ([209.85.221.41]:43784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muF2c-0003sZ-9Y for 52316@debbugs.gnu.org; Mon, 06 Dec 2021 09:32:30 -0500 Received: by mail-wr1-f41.google.com with SMTP id v11so22794633wrw.10 for <52316@debbugs.gnu.org>; Mon, 06 Dec 2021 06:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=aAIYdlkyc9i1mwHU01R3nS5P5+LMLeYuxljGUpwjjHg=; b=lYNN3uJf2+uf5/CQu8AbczEg30pn4fXO7VJOTjeiAds02y6Oq9859bReC7SAQ/U/KM FtWCLp/NHkDbx3DBzHQ8UMTBVySpQRsL17/5kNQewKmTBTQf2+R4xyiKO0e8rKCyOGcN l1gwayqUTg6WXGV18CuN2E3SCBwzbEfWG7L3M6uIL1txCKOVLt9a9lA+E6a/z9txyQHo Ttouoxv9zmeNLF1qV3yP+AsZkl/hmyEfgM3ALmhhuZu0XWIoRUNPAgv+kZmCIIT/iPxZ 47Ek9l0ovWu+jKzcHpDz6NKy101Alr92O2x09ByRvie0T2JSK9GsXnK7QWHtMF682Q+1 0t8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=aAIYdlkyc9i1mwHU01R3nS5P5+LMLeYuxljGUpwjjHg=; b=oDH8mTuc47i5PKgXjEMNyc/EPduZgcSLPZ7kVbWulyA6MFoQ7R1qx1vq0UfOmSkqvN nNp/wUE/qhTrG1LjGh7XN8Bseaq06j/X3xwvkzKadUZWLPL6QSRxcD5xk78XDzQGeV0d k+23Bx4jZp3Ltb+TNQzNd1grlEBEjYHJp0LXL6QNP5xWjJD3MGrBtn5CVg1se8lqdVzC 6lnfuTJxWX8mzOqr0T1J/MEdwZCRHubVlk05eYHXKUazWQX8TIfbaQFBzXu3H5FhOumH +8Qcd6IYW1EogL1UouGQjDSBsRyjLA91zF2Ddtx6q8b5+WAkkbltP4JgUe9zsAxzDOJM R4+g== X-Gm-Message-State: AOAM530KL3YJ2ZJ8LGCqEbOJtoJY/CBgYavkmdt3oadEWkuA6EMlrlfr 8IOc5V92Ery7dKLDpeiZWI64VVveoFM= X-Google-Smtp-Source: ABdhPJzRSod+a8QpJDBhpupii6tAWmVrLWRQejdFck5xqlZ2Vz87YNha2zog9agXG0Uupb3VFyq5TA== X-Received: by 2002:a5d:6dc3:: with SMTP id d3mr43676940wrz.159.1638801143503; Mon, 06 Dec 2021 06:32:23 -0800 (PST) Received: from lili ([88.126.110.68]) by smtp.gmail.com with ESMTPSA id o9sm11651157wrs.4.2021.12.06.06.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Dec 2021 06:32:23 -0800 (PST) From: zimoun In-Reply-To: References: Date: Mon, 06 Dec 2021 15:30:11 +0100 Message-ID: <86lf0xolfw.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 (-) Hi Maxime, On Sun, 05 Dec 2021 at 19:18, Maxime Devos wrote: > The example at > https://guix.gnu.org/cookbook/en/html_node/Extended-example.html has > two bugs: > > #:tests? is unconditionally set to #true. This is bad for cross- > compilation and --without-tests=3DPACKAGE reasons, and would be flagged > by the linter. For cross-compilation, yes. For =E2=80=99--without-tests=E2=80=99, it is n= ot an issue, IMHO, or why is it? > In the new 'check' phase, libgit2_clar is invoked unconditionally. This > would be flagged by the linter. Since it is an example showing non-trivial things, maybe it can be pedagogical to have something half good, if and only if, =E2=80=9Cguix lint= =E2=80=9D reports the half bad. And add an explanation. WDYT? > Also, not exactly a bug, but still bad practice: the web page suggests: > > #:make-flags (list (string-append "prefix=3D" (assoc-ref %outputs "out")) > "CC=3Dgcc") > > however, hardcoding gcc is bad for cross-compilation reasons. It should > use (cc-for-target) instead. I agree. Cheers, simon From unknown Sat Jun 14 19:44:50 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52316: Package example from cookbook has bugs Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 06 Dec 2021 15:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52316 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: zimoun , 52316@debbugs.gnu.org Received: via spool by 52316-submit@debbugs.gnu.org id=B52316.163880346521462 (code B ref 52316); Mon, 06 Dec 2021 15:12:02 +0000 Received: (at 52316) by debbugs.gnu.org; 6 Dec 2021 15:11:05 +0000 Received: from localhost ([127.0.0.1]:35129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muFdx-0005a5-LA for submit@debbugs.gnu.org; Mon, 06 Dec 2021 10:11:05 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:51184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muFdt-0005ZF-RQ for 52316@debbugs.gnu.org; Mon, 06 Dec 2021 10:11:03 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by baptiste.telenet-ops.be with bizsmtp id T3B0260014UW6Th013B0iy; Mon, 06 Dec 2021 16:11:00 +0100 Message-ID: From: Maxime Devos Date: Mon, 06 Dec 2021 15:10:59 +0000 In-Reply-To: <86lf0xolfw.fsf@gmail.com> References: <86lf0xolfw.fsf@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1638803460; bh=FI4WBiKbHfd/jiVi4mepn1ZLyYm7F6nJz3RtytBqKg8=; h=Subject:From:To:Date:In-Reply-To:References; b=iVTIwpdLSNDf1XGV9Id1liuhP82Qxb2X8mB8jXzYSxO/+NV9NY4D5ksA2Z2cEDRBn ObtrwOZ89sG0Fz/IM/nRSb+nQgBFQK8eVuv65s0o3d8JBu2SdLA+zRQnXO+WQakKmZ nwzzoSlpLt8I3/0wjORT/v+hVWb/eC6KQGwzXCEXHnkOLSRJYR5FHDWtlBBaJA3zrX V4DtXAGMyPxStMtU4aXWEJQVug+w0aiVXfEHKyaH5BJU2YEYyx5Z/nGz93+4lWsAAs J7bEr/QwLtKj1wijsoJgaZ40snMTmMVMhHbJ/7U5iOuSm7MyEn9MpYdcbmTAOT0y1b zmy9nhea74cdA== 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, zimoun schreef op ma 06-12-2021 om 15:30 [+0100]: > [....] > > #:tests? is unconditionally set to #true. This is bad for cross- > > compilation and --without-tests=PACKAGE reasons, and would be > > flagged > > by the linter. > > For cross-compilation, yes.  For ’--without-tests’, it is not an > issue, > IMHO, or why is it? I was mistaken, unconditional #true is unproblematic for --without- tests, because --without-tests replaces the #true by #false IIUC. > > In the new 'check' phase, libgit2_clar is invoked unconditionally. > > This > > would be flagged by the linter. > > Since it is an example showing non-trivial things, maybe it can be > pedagogical to have something half good, if and only if, “guix lint” > reports the half bad.  And add an explanation.  WDYT? I don't know what would be best from a pedagogical perspective: showing the right code directly (showing more non-trivial things and not showing any bugs, but possibly showing too much at once), or writing the half-right code (with a short comment telling there's a bug that will be explained later). The second thing doesn't seem bad to me, but IANAP (I am not a pedagogue). Greetings, Maxime