You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I open test.pl from projects/name, flymake works. However if I open it through the symbolic link "shortcut" then I get a "configuration error has occured... flymake will be switched off". Analyzing the log file, the problem is the temporary copy test_flymake.pl was not found! It was created correctly however:
[2013-08-17 11:33:07.549462] starting process on dir /home/peter/shortcut/
[2013-08-17 11:33:07.558302] started process 20470, command=(perl -wc ../projects/name/test_flymake.pl)
[2013-08-17 11:33:07.584354] received 85 byte(s) of output from process 20470
[2013-08-17 11:33:07.592350] received process output:
> Can't open perl script "../projects/name/test_flymake.pl": No such file or directory
>
At first look it seems the path is correct, but there is a problem. On Debian linux in bash, if I'm in a symbolic link that's pointing to a directory, cd .. takes me out of the "symbolic directory" (to where the symbolic link is), but executing a file with .. does not behave the same: it refers to the directory one level above the linked directory, NOT the symbolic link itself!
peter@atom:~$ ls -l
total 12
-rw-r--r-- 1 peter peter 4758 Aug 17 11:35 flymake.log
drwxr-xr-x 3 peter peter 4096 Aug 17 11:25 projects
lrwxrwxrwx 1 peter peter 25 Aug 17 11:27 shortcut -> /home/peter/projects/name
peter@atom:~/shortcut$ cd ..
peter@atom:~$
peter@atom:~$ cd shortcut
peter@atom:~/shortcut$ ls ..
name
I would have too, expected ls .. to list the home directory, but it lists ~/projects instead, that's why the file is not found!
The text was updated successfully, but these errors were encountered:
Right, but still, there is a lot of Emacs code out there (including inside flymake.el) that still calls file-relative-name in a way that exhibits this issue. Here is a workaround:
(defun with-noop-file-relative-name
(orig &rest init-args)
"Ensures that `file-relative-name' does nothing while calling ORIG."
(cl-letf (((symbol-function 'file-relative-name)
(lambda (orig-name &rest ignores) orig-name)))
(apply orig init-args)))
And then, advise every function such as php-flymake-php-init that relies internally on file-relative-name:
Consider the following scenario:
~/projects/name/test.pl
~/shortcut -> ~/projects/name
If I open test.pl from projects/name, flymake works. However if I open it through the symbolic link "shortcut" then I get a "configuration error has occured... flymake will be switched off". Analyzing the log file, the problem is the temporary copy test_flymake.pl was not found! It was created correctly however:
At first look it seems the path is correct, but there is a problem. On Debian linux in bash, if I'm in a symbolic link that's pointing to a directory, cd .. takes me out of the "symbolic directory" (to where the symbolic link is), but executing a file with .. does not behave the same: it refers to the directory one level above the linked directory, NOT the symbolic link itself!
I would have too, expected
ls ..
to list the home directory, but it lists ~/projects instead, that's why the file is not found!The text was updated successfully, but these errors were encountered: