Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear build instructions and tmuxr failure #144

Open
gl-yziquel opened this issue Sep 27, 2023 · 2 comments
Open

Unclear build instructions and tmuxr failure #144

gl-yziquel opened this issue Sep 27, 2023 · 2 comments

Comments

@gl-yziquel
Copy link

Hi.

I've been trying to build the book from source on ubuntu.

The documentation is rather unclear as to how this book should be built.

After some dependency hunting, I am now hitting the following wall, which seems to be linked to tmuxr behaviour:

mini-me@virtucon ~/h/c/d/b/2e (master)> Rscript --vanilla -e 'bookdown::render_book("index.Rmd", encoding = "UTF-8", clean = FALSE)'
processing file: index.Rmd
output file: index.knit.md
processing file: foreword.Rmd
output file: foreword.knit.md
processing file: preface.Rmd
output file: preface.knit.md
processing file: 01.Rmd
  |.......                                             |  13% [console_start]  
Quitting from lines 6-7 [console_start] (01.Rmd)
Error:
! tmux: can't find pane: %405
Backtrace:
  1. global console_start()
  2. knitractive::start(...)
  3. engine$start()
  4. rexpect::expect_prompt(self$session)
  5. rexpect::ends_with_prompt(session)
  8. rexpect::read_last_line(session)
  9. tmuxr::capture_pane(session, start = n, end = n)
 10. tmuxr::tmux_command("capture-pane", flags)
Execution halted
Error in Rscript_render(f, render_args, render_meta, add1, add2) : 
  Failed to compile 01.Rmd
Calls: <Anonymous> -> render_new_session -> Rscript_render
Execution halted
mini-me@virtucon ~/h/c/d/b/2e (master) [1]> 

Is this behaviour potentially linked to the fact that I am already using tmux for my daily work ? (I've been building this OUT of tmux, but with another tmux running along, which is necessary for my current work, and which I cannot kill; when building INSIDE tmux, the command above kills the pane in which it is being executed, which is unfortunate.)

@kurokirasama
Copy link

I'm getting this error:

processing file: index.Rmd
                                                                                                            
output file: index.knit.md



processing file: foreword.Rmd
                                                                                          
output file: foreword.knit.md



processing file: preface.Rmd
                                                                                                            
output file: preface.knit.md



processing file: 01.Rmd
  |.......                                             |  13% [console_start]  Error:
! ! Native call to `processx_exec` failed
Caused by error in `chain_call(c_processx_exec, command, c(command, args), pty, pty_options, …`:
! cannot start processx process 'tmux' (system error 2, No such file or directory) @unix/processx.c:611 (processx_exec)
Backtrace:
  1. global console_start()
 14. base::.handleSimpleError(...)
 15. h(simpleError(msg, call))
 16. throw_error(err, parent = e)

Quitting from lines 6-7 [console_start] (01.Rmd)
                                                                                                            
Execution halted
Error in `process_initialize(self, private, command, args, stdin, stdout, …`:
! Native call to `processx_exec` failed
Caused by error in `chain_call(c_processx_exec, command, c(command, args), pty, pty_options, …`:
! cannot start processx process 'tmux' (system error 2, No such file or directory) @unix/processx.c:611 (processx_exec)
---
Backtrace:
 1. base::(function (e) …
 2. .subset2(e, "finalize")()
 3. self$stop()
 4. rexpect::exit(self$session)
 5. tmuxr::kill_pane(session$pane)
 6. tmuxr::tmux_command("kill-pane", flags)
 7. processx::run(getOption("tmux_binary", "tmux"), args = c(tmux_options, …
 8. process$new(command, args, echo_cmd = echo_cmd, wd = wd, windows_verbatim_args = windows_verb…
 9. local initialize(...)
10. processx:::process_initialize(self, private, command, args, stdin, stdout, …
11. processx:::chain_call(c_processx_exec, command, c(command, args), pty, pty_options, …
12. | base::withCallingHandlers(do.call(".Call", list(.NAME, ...)), error = function(e) { …
13. | base::do.call(".Call", list(.NAME, ...))
14. | base::.handleSimpleError(function (e) …
15. | local h(simpleError(msg, call))
16. | processx:::throw_error(err, parent = e)
Error in Rscript_render(f, render_args, render_meta, add1, add2) : 
  Failed to compile 01.Rmd
Calls: <Anonymous> -> render_new_session -> Rscript_render
Execution halted

@cameronj86
Copy link

cameronj86 commented Oct 22, 2024

FYI: If you just want to create the ePub without the interactive command-line elements, you can modify the Rmd files to skip those parts. (It was getting a little in the weeds for me installing tmux into my Rstudio docker container lol):

# Backup first
cp -r . ../book_backup

# Comment out the console blocks
sed -i '/^```{r console_start/,/^```$/s/^/# /' *.Rmd
sed -i '/^```{console setup_history/,/^```$/s/^/# /' *.Rmd
# (Assistance from Claude AI)

Hopefully it doesn't detract too much from the overall experience of the book

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants