tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to run compile command on remote machine with a different directory


From: Wenguang Wang
Subject: How to run compile command on remote machine with a different directory
Date: Fri, 10 Apr 2020 22:24:46 -0700

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

[Prev in Thread] Current Thread [Next in Thread]