r-lib / pkgbuild

Find tools needed to build R packages
https://pkgbuild.r-lib.org
Other
65 stars 33 forks source link

Failed build errors have a lot of duplication #117

Closed gaborcsardi closed 2 years ago

gaborcsardi commented 3 years ago

E.g.

❯ R -q -e 'pkgbuild::build()'
> pkgbuild::build()
✔  checking for file ‘/Users/gaborcsardi/works/failrmd/DESCRIPTION’ ...
─  preparing ‘failrmd’:
✔  checking DESCRIPTION meta-information ...
─  installing the package to build vignettes
E  creating vignettes (1.7s)
   --- re-building ‘fail.Rmd’ using rmarkdown
   Quitting from lines 22-23 (fail.Rmd)
   Error: processing vignette 'fail.Rmd' failed with diagnostics:
   This is an error!
   --- failed re-building ‘fail.Rmd’

   SUMMARY: processing the following file failed:
     ‘fail.Rmd’

   Error: Vignette re-building failed.
   Execution halted

Error: System command 'R' failed, exit status: 1, stdout + stderr:
E> * checking for file ‘/Users/gaborcsardi/works/failrmd/DESCRIPTION’ ... OK
E> * preparing ‘failrmd’:
E> * checking DESCRIPTION meta-information ... OK
E> * installing the package to build vignettes
E> * creating vignettes ... ERROR
E> --- re-building ‘fail.Rmd’ using rmarkdown
E> Quitting from lines 22-23 (fail.Rmd)
E> Error: processing vignette 'fail.Rmd' failed with diagnostics:
E> This is an error!
E> --- failed re-building ‘fail.Rmd’
E>
E> SUMMARY: processing the following file failed:
E>   ‘fail.Rmd’
E>
E> Error: Vignette re-building failed.
E> Execution halted

 Stack trace:

 1. pkgbuild::build()
 2. withr::with_temp_libpaths(rcmd_build_tools(options$cmd, c(options ...
 3. base:::force(code)
 4. pkgbuild:::rcmd_build_tools(options$cmd, c(options$path, options$ ...
 5. pkgbuild:::with_build_tools(callr::rcmd_safe(..., env = env,  ...
 6. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE,  ...
 7. callr:::run_r(options)
 8. base:::with(options, with_envvar(env, do.call(processx::run,  ...
 9. base:::with.default(options, with_envvar(env, do.call(processx::r ...
 10. base:::eval(substitute(expr), data, enclos = parent.frame())
 11. base:::eval(substitute(expr), data, enclos = parent.frame())
 12. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args  ...
 13. base:::force(code)
 14. base:::do.call(processx::run, c(list(bin, args = real_cmdargs,  ...
 15. (function (command = NULL, args = character(), error_on_status = TRUE,  ...
 16. throw(new_process_error(res, call = sys.call(), echo = echo,  ...

 x System command 'R' failed, exit status: 1, stdout + stderr:
E> * checking for file ‘/Users/gaborcsardi/works/failrmd/DESCRIPTION’ ... OK
E> * preparing ‘failrmd’:
E> * checking DESCRIPTION meta-information ... OK
E> * installing the package to build vignettes
E> * creating vignettes ... ERROR
E> --- re-building ‘fail.Rmd’ using rmarkdown
E> Quitting from lines 22-23 (fail.Rmd)
E> Error: processing vignette 'fail.Rmd' failed with diagnostics:
E> This is an error!
E> --- failed re-building ‘fail.Rmd’
E>
E> SUMMARY: processing the following file failed:
E>   ‘fail.Rmd’
E>
E> Error: Vignette re-building failed.
E> Execution halted

Execution halted

Some of this should be fixed at https://github.com/r-lib/processx/issues/307

Interactive mode is better, although that is also somewhat duplicated:

❯ pkgbuild::build()
✔  checking for file ‘/Users/gaborcsardi/works/failrmd/DESCRIPTION’ ...
─  preparing ‘failrmd’:
✔  checking DESCRIPTION meta-information ...
─  installing the package to build vignettes
E  creating vignettes (1.6s)
   --- re-building ‘fail.Rmd’ using rmarkdown
   Quitting from lines 22-23 (fail.Rmd)
   Error: processing vignette 'fail.Rmd' failed with diagnostics:
   This is an error!
   --- failed re-building ‘fail.Rmd’

   SUMMARY: processing the following file failed:
     ‘fail.Rmd’

   Error: Vignette re-building failed.
   Execution halted
Error in (function (command = NULL, args = character(), error_on_status = TRUE,  :
  System command 'R' failed, exit status: 1, stdout + stderr (last 10 lines):
E> Quitting from lines 22-23 (fail.Rmd)
E> Error: processing vignette 'fail.Rmd' failed with diagnostics:
E> This is an error!
E> --- failed re-building ‘fail.Rmd’
E>
E> SUMMARY: processing the following file failed:
E>   ‘fail.Rmd’
E>
E> Error: Vignette re-building failed.
E> Execution halted
Type .Last.error.trace to see where the error occurred
gaborcsardi commented 2 years ago

For the record, this looks much better now with https://github.com/r-lib/callr/pull/227:

❯ R -q -e 'pkgbuild::build()'
> pkgbuild::build()
✔  checking for file ‘/Users/gaborcsardi/works/failrmd/DESCRIPTION’ ...
─  preparing ‘failrmd’:
✔  checking DESCRIPTION meta-information ...
─  installing the package to build vignettes
E  creating vignettes (947ms)
   --- re-building ‘fail.Rmd’ using rmarkdown
   Quitting from lines 22-23 (fail.Rmd)
   Error: processing vignette 'fail.Rmd' failed with diagnostics:
   This is an error!
   --- failed re-building ‘fail.Rmd’

   SUMMARY: processing the following file failed:
     ‘fail.Rmd’

   Error: Vignette re-building failed.
   Execution halted
Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
! System command 'R' failed
---
Exit status: 1
stdout & stderr: <printed>
---
Backtrace:
 1. pkgbuild::build()
 2. withr::with_temp_libpaths(rcmd_build_tools(options$cmd, c(options$path, … at build.R:54:3
 3. base::force(code)
 4. pkgbuild::rcmd_build_tools(options$cmd, c(options$path, options$args), … at build.R:54:3
 5. pkgbuild::with_build_tools({ … at rcmd.R:32:3
 6. base::withCallingHandlers(callr::rcmd_safe(..., env = env, spinner = FALSE, … at rcmd.R:33:5
 7. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE, … at rcmd.R:33:5
 8. callr:::run_r(options) at rcmd.R:64:3
 9. base::with(options, with_envvar(env, do.call(processx::run, c(list(bin, … at run.R:17:3
10. base::with.default(options, with_envvar(env, do.call(processx::run, …
11. base::eval(substitute(expr), data, enclos = parent.frame())
12. base::eval(substitute(expr), data, enclos = parent.frame())
13. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmdargs, …
14. base::force(code) at utils.R:66:3
15. base::do.call(processx::run, c(list(bin, args = real_cmdargs, stdout_line_callba… at utils.R:66:3
16. (function (command = NULL, args = character(), error_on_status = TRUE, …
17. base::throw(new_process_error(res, call = sys.call(), echo = echo, … at run.R:256:5
18. | base::signalCondition(cond) at errors.R:223:5
19. (function (e) …
20. asNamespace("callr")$err$throw(e) at rcmd.R:38:9
Execution halted