-
-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flycheck with Tramp over SSH not working for Python files #1816
Comments
Hi there, and thanks for the report! We don't officially support checking over tramp, AFAIK (see #54), though I'd love for us to do this reliably. Is this something you would be interested in working on? Also, this part: pylint.el doesn't call any external process; can you point to that discussion? I didn't see it in your link. |
I might be able to help with Tramp integration. Since I'm not a flycheck user, I'd need some guidance. At least a short recipe for testing. |
Thanks a lot @albinus , your help would be much appreciated :) We need someone to drive the process, and I'm swamped with work these days, but once we have a volunteer it should be quick and easy. In my experience, porting packages to work with Tramp is very easy; I've done it a few times before, including for modes that use Flycheck's more general APIs (Flycheck has two APIs: one for command-line checkers that respond on stdin, and one for subprocesses, which is useful to chache results from run to run, with LSP, etc.). So really the only thing to do here is to change the simplified Flycheck API for command-line checkers to use the right process-starting calls, and to adjust the other places that start processes (to check if a particular checker is available, for example). I recently did some refactoring of that code to make all thee calls go through one function, so it shouldn't be hard. |
Hi There, |
Slightly related: I'm also interested in supporting flycheck-clj-kondo, a linter for Clojure, in tramp-mode: Preferably the |
That would be great.
Nice! ELisp programming is never boring :) The right way to do this would be to get familiar with tramp by reading its manual first; that will tell you which APIs need to change, I think. Then you'd audit the Flycheck code to determine which places need changes, and change these. And finally you'd write tests to make sure that things work. A few difficulties that will likely pop up: looking in the right places for configuration files; locating executables (and modules for python, R, and probably a few other checkers); invoking processes the right way. We might also want to set appropriate timeouts here and there, since Flycheck currently assumes that disk access and sending stuff to processes is fast, so it does it in a blocking way. If it can hang, we might want to be more careful. |
I believe this applies to #1777 as well. In
should look something like:
for remote files. I understand this isn't a complete nor proper solution. I simply mean this as an example. With this change, running
Without:
Unfortunately, running
I'm hoping someone more knowledgeable with flycheck.el could point me to the other places I should look to come up with a complete and proper solution. Thanks! |
Tom Vaughan <[email protected]> writes:
Hi Tom,
I believe this applies to #1777 as well. In
flycheck-checker-shell-command this:
(concat command " < " (shell-quote-argument (buffer-file-name)))
should look something like:
(concat command " < " (shell-quote-argument (file-remote-p (buffer-file-name) 'localname)))
for remote files. I understand this isn't a complete nor proper
solution. I simply mean this as an example.
Yes, this is the recommended way to go. However, if (buffer-file-name)
returns a local file name, it doesn't work, because (file-remote-p ...)
would return nil.
Therefore, we have (since Emacs 26.1) the function file-local-name. So
your change should be
(concat command " < " (shell-quote-argument (file-local-name (buffer-file-name))))
Here and everywhere, a file name is use as argument of a (possibly
remote) process.
Best regards, Michael.
|
Awesome. Thank you @albinus. This is exactly the sort of feedback I was fishing for |
I got similar case on flycheck for python.
Is this the same cause? |
I get a similar error with
In "normal" flycheck usage, ie. when I just navigate and change a remote buffer, I get the following error message in the minibuffer:
I also tried changing the |
Please see #1842 |
Any news about this? It's unfortunate this issue got so little attention, it completely prevents the use of TRAMP with python. @carrete I've tried your fix but unfortunately all checkers gave one of the following error:
|
Is anyone able to verify and merge #1842? |
@xelibrion I've been using this daily since I posted the pull-request and everything seems to work ok. The tests pass for me when I run them locally, but they fail on Travis CI. I've rebased my branch several times in the hopes that this might magically fix things, alas no such luck. I've sort of given up at this point |
Another +1 on getting #1842 out from a user that would be very grateful :) |
Hi! Thanks for working on getting tramp support. Any reason why #1922 has not been merged yet? |
Yes: no-one has (had time to / volunteered to) do a thorough review of it |
Thanks for the quick response! No pressure; I was just curious because I have had problems with |
Thanks for setting this up! I've been trying to use the latest commit on #1842 . However, running into some issues when trying to run pylint. TL;DR is that pylint creates temporary flycheck files, yet it takes the path of the remote file I'm editing (without the What's the expected location for the executables, local or remote? I had to manually set
I thought it was a little odd that Flycheck Mode was disabled, despite having set
Does anyone know what's going on here? I've tried to use a remote executable, which would indeed run pylint/flycheck on a remote file - yet would be extremely laggy when I would edit the file, as it kept repeatedly opening tramp connections. Any help would be much appreciated! |
Checklist
Bug description
Flycheck seems not to work correctly with Tramp Mode on remote files. My setup etc. is described in this post on Emacs Stackexchange.
Steps to reproduce
Confer link.
Expected behavior
Someone from the ´[email protected]´ offered help (you may contact him, as I understood) and pointed out:
call-process' (shall be
process-file'), andstart-process' (shall be
start-file-process')."uses (aref (tramp-dissect-file-name filename) 3) [...]; [...] it shall use (file-local-name filename) .
System configuration
Confer link.
Emacs configuration:
Additional notes
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: