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

intermediates_dir causes rename warnings #1224

Closed
aronatkins opened this issue Dec 19, 2017 · 5 comments
Closed

intermediates_dir causes rename warnings #1224

aronatkins opened this issue Dec 19, 2017 · 5 comments
Milestone

Comments

@aronatkins
Copy link
Contributor

Using intermediates_dir causes rename warnings. Perhaps similar to #1190.

---
title: rename warnings
output: html_document
---

```{r echo=FALSE}
data <- c(
  red = 2,
  blue = 4,
  brown = 7,
  white = 3
)

barplot(data, col = heat.colors(length(data)), las = 2)
```

Command used to render:

rmarkdown::render(
    input = "~/Downloads/slash/index.Rmd", 
    output_dir = "~/Downloads/slash/target", 
    intermediates_dir = tempdir(), 
    envir = new.env(), 
    output_options = list(self_contained = TRUE))
Output created: index.html
Warning messages:
1: In file.rename(from, to) :
  cannot rename file '/Users/aron/Downloads/slash/target/index_files/figure-html' to '/private/var/folders/ts/s940qvdj5vj1czr9qh07fvtw0000gn/T/RtmpnYIsk2//Users/aron/Downloads/slash/target/index_files/figure-html', reason 'No such file or directory'
2: In file.rename(from, to) :
  cannot rename file '/private/var/folders/ts/s940qvdj5vj1czr9qh07fvtw0000gn/T/RtmpnYIsk2//Users/aron/Downloads/slash/target/index_files/figure-html' to '/Users/aron/Downloads/slash/target/index_files/figure-html', reason 'No such file or directory'

Removing the intermediates_dir argument eliminates the warning.

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.1

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] compiler_3.4.3  backports_1.1.1 magrittr_1.5    rprojroot_1.2   htmltools_0.3.6 tools_3.4.3    
 [7] yaml_2.1.16     Rcpp_0.12.14    stringi_1.1.6   rmarkdown_1.8.5 knitr_1.17      stringr_1.2.0  
[13] digest_0.6.12   evaluate_0.10.1

Installed rmarkdown from github; using SHA 9f45f00 to verify that this is still present in HEAD.

I then installed rmarkdown from SHA 61ec71932020b38c581bd9b9eed00b412d09a8d5; the warning does not occur.

Looks like a regression since rmarkdown-1.6.

@aronatkins
Copy link
Contributor Author

/CC @scottmmjackson @joncfoo

@aronatkins
Copy link
Contributor Author

aronatkins commented Mar 16, 2018

This is probably duplicated by #1288. (edited to fix issue cross-reference)

@kevinushey
Copy link
Contributor

This also occurs for plain old runtime: shiny documents. For example:

---
title: "Warning in file.rename(from, to)"
runtime: shiny
---

```{r}
plot(1)
```

If I try to run this document in the RStudio IDE (with Run Document) I see:


  |......................                                           |  33%
  ordinary text without R code

  |...........................................                      |  67%
label: unnamed-chunk-1


processing file: run.Rmd
  |.................................................................| 100%
  ordinary text without R code


/usr/local/bin/pandoc +RTS -K512m -RTS /private/var/folders/qt/txb728ms5012wp_4yn369wth0000gn/T/RtmpbixrWP/run.utf8.md --to html4 --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+smart --output /private/var/folders/qt/txb728ms5012wp_4yn369wth0000gn/T/RtmpbixrWP/file535c35790a0f.html --email-obfuscation none --standalone --section-divs --template /Users/kevin/Library/R/3.5/library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --id-prefix section- --variable 'theme:bootstrap' --mathjax --variable 'mathjax-url:https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' 
output file: /private/var/folders/qt/txb728ms5012wp_4yn369wth0000gn/T/RtmpbixrWP/run.knit.md

Warning in file.rename(from, to) :
  cannot rename file '/private/var/folders/qt/txb728ms5012wp_4yn369wth0000gn/T/RtmpbixrWP/file535c35790a0f_files/figure-html' to '/private/var/folders/qt/txb728ms5012wp_4yn369wth0000gn/T/RtmpbixrWP//private/var/folders/qt/txb728ms5012wp_4yn369wth0000gn/T/RtmpbixrWP/file535c35790a0f_files/figure-html', reason 'No such file or directory'
Warning in file.rename(from, to) :
  cannot rename file '/private/var/folders/qt/txb728ms5012wp_4yn369wth0000gn/T/RtmpbixrWP//private/var/folders/qt/txb728ms5012wp_4yn369wth0000gn/T/RtmpbixrWP/file535c35790a0f_files/figure-html' to '/private/var/folders/qt/txb728ms5012wp_4yn369wth0000gn/T/RtmpbixrWP/file535c35790a0f_files/figure-html', reason 'No such file or directory'

Output created: /private/var/folders/qt/txb728ms5012wp_4yn369wth0000gn/T/RtmpbixrWP/file535c35790a0f.html

@yihui yihui added this to the v1.11 milestone Dec 6, 2018
@yihui yihui closed this as completed in e7a9eaf Dec 6, 2018
@yihui
Copy link
Member

yihui commented Dec 6, 2018

Both the original and the later shiny issues should be fixed now. Thanks for the report!

yihui added a commit to RLesur/rmarkdown that referenced this issue Apr 1, 2019
yihui added a commit to RLesur/rmarkdown that referenced this issue Apr 1, 2019
… if it is an absolute path

in fact, intermediates_loc(figures_dir) will be a wrong path like /tmp/foo/bar/.../tmp/foo/bar/... when figure_dir and intermediates_dir are both absolute

this also fixes rstudio#1288
@github-actions
Copy link

github-actions bot commented Nov 3, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants