My project has multiple directories and I want to invoke the build command from 
any directory. My build system prints file path relative to the project root 
directory. Therefore, when I build it on the remote machine using emacs on the 
remote machine, I have to do this:

cd /abs/path/to/project_root ; ./build.sh

This makes emacs know that the file names in the compile errors starts from 
which directory and I can use the “next-error” command to load the file and 
jump to the right line.

However, when I run the compile command from tramp, this command fails with: 
“No such directory found via CDPATH environment variable”.

Although I can start the command with: /bin/bash -c "cd 
/abs/path/to/project_root ; ./build.sh”, it does not help because emacs does 
not know the relative file path in the compile error has changed to a different 
directory.

Is there a way to make this work under tramp?

Thanks!
-Wenguang

Reply via email to