emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Иван Трусков" <trus19@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [BUG]C source block evaluation fails over pscp
Date: Tue, 31 Oct 2017 15:02:19 +0300	[thread overview]
Message-ID: <CAEc-S=_n683eWPaCteGQsU-XopezW8VTiSBUm-UvyLNRak1H7g@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3188 bytes --]

I am working on Windows machine with org file with C source block. I want
to evaluate code block on remote machine accessible to me with PuTTY. Here
is relevant part of the org file:

#+PROPERTY: header-args :noweb yes :results verbatim :dir /pscp:tcl:/home/tc

Now, let us move to the green fields of user input.

#+NAME: echo_arguments
#+BEGIN_SRC C :main no
  #include <stdio.h>

  int main(int argc, const char* argv[])
  {
      printf("Has %d arguments\n", argc);
      for(int i = 0; i < argc; ++i)
          printf("Argument %d:\n%s\n", i, argv[i]);
      return 0;
  }

#+END_SRC

Evaluation of source block results in error with the following message:

Spawning child process: invalid argument

Full messages output is

executing C code block (echo_arguments)...
Continue...
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760k9p.c to
/pscp:tcl:/tmp/C-src-5760Xzj.c...
Tramp: Waiting for prompts from remote shell...
Tramp: Process has finished.
Tramp: Waiting for prompts from remote shell...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760k9p.c to
/pscp:tcl:/tmp/C-src-5760Xzj.c...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760-R2.exe to
/pscp:tcl:/tmp/C-bin-5760xHw.exe...
Tramp: Waiting for prompts from remote shell...
Tramp: Process has finished.
Tramp: Waiting for prompts from remote shell...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760-R2.exe to
/pscp:tcl:/tmp/C-bin-5760xHw.exe...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760wbF.c to
/pscp:tcl:/tmp/C-src-5760Xzj.c...
Tramp: Waiting for prompts from remote shell...
Tramp: Process has finished.
Tramp: Waiting for prompts from remote shell...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760wbF.c to
/pscp:tcl:/tmp/C-src-5760Xzj.c...done
Break
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760KwR to
/pscp:tcl:/tmp/ob-input-57609lL...
Tramp: Waiting for prompts from remote shell...
Tramp: Process has finished.
Tramp: Waiting for prompts from remote shell...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760KwR to
/pscp:tcl:/tmp/ob-input-57609lL...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760kEe to
/pscp:tcl:/tmp/ob-error-5760X6X...
Tramp: Waiting for prompts from remote shell...
Tramp: Process has finished.
Tramp: Waiting for prompts from remote shell...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760kEe to
/pscp:tcl:/tmp/ob-error-5760X6X...done
Copying c:/Users/Ivan/AppData/Local/Temp/tramp.5760xOk to
/pscp:tcl:/tmp/ob-input-57609lL...failed
edebug-signal: Spawning child process: invalid argument

Debugging shows that error occurs inside function org-babel-eval when call
to
 org-babel--shell-command-on-region is made at the line 105 of org-eval.el.
The line is:

(write-region start end input-file)

There are two things that seem strange:

1. Region is actually empty - input region for C file compilation is empty.
2. There is no problem in writing to remote machine. C source file is
written to location needed.
3. Command line is
"gcc -o \"/tmp/C-bin-5760L4M.exe\"  \"/tmp/C-src-5760xjA.c\" "
   If that command line is executed on remote machine, compilation succeeds

Was that error introduced in some recen org version?

[-- Attachment #2: Type: text/html, Size: 3835 bytes --]

                 reply	other threads:[~2017-10-31 12:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAEc-S=_n683eWPaCteGQsU-XopezW8VTiSBUm-UvyLNRak1H7g@mail.gmail.com' \
    --to=trus19@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).