emacs-28.1: tramp sudo broken

DoneSubmitted by Remco van 't Veer.
Details
5 participants
  • benoit
  • Josselin Poiret
  • John Kehayias
  • Liliana Marie Prikler
  • Remco van 't Veer
Owner
unassigned
Severity
normal
R
R
Remco van 't Veer wrote on 16 May 08:27 +0200
(name . bug-guix)(address . bug-guix@gnu.org)
87tu9q6lg6.fsf@remworks.net
After upgrading from emacs-27.2 to emacs-28.1 on a Guix system, opening
files/directories via sudo using tramp no longer works.

Here's what's in the *Messages* buffer:

Toggle quote (4 lines)
> Tramp: Opening connection nil for root@remq240 using sudo...done
> File error: Couldn't find a proper `ls' command [6 times]
> tramp-error: Couldn't find a proper `ls' command

I am at:

Toggle quote (6 lines)
> Generation 48 May 15 2022 16:38:54 (current)
> guix 9860c90
> repository URL: https://git.savannah.gnu.org/git/guix.git
> branch: master
> commit: 9860c90e8e5362e0e843efbd45f4563b9746a196

Logging out after upgrade does not help.

Kind regards,
Remco
J
J
Josselin Poiret wrote on 19 May 15:57 +0200
874k1l39r9.fsf@jpoiret.xyz
Hello,

Remco van 't Veer <remco@remworks.net> writes:

Toggle quote (9 lines)
> After upgrading from emacs-27.2 to emacs-28.1 on a Guix system, opening
> files/directories via sudo using tramp no longer works.
>
> Here's what's in the *Messages* buffer:
>
>> Tramp: Opening connection nil for root@remq240 using sudo...done
>> File error: Couldn't find a proper `ls' command [6 times]
>> tramp-error: Couldn't find a proper `ls' command

What I personally use is described at [1], and fixed this issue I had
when I switched to emacs-next.

--
Josselin Poiret
B
B
benoit wrote on 19 May 14:46 +0200
emacs-28.1: tramp sudo broken
(address . 55443@debbugs.gnu.org)
f50baf81c0e3cfc901fbe3f341147d9d@benoitj.ca
Hi,

had similar issue using tramp without sudo targetting a guix host.

I could fix the issue by adding /bin/ls as a special file to my services
with something like:

(extra-special-file "/bin/ls" (file-append coreutils "/bin/ls"))

Benoit
R
R
Remco van 't Veer wrote on 19 May 16:55 +0200
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 55443@debbugs.gnu.org)
87h75lbmhl.fsf@remworks.net
2022/05/19 15:57, Josselin Poiret:

Toggle quote (5 lines)
> What I personally use is described at [1], and fixed this issue I had
> when I switched to emacs-next.
>
> [1] https://yhetil.org/guix/87czjsmif0.fsf@jpoiret.xyz/

Thanks! Your workaround works. Here's my slightly tweaked version
(inspired by the post by Max Brieiev):

(connection-local-set-profile-variables
'guix-system
'((tramp-remote-path . (tramp-own-remote-path))))

(connection-local-set-profiles
`(:application tramp :protocol "sudo" :machine ,(system-name))
'guix-system))

I do agree with Maxime Devos in the same thread, ideally tramp sudo
should just work on guix.
J
J
John Kehayias wrote on 22 Jun 03:53 +0200
[PATCH] gnu: emacs: Fix source snippet.
(name . 55443@debbugs.gnu.org)(address . 55443@debbugs.gnu.org)
66NagbOIcNT8BqSgaUkgbTgCNH0mfajA1yX3hV3ldCj1tVkUpENd30FfkNhpBxnvqO1uK82E0MLb_3mNM3QdVhji0AwE9gvLllrhNTC0NsY=@protonmail.com
Hello,

I believe this bug is due to a change in emacs to where the tramp-default-remote-path was moved from tramp-sh.el to tramp.el: https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=695f6792f1524a446d276bf5c5e53bbb4c200909

Due to this the source snippet in emacs that adds guix paths did not work, as you should see by examining the variable: C-h v tramp-remote-path

I've tested this patch builds, sets tramp-remote-path, and alleviates the sudo problem I also experienced (for local tramp). Please test if this fixes it for you. And maybe someone can relay this to the guix-devel thread mentioned in case there is more to be done as per the discussion there.

Thanks,
John
From 9cf58b23bc169e173c363a8c9107caa90d2a8f71 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Tue, 21 Jun 2022 21:22:26 -0400
Subject: [PATCH] gnu: emacs: Fix source snippet.


* gnu/packages/emacs.scm (emacs)[source](snippet): Patch tramp.el rather than
tramp-sh.el as the code to be patched moved.
---
gnu/packages/emacs.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 31b5c04324..0de4b7a5d5 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -106,7 +106,7 @@ (define-public emacs
                   ;; Make sure Tramp looks for binaries in the right places on
                   ;; remote Guix System machines, where 'getconf PATH' returns
                   ;; something bogus.
-                  (substitute* "net/tramp-sh.el"
+                  (substitute* "net/tramp.el"
                     ;; Patch the line after "(defcustom tramp-remote-path".
                     (("\\(tramp-default-remote-path")
                      (format #f "(tramp-default-remote-path ~s ~s ~s ~s "
-- 
2.36.1
J
J
John Kehayias wrote on 22 Jun 16:41 +0200
(name . 55443@debbugs.gnu.org)(address . 55443@debbugs.gnu.org)
snDNOgbm6j_4-OyYJ1rsrPdXRTH0Dz-tklmxDRdNWBbSuf_4v8-QGvYEaHCtYtt89VYgyzQsg4xxwOP3w2olWJm-cYtYiOGSOFNyb1Hr5eo=@protonmail.com
I forgot to CC other users on the bug, so I'm sending the message again. Apologies if you got this twice.


------- Original Message -------
On Tuesday, June 21st, 2022 at 9:53 PM, John Kehayias <john.kehayias@protonmail.com> wrote:


Toggle quote (10 lines)
> Hello,
>
> I believe this bug is due to a change in emacs to where the tramp-default-remote-path was moved from tramp-sh.el to tramp.el: https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=695f6792f1524a446d276bf5c5e53bbb4c200909
>
> Due to this the source snippet in emacs that adds guix paths did not work, as you should see by examining the variable: C-h v tramp-remote-path
>
> I've tested this patch builds, sets tramp-remote-path, and alleviates the sudo problem I also experienced (for local tramp). Please test if this fixes it for you. And maybe someone can relay this to the guix-devel thread mentioned in case there is more to be done as per the discussion there.
>
> Thanks,
> John
From 9cf58b23bc169e173c363a8c9107caa90d2a8f71 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Tue, 21 Jun 2022 21:22:26 -0400
Subject: [PATCH] gnu: emacs: Fix source snippet.


* gnu/packages/emacs.scm (emacs)[source](snippet): Patch tramp.el rather than
tramp-sh.el as the code to be patched moved.
---
gnu/packages/emacs.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 31b5c04324..0de4b7a5d5 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -106,7 +106,7 @@ (define-public emacs
                   ;; Make sure Tramp looks for binaries in the right places on
                   ;; remote Guix System machines, where 'getconf PATH' returns
                   ;; something bogus.
-                  (substitute* "net/tramp-sh.el"
+                  (substitute* "net/tramp.el"
                     ;; Patch the line after "(defcustom tramp-remote-path".
                     (("\\(tramp-default-remote-path")
                      (format #f "(tramp-default-remote-path ~s ~s ~s ~s "
-- 
2.36.1
L
L
Liliana Marie Prikler wrote on 22 Jun 21:47 +0200
0e3affe36e5a120aa42cdb2a38fa2bec7c5b287d.camel@gmail.com
Am Mittwoch, dem 22.06.2022 um 01:53 +0000 schrieb John Kehayias:
Toggle quote (2 lines)
> I've tested this patch builds, sets tramp-remote-path, and alleviates
> the sudo problem I also experienced (for local tramp). 
I saw, I reworded slightly, I pushed.

Toggle quote (2 lines)
> Maybe someone can relay this to the guix-devel thread mentioned in
> case there is more to be done as per the discussion there.
I don't think a discussion that is several months old has weight in
deciding what to do with relatively newer bugs. In any case, I think
our tramp fixes should at some point also end up in the actual tramp
package, not just emacs itself :)

That being said, thanks for the fix and have a nice evening
Closed
J
J
John Kehayias wrote on 22 Jun 22:06 +0200
(name . Liliana Marie Prikler)(address . liliana.prikler@gmail.com)(name . 55443@debbugs.gnu.org)(address . 55443@debbugs.gnu.org)
AkfejsQnw1AQkIxpB9Y8k8SniicNxAOsaVEuxMsQSST_xrpm6kAUTvWN0JqsMBZI4LAsYPwjl2tkC1ZNkpRACS5oD7Nhfedx0bwCoGcjnlA=@protonmail.com
Hello!

------- Original Message -------
On Wednesday, June 22nd, 2022 at 3:47 PM, Liliana Marie Prikler wrote:

Toggle quote (3 lines)
> I saw, I reworded slightly, I pushed.
>

Thanks!

Toggle quote (9 lines)
> > Maybe someone can relay this to the guix-devel thread mentioned in
> > case there is more to be done as per the discussion there.
>
> I don't think a discussion that is several months old has weight in
> deciding what to do with relatively newer bugs. In any case, I think
> our tramp fixes should at some point also end up in the actual tramp
> package, not just emacs itself :)
>

I didn't follow the discussion thread but thought it might be the same (or in addition to) this bug. In any event, sure let's leave that to the actual bug tracking.

And yes, we should see about getting this in emacs proper, they should have GNU's own Guix taken care of as well :)

Toggle quote (2 lines)
> That being said, thanks for the fix and have a nice evening

Thanks for the quick review and push, have a great day too!
L
L
Liliana Marie Prikler wrote on 23 Jun 07:26 +0200
(name . John Kehayias)(address . john.kehayias@protonmail.com)(name . 55443@debbugs.gnu.org)(address . 55443@debbugs.gnu.org)
8b411d7cab5f227874211fcc9281b4512cf577f1.camel@gmail.com
Am Mittwoch, dem 22.06.2022 um 20:06 +0000 schrieb John Kehayias:
Toggle quote (8 lines)
> [...]
> On Wednesday, June 22nd, 2022 at 3:47 PM, Liliana Marie Prikler
> wrote:
> > [O]ur tramp fixes should at some point also end up in the actual
> > tramp package, not just emacs itself :)
> [...]
> And yes, we should see about getting this in emacs proper, they
> should have GNU's own Guix taken care of as well :)
Actually, the point was to also have them in our emacs-tramp package,
which (like emacs-org) doesn't always receive the fixups that land in
the emacs package. Lots of work duplicated since Emacs vendors those.

Cheers
R
R
Remco van 't Veer wrote on 25 Jun 16:57 +0200
Re: bug#55443: closed (Re: [PATCH] gnu: emacs: Fix source snippet.)
(address . 55443@debbugs.gnu.org)
871qvcbxk0.fsf@remworks.net
Works for me, thank you!

Cheers,
Remco
?
Your comment

This issue is archived.

To comment on this conversation send email to 55443@debbugs.gnu.org