Regarding your question: IIRC, when you use tramp on emacs, commands executed on remote files are executed remotely as well (for example, a vc-checkin is not executed locally but on the origin-host of the file/buffer you're editing). Though I am sure that this worked on version control commands, I am not sure whether it works on compile commands per default, but a little emacs lisp surely solves this problem...