From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id GO1nOOFFLGUDOwAAauVa8A:P1 (envelope-from ) for ; Sun, 15 Oct 2023 22:04:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GO1nOOFFLGUDOwAAauVa8A (envelope-from ) for ; Sun, 15 Oct 2023 22:04:50 +0200 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 8CB0476B3A for ; Sun, 15 Oct 2023 22:04:49 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="hMEWwFK/"; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1697400289; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=ckGfdlpyIdzQMQqSZ2ioTPd5RaS0NJ2l+zjvZ1Ibzgs=; b=deho318hXLgtj9knCbe5Ygw4XIJrxemRoad7L6RRI/OJ5qzB22bmSOcBg2IDvILkri7gkr pBJ/de0ASe5nO51P3nK1V5ClB2RLePqy2VbrGCAU7cwH9KbbMEJRmdN6J6yJkzkMryKUEP Ys5ve5yreXJnRn9HIyfwSM+A6Lwbl7NS1gtedc+y2yKhDgA5xcQBAmaCmJHpPLEshM2p7f pbS6defKtSV1PpXTNNX4ExIamDGHXBPSnufkvcTs6k8IVLKapelGX4ovVMLrmhxGkZDvLN lFBxiasDiyFpT7DrvyMkptKhSP+lVTJ5Izqge39auG5fUcqG58NTxR5YL6uUlQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1697400289; a=rsa-sha256; cv=none; b=iueKNScq+8hiRIxqrEfMl/wS8bQ6tSZMFkGTgCJ+f2tLG56SOx4smuqaGMhfXXGTq54qjZ Z4aI+0ErFoZNC6cRt228+q1/V3kbezlN+B/K+UsA2xdmiMbMsS/CGLDszYFwSNBiF/shwn XrUJRBj0CfbEDoL00igmBxj8rfsQj4yo5oRxtS2JKEMNif28dq3MFgAFF2SmK8tqOzBWIM ZTGcxuVqYyLvWDafAGkWtRhJLC9AwDe3Cw/dEJ8cMZ31GmiYiTRyEkZU7WPPXo9nEcefJ1 GbpWQzAVPoFdFwtdAZ0oKvMEqwvhcx3xeMMLnVWgxX0woO9oALu3AuwCFh84IA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="hMEWwFK/"; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qs7Ls-00064o-9c; Sun, 15 Oct 2023 16:04:40 -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 1qs7Lq-00064g-2y for bug-guix@gnu.org; Sun, 15 Oct 2023 16:04:38 -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 1qs7Lp-0006sw-R4 for bug-guix@gnu.org; Sun, 15 Oct 2023 16:04:37 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qs7ME-0005ZI-59 for bug-guix@gnu.org; Sun, 15 Oct 2023 16:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65924: [PATCH core-updates 3/3] gnu: git-minimal: Add coreutils and sed to PATH. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 15 Oct 2023 20:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65924 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 65924@debbugs.gnu.org, Simon Tournier Received: via spool by 65924-submit@debbugs.gnu.org id=B65924.169740026621353 (code B ref 65924); Sun, 15 Oct 2023 20:05:02 +0000 Received: (at 65924) by debbugs.gnu.org; 15 Oct 2023 20:04:26 +0000 Received: from localhost ([127.0.0.1]:54173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qs7Le-0005YL-3o for submit@debbugs.gnu.org; Sun, 15 Oct 2023 16:04:26 -0400 Received: from mail-yb1-xb32.google.com ([2607:f8b0:4864:20::b32]:55776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qs7Lb-0005Y5-NA for 65924@debbugs.gnu.org; Sun, 15 Oct 2023 16:04:24 -0400 Received: by mail-yb1-xb32.google.com with SMTP id 3f1490d57ef6-d8a000f6a51so4227308276.3 for <65924@debbugs.gnu.org>; Sun, 15 Oct 2023 13:03:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697400233; x=1698005033; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ckGfdlpyIdzQMQqSZ2ioTPd5RaS0NJ2l+zjvZ1Ibzgs=; b=hMEWwFK/ScWyrzWehEjMZf4IstAo08Wy0z1spscrMD8lXiBmJUz7kCUVMK6HY+E0DU tzIenmrUC1HtPXmcFtqhqukaAz45ZnyLrLls9e/B35qsGVj0pjGXo4n+CLt+wajfnOHv iwVHyN44SBcrkslIf9ngNIV4W6dnQSjX1gAIcE26F2yAnfIeZfXNmT27JFKctZtxecLF 6p7qs07+qD9tyVQOcVlQWVWThutup2UqOFGKv+Cy27MVc6nJTyT43vdTAewCR6t58XB9 9wPTaWHkggBjUme5UUPTLxkqgZj7vffe0ZjoE91r3WPyO866vtBP1ckcUYWmAvZy9MJJ u00w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697400233; x=1698005033; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ckGfdlpyIdzQMQqSZ2ioTPd5RaS0NJ2l+zjvZ1Ibzgs=; b=OcGrgVLYUQTX2kitzRhuc6EqhEYLPNCmQ4pdCgoM+3lQZRBm/S4Aog3kpjM0b00fu2 TLqhXZqA0af8fsJpvfB1+WXh781x31lQUtfbApenu2PNdWYsa9JBhybFqBSApXSH9yDF caKhU+nvCC51yJNKtjGYjXHlyj8R8THRG+EakQ64U4RXW+YguDCClET6NgZEik4Rlm1y 9ds31HcVUuY9QBYeXq0Yk9Zr2rLgnJLWMgqJDAUW3jwMX8k70hlqGghBrfRdPSLJ3mmU sPIfr9QOBNOamtqUC1oJtIMY3uMkTvOWf/C2xFYaSKlv1WatkQanc8m4uZpr1N8knFHb 7BPQ== X-Gm-Message-State: AOJu0YwVr4VOAI7llDBlqdic2B9nzpyKcNNji+H5ObY7TXrQxzmQYF91 r0g1CnApGKldjKZDgiAoJI4= X-Google-Smtp-Source: AGHT+IF34SBgZIm1PC0zfz5ltHWu0zkfHq7XC0YimrWS81bUmnJxtQHN/UUubA78XAsjz0Ye25/5YQ== X-Received: by 2002:a25:dc12:0:b0:d9a:c946:c18a with SMTP id y18-20020a25dc12000000b00d9ac946c18amr9104903ybe.28.1697400233595; Sun, 15 Oct 2023 13:03:53 -0700 (PDT) Received: from hurd (dsl-10-149-74.b2b2c.ca. [72.10.149.74]) by smtp.gmail.com with ESMTPSA id dr20-20020a05621408f400b006590d020260sm2814628qvb.98.2023.10.15.13.03.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Oct 2023 13:03:53 -0700 (PDT) From: Maxim Cournoyer In-Reply-To: <87r0lxdtpt.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 14 Oct 2023 19:01:02 +0200") References: <9e15a3ab5f8d4f44b834e1fc90464312c60fac9e.1696734901.git.maxim.cournoyer@gmail.com> <87r0lxdtpt.fsf@gnu.org> Date: Sun, 15 Oct 2023 16:03:51 -0400 Message-ID: <87zg0jzm8o.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: 2.83 X-Migadu-Queue-Id: 8CB0476B3A X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: 2.83 X-TUID: bXQoAGMkrFlt Hi Ludovic, Ludovic Court=C3=A8s writes: > Maxim Cournoyer skribis: > >> Fixes . >> >> * gnu/packages/version-control.scm (git-minimal) >> [arguments] : New field. >> : Augment with (ice-9 match), (ice-9 textual-ports) and (guix >> search-paths). >> : Add patch-commands phase. >> [inputs]: Add coreutils-minimal and sed. > > [...] > >> + #:imported-modules `(,@%gnu-build-system-modules >> + ,@(source-module-closure '((guix search-path= s)))) > > I think we should avoid the dependency on (guix search-paths) here, to > avoid situation such as that described in > . OK, I can see how that could be annoying, especially since (guix search-paths) will see frequent new search paths additions. I think the best course to avoid a repeat may be to document that only modules part of the (guix build ...) prefix should be used on the build side, with the list of exception modules, if there are any; what do you think? >> + (add-after 'unpack 'patch-commands >> + (lambda* (#:key inputs #:allow-other-keys) >> + (define (prepend-string-to-file text file) >> + "Prepend TEXT to FILE." > > Nitpick: no need to add a docstring to internal defines because it=E2=80= =99s > optimized out and inaccessible (you can use a comment instead). I think I did so here in case it's ever moved to (guix build utils) or the likes; it seems a useful procedure to have around. Thanks for the bit of knowledge! >> + (let ((content (call-with-input-file file >> + (cut get-string-all <>)))) >> + (call-with-output-file file >> + (lambda (port) >> + (display text port) >> + (display content port))))) >> + >> + (define PATH-variable-definition >> + (let ((value >> + (match (evaluate-search-paths >> + (list $PATH) >> + (list #$(this-package-input "coreutils-m= inimal") >> + #$(this-package-input "sed"))) >> + (((spec . value)) >> + value)))) >> + (string-append >> + (search-path-definition $PATH value >> + #:kind 'prefix) "\n\n"))) >> + >> + ;; Ensure that coreutils (for basename) and sed are on PA= TH >> + ;; for any script that sources the 'git-sh-setup.sh' file. >> + (prepend-string-to-file PATH-variable-definition >> + "git-sh-setup.sh") > > How about something along these lines instead: > > ;; Instead PATH definition at the top of the file. > (substitute* "git-sh-setup.sh" > (("^unset CDPATH" all) > (string-append "PATH=3D" (dirname (search-input-file inputs "bin/bas= ename")) > ":$PATH\nexport PATH\n" all))) I'd like to preserve prepending the shell expression to the beginning of the file, as substitute* doesn't error when it doesn't match anything, which could lead to silent breakage in the future (if that 'unset CDPATH' line is ever moved/deleted). The rest looks good, except we'd have to add sed to the PATH as well. I can send a new patch to that effect. --=20 Thanks, Maxim