From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Austin F. Frank" Subject: Re: with-parsed-tramp-file-name Date: Thu, 30 Sep 2010 09:28:57 -0400 Message-ID: References: <87iq1nsoxl.fsf@noorul.maa.corp.collab.net> <87sk0rr57k.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0766986728==" Return-path: Received: from [140.186.70.92] (port=39194 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P1JCK-0000Wd-IK for emacs-orgmode@gnu.org; Thu, 30 Sep 2010 09:29:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1P1JCF-0007W1-K8 for emacs-orgmode@gnu.org; Thu, 30 Sep 2010 09:29:20 -0400 Received: from lo.gmane.org ([80.91.229.12]:55008) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1P1JCF-0007Vs-5Y for emacs-orgmode@gnu.org; Thu, 30 Sep 2010 09:29:15 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1P1JCD-0003nl-Dn for emacs-orgmode@gnu.org; Thu, 30 Sep 2010 15:29:13 +0200 Received: from c-71-233-154-110.hsd1.ct.comcast.net ([71.233.154.110]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Sep 2010 15:29:13 +0200 Received: from austin.frank by c-71-233-154-110.hsd1.ct.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Sep 2010 15:29:13 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --===============0766986728== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, Sep 30 2010, Dan Davison wrote: > Just btw, I use Org every day at the moment (with emacs24) to execute > code (mostly R) on remote machines. The method I use is to store all > Org files locally, and use the :dir header argument to specify the > machine on which to run R, e.g. At some point I was (naively?) worried about the portability of this kind of path. Additionally, I do sometimes want to run things locally, like if I'm offline. Because a file that is opened over TRAMP usually transparently starts processes over TRAMP, and because it's less typing, and because of my untested portability concern, I have stuck to using the edit-and-execute over TRAMP method, with all paths defined relative to the edited file. > #+babel: :dir /davison@oak.well.ox.ac.uk:~/bench > [...] > #+begin_src R > system("hostname", intern=3DTRUE) > #+end_src > > #+results: > : oak > > Do you get the same error evaluating R remotely using this method? I do, when using the previously-reported config file. > What's your emacs version? GNU Emacs 24.0.50.7 (powerpc-apple-darwin8.11.0, NS apple-appkit-824.48) of 2010-09-30 > I don't see tramp-sh in emacs23; I do see it in emacs24. Yup, I use emacs24 built from a checkout from the git mirror of the bzr sources. > How about we test this simple source block: > > #+begin_src R > system("hostname", intern=3DTRUE) > #+end_src > > in a file on the remote machine opened using C-x C-f with the > /user@machine:path/to/file syntax, with this minimal config: > > (add-to-list 'load-path "/PATH/TO/ess/lisp") > (require 'ess-site) > (add-to-list 'load-path "/PATH/TO/org-mode/lisp") > (require 'org-install) > (setq debug-on-error t) > (org-babel-do-load-languages > 'org-babel-load-languages > '((R . t))) > > I suspect part of the problem is to do with those (require tramp...) > lines in your config. Could you try without those lines, and without > > (add-to-list 'tramp-remote-path 'tramp-own-remote-path) I can try this for debugging, but I do need that configuration option eventually. I build R and install R packages within my home directory on the server in question. Without 'tramp-own-remote-path my R packages aren't found by the R process. Also, this > Instead, could you try > > (setq org-babel-R-command "/PATH/TO/R/EXECUTABLE --slave --no-save") is not a portable solution, as on my local machine I use /usr/local/bin/R and on the remote machine I use ~/bin/R. I suppose I could setup a conditional assignment based on host name, but since I already know 'tramp-own-remote-path works, that's my preferred option. Also, all of the results below are unchanged when I explicitly set the org-babel-R-command. Results: 1. This file, opened locally: =2D-8<---------------cut here---------------start------------->8--- #+begin_src emacs-lisp (add-to-list 'load-path "/usr/local/share/emacs/site-lisp") (require 'ess-site) (add-to-list 'load-path (expand-file-name "~/src.remote/org-mode/lisp")) (require 'org-install) (setq debug-on-error t) (org-babel-do-load-languages 'org-babel-load-languages '((R . t))) #+end_src #+results: | (R . t) | #+begin_src R :dir /bcs:~/ system("hostname", intern=3DTRUE) #+end_src =2D-8<---------------cut here---------------end--------------->8--- =20=20=20=20 Gives this backtrace: #v+ Debugger entered--Lisp error: (void-function org-babel-temp-file) org-babel-temp-file("R-") org-babel-R-evaluate-external-process("system(\"hostname\", intern=3DTRUE= )" value nil nil) org-babel-R-evaluate(nil "system(\"hostname\", intern=3DTRUE)" value nil = nil) org-babel-execute:R("system(\"hostname\", intern=3DTRUE)\n" ((:cache . "n= o") (:comments . "") (:dir . "/bcs:~/") (:exports . "code") (:hlines . "no"= ) (:noweb . "no") (:results . "replace") (:session . "none") (:shebang . ""= ) (:tangle . "no"))) org-babel-execute-src-block(nil ("R" "system(\"hostname\", intern=3DTRUE)= \n" ((:cache . "no") (:comments . "") (:dir . "/bcs:~/") (:exports . "code"= ) (:hlines . "no") (:noweb . "no") (:results . "replace") (:session . "none= ") (:shebang . "") (:tangle . "no")) "" nil nil 0)) org-babel-execute-src-block-maybe() run-hook-with-args-until-success(org-babel-execute-src-block-maybe) org-ctrl-c-ctrl-c(nil) call-interactively(org-ctrl-c-ctrl-c nil nil) #v- This is also true if I explicitly set `org-babel-R-command' in the emacs-lisp source block, as well as if I explicitly (require 'ob). This feels to me like it isn't even getting to the point where the TRAMP errors could arise. >> If I manually load ob.el by M-x load-file with Location as >> /path/to/ob.el then C-c C-c works. But (require 'ob) is not >> working. Am I missing something? With the above minimal config file edited locally with a remote execution directory, I get the same as Noruul. The above error disappears if I (load-file "~/src.remote/org-mode/lisp/ob.el"). I also no longer get the TRAMP error I originally reported. > Noruul, what does (featurep 'ob) evaluate to before you manually attempt > the (require 'ob) ? And what goes wrong when you do the require? (featurep 'ob) reports `t' for me, before a (require 'ob). (fboundp #'org-babel-temp-file) and (fboundp #'with-parsed-tramp-file-name) both return nil. After I explicitly load, org-babel-tempfile is defined (but this does NOT work with just (require 'ob), as reported by Noruul). After I (require 'tramp), (fboundp #'with-parsed-tramp-file-name) is `t'. After I (require 'tramp-sh), (boundp 'tramp-remote-path) is `t'. It looks to me like there are two issues affecting my original report. The first is that with (require 'org-install) and even with (require 'ob), certain babel-related functions aren't being exported (don't know if that's the right term). The second is that I _need_ to be able to add 'tramp-own-remote-path to 'tramp-remote-path, which at least on my system requires doing (require 'tramp) and (require 'tramp-sh). That is, presumably, a TRAMP bug. Some interaction with explicitly requiring the tramp packages and then trying to use org-babel's remote functions seems to be messing things up. > If (part of) this is an issue of tramp differences between emacs23 and > 24 then the tramp author Michael Albinus has already been extremely > helpful on several occasions with tramp issues and I am confident he > will be able to advise. Thanks for all of your help already. I'm sure we'll chase this down. /au =2D-=20 Austin Frank http://aufrank.net GPG Public Key (D7398C2F): http://aufrank.net/personal.asc --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (Darwin) iEYEARECAAYFAkykkJkACgkQlHMl2/XbR4HYSACgmJs0KhF9/iYnxFZyC2GZa3Cu snMAnA19FxHkdZ7bwbd+wIlTqAl1Mioy =hYGi -----END PGP SIGNATURE----- --=-=-=-- --===============0766986728== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0766986728==--