From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SEOmMrM/rF6GAgAA0tVLHw (envelope-from ) for ; Fri, 01 May 2020 15:26:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EPXVOLw/rF5kBAAA1q6Kng (envelope-from ) for ; Fri, 01 May 2020 15:26:52 +0000 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:470:142::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 D70F4941B49 for ; Fri, 1 May 2020 15:26:51 +0000 (UTC) Received: from localhost ([::1]:43490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUXYx-0000QU-Ty for larch@yhetil.org; Fri, 01 May 2020 11:26:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUXYc-0000OH-Lw for bug-guix@gnu.org; Fri, 01 May 2020 11:26:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUXXC-0001Cq-Qh for bug-guix@gnu.org; Fri, 01 May 2020 11:26:30 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38894) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUXXC-0001BW-DW for bug-guix@gnu.org; Fri, 01 May 2020 11:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jUXXC-0002Y3-A4 for bug-guix@gnu.org; Fri, 01 May 2020 11:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#40977: --load-path does not honor ~ Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 01 May 2020 15:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40977 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Tobias Geerinckx-Rice , Danny Milosavljevic , Leo Famulari , Bengt Richter Received: via spool by 40977-submit@debbugs.gnu.org id=B40977.15883466799762 (code B ref 40977); Fri, 01 May 2020 15:25:02 +0000 Received: (at 40977) by debbugs.gnu.org; 1 May 2020 15:24:39 +0000 Received: from localhost ([127.0.0.1]:50440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUXWo-0002XN-VY for submit@debbugs.gnu.org; Fri, 01 May 2020 11:24:39 -0400 Received: from mail-qv1-f65.google.com ([209.85.219.65]:39587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jUXWl-0002XA-G7 for 40977@debbugs.gnu.org; Fri, 01 May 2020 11:24:36 -0400 Received: by mail-qv1-f65.google.com with SMTP id v38so4872700qvf.6 for <40977@debbugs.gnu.org>; Fri, 01 May 2020 08:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=d9nto3n7jkydimlZ2C2UL0Nj3HDDgQoIkjdBXfTgNzg=; b=W4EiKX1TKN8be8rdjb+ixPxlMGMa9Dr7YBXzS+6QvCshNcZi6A9HQmLu8bWddKcp3T y91r0lGn7FgShPbqjPOKjaqGJTXgEFwWXdG/APi0bepIw2bdVsmdCVjDLmWO9ef3liU2 DlyWprl89zqNbkTg+ZfQ0zW+MT4+XvbXc+7qBoCCLtcp/0rbXgSLB/A/b5Cj5c4qtgoj 7jW8ku9IDZ1vMV4nsMlitTLZbq6L17a1qTvXxsLaJXUBewkM8r/+KTc4/FhiOthjfJJn CTp4+ZnjEUo6OcL9C56DtdSrNzfiWeG+VWQ8jeVAGCY1fwn66CGhUn/nozS41edKqSFH fDZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=d9nto3n7jkydimlZ2C2UL0Nj3HDDgQoIkjdBXfTgNzg=; b=nDnmVGY2OwD2mGsPWCHP5zZIMQoixqr5HkVvZ1uQ32xKwfgmYxVt6kDFQerqrCCNa8 wE2VzuBRLuhU1P+Y6wVJq0a32utoDutIQJKXvP9xz2uX93onp3MWshQaAIet3Z8B4Bly ORpetZQ2c56m23SUDzaUhS+CT4Ed4dg8beNW9azbVDr0ZBHrnPu+u9VyV9JvXvElRnqe E4sQW3VBLDEvR157qSm6X5zemHf/gzcafvew5sZ4zmggiacTcZDiOfLgmcK8291+7UUf YwsjonRivtjzVVRL7EmQlthzjZ2eBTbR6nYbcOQTqhz6JYzMpYJajTsRnJgNG/jbPi7m XCoA== X-Gm-Message-State: AGi0PuZUIZ3dLJAV/QG1WO3IT6DNEg0xhfdFHnfbiV0S7po27mkRnhPE Gbwm5JqQua6ikio0yW51oLAJ56DjWq5H6jecnZM= X-Google-Smtp-Source: APiQypJWK9kup8HTOnUakD9tDan3WcQN5LJb3P479vDnSiQjhpcbrz79i+ohaN+gmASRL973xBnD/7GtKcPENY/Mvuc= X-Received: by 2002:a0c:fc42:: with SMTP id w2mr4316895qvp.77.1588346669755; Fri, 01 May 2020 08:24:29 -0700 (PDT) MIME-Version: 1.0 References: <9fc5fc35-10c6-dda3-1e11-36740e4510c4@crazy-compilers.com> <52117c4b-3090-1ccf-5669-ff4c47935e19@crazy-compilers.com> <87y2qcsst3.fsf@nckx> In-Reply-To: <87y2qcsst3.fsf@nckx> From: zimoun Date: Fri, 1 May 2020 17:24:18 +0200 Message-ID: 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-Received-From: 209.51.188.43 X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 40977@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=W4EiKX1T; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Scan-Result: default: False [0.09 / 13.00]; GENERIC_REPUTATION(0.00)[-0.49533472072463]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2001:470:142::/48:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; DWL_DNSWL_FAIL(0.00)[2001:470:142::17:server fail]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_FIVE(0.00)[5]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.16), country: US(-0.00), ip: 2001:470:142::17(-0.50)]; DKIM_TRACE(0.00)[gmail.com:-]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:2001:470:142::/48, country:US]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[zimontoutoune@gmail.com,bug-guix-bounces@gnu.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[tobias.gr:email]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[40977@debbugs.gnu.org]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[2001:470:142::17:from]; RCVD_COUNT_SEVEN(0.00)[9]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: rdQqyWSiUrld Dear, Sorry to be slow. On Thu, 30 Apr 2020 at 21:20, Tobias Geerinckx-Rice wrote: > Hartmut Goebel =E5=86=99=E9=81=93=EF=BC=9A > This is the wrong thing to do and makes the GNU system an > inconsistent mess. =E2=80=A6OK, *more* of an inconsistent, loveable, mes= s > ;-) I still think that the behaviour of Guix could be considered as a bug and inconsistent with other GNU tools, such as Emacs -- to pick one but Emacs should be an exception in the GNU tools landscape (inconsistent loveable mess :-)) Maybe what I am saying is irrelevant and only bikeshedding. Like Saint-Thomas, I only believe that I see. ;-) > It also makes > > $ sudo guix system --load-path=3D~/path/tp/my/project =E2=80=A6 > > and > > $ sudo guix system -L ~/path/to/my/project -A mypackage =E2=80=A6 > > suddenly result in different file names. Emacs behaves differently; and it is what is expected (at least by me :-)). --8<---------------cut here---------------start------------->8--- mkdir -p ${HOME}/tmp/foo cat < ${HOME}/tmp/foo/eg.el (defun an-example () (interactive) (message (car load-path)) (message (expand-file-name "kikoo" "~/foo/~/bar"))) (provide 'eg) EOF # ~ means /home/simon/ sudo emacs --batch -L ~/tmp/foo/ --eval "(require 'eg)" --eval "(an-example= )" # ~ mean /root/ sudo emacs --batch --directory=3D~/tmp/foo/ --eval "(require 'eg)" --eval "(an-example)" --8<---------------cut here---------------end--------------->8--- The first '~' is expanded by the shell so in the user's context. The second '~' is expanded by Emacs so in the root's context. Well, nothing new. :-) This is not the issue, if I understand correctly. This issue is about the subfolders named '~'. --8<---------------cut here---------------start------------->8--- mkdir -p ${HOME}/tmp/foo/~/bar cat < ${HOME}/tmp/foo/~/bar/ex.el (defun from-tilde () (interactive) (message (car load-path)) (message (expand-file-name "yahoga" "~/foo/~/bar"))) (provide 'ex) EOF cd ${HOME}/tmp/foo # ~ means /home/simon emacs --batch --directory=3D~/bar/ --eval "(require 'ex)" --eval "(from-til= de)" # protect ~ emacs --batch --directory=3D./~/bar/ --eval "(require 'ex)" --eval "(from-t= ilde)" --8<---------------cut here---------------end--------------->8--- >From the folder '${HOME}/foo', Emacs is run with prepending the subfolder named '~'. The first line fails because the folder '/home/simon/bar/' does not exist. The second '~' refers to the correct subfolder because of the dot. Now the behaviour of Emacs is inconsistent with the Guix's behaviour. --8<---------------cut here---------------start------------->8--- cd ${HOME}/foo guix show --load-path=3D~/bar from-tilde --8<---------------cut here---------------end--------------->8--- This works. Because Guix uses the argument as it is. Note that '--load-path=3D./~/bar/' works too. And note that from the folder '$HOME/tmp/foo', the commands guix show -L ~/bar from-tilde and guix show --load-path=3D~/bar from-tilde refer to different file names. And it appears to me weirder than the tilde expansion done as Emacs does. --8<---------------cut here---------------s tart------------->8--- mkdir -p ${HOME}/tmp/foo/~/bar cat < ${HOME}/tmp/foo/~/bar/from-tilde.scm (define-module (from-tilde) #:use-module (guix packages) #:use-module (gnu packages maths)) (pk (car %load-path)) (define-public from-tilde (package (inherit gmsh) (name "from-tilde"))) EOF --8<---------------cut here---------------end--------------->8--- > Please don't do it. Well, in summary. I have no knowledge about GNU tools and how they expand '~'. I agree that '~' could be considered as a wart. And I do not know if considering '~' as shortcut for $HOME is a "good practise" or not. But I use '~' as meaning $HOME more more often than I create an obscure subfolder named '~' (well I never did :-)). And I treat with care the filename when I use 'sudo' because it is context switch so so error-prone. Maybe wrong terminology has been used with 'expanduser' but Guix should expand '~' in agreement with the GNU Bash tilde-expansion section IMHO. (And this is valid for any '--long-option=3D~'.) Therefore does the "it" in the Danny's and Tobias's "don't do it" mean tilde-expansion? Sorry again to be slow or bikeshed. Best regards, simon