Hello!
I am a little confused on the best way to approach developing R packages with multiple OS environments considered. I also happen to be new at developing packages in R, but I have been using R for a few years.
For instance, I have realized that In Windows 11, I used roxygen documentation methods and then used build site to build the .html docs to see how they rendered. I then copied this into my WSL Ubuntu 22.04 distro. Additionally, I may later be developing on my remote Ubuntu 20.04 server. When running build_site()
appears to behave differently when ported with an .Rproj.user
into a different system, creating an error with builds.build_site()
on Ubuntu 22.04, I ran into:
> devtools::build_site()
Caused by error in `file(con, "w")`:
! cannot open the connection
See `$stdout` and `$stderr` for standard output and error.
Type .Last.error to see the more details.
Backtrace:
1. devtools::build_site()
2. withr::with_temp_libpaths(action = "prefix", code = { …
3. base::force(code)
4. withr::with_output_sink(file_temp(), pkgdown::build_site(pkg = pkg$path, …
5. base::force(code)
6. pkgdown::build_site(pkg = pkg$path, ...)
7. pkgdown:::build_site_external(pkg = pkg, examples = examples, run_dont_run = run_dont_run, …
8. callr::r(function(..., cli_colors, pkgdown_internet) { …
9. callr:::get_result(output = out, options)
10. callr:::throw(callr_remote_error(remerr, output), parent = fix_msg(remerr[[3]]))
---
Subprocess backtrace:
1. pkgdown::build_site(...)
2. pkgdown:::build_site_local(pkg = pkg, examples = examples, run_dont_run = run_dont_run, …
3. pkgdown::init_site(pkg)
4. pkgdown:::build_site_meta(pkg)
5. pkgdown:::write_yaml(meta, path_meta)
6. pkgdown:::write_lines(yaml::as.yaml(x), path = path)
7. base::writeLines(enc2utf8(text), path, useBytes = TRUE)
8. base::file(con, "w")
9. base::.handleSimpleError(function (e) …
10. global h(simpleError(msg, call))
I'm not entirely sure what's going on here. I can confirm I have all dependencies - system, imports, and development - for using build_site()
. I also know the library I wrote works fine on my Windows system and Ubuntu and the only imports are dplyr
and lubridate
. Deleting .Rproj.user
did not work.
I expect to be running a server instance of Rstudio but was only running this on the terminal for the moment to see if it worked. I also expect to be running Ubuntu 22.04/20.04, Windows, and WSL2 at different times. I also expect to be working in these repositories with a small team across Arch and openSUSE in the future. Simply running all of these services in individual Docker containers is not an option in this circumstance, as much as I wish it were.
I guess my question is: for a newbie R package developer, what are some things I can do that consider a need to develop on multiple systems while seamlessly accessing the development environment? I might have missed a few things in the tutorials I read about devtools
but everything else seemed to go fine?
Thanks!