Closed HenrikBengtsson closed 4 years ago
Lots of tests end up trying to fix ~/.Rprofile if it does not have a newline at the end, e.g. with
$ printf "#" > ~/.Rprofile
$ chmod ugo-w ~/.Rprofile
we get:
── Test failures ────────────────────────────────────────────────────── api ────
> options(startup.dryrun = TRUE)
>
> message("*** api() ...")
*** api() ...
>
> message("*** api()")
*** api()
> api <- startup:::api()
> stopifnot(is.list(api), length(api) > 0)
>
> message("*** renviron_d()")
*** renviron_d()
> res <- startup::renviron_d()
> stopifnot(all.equal(res, api))
>
> message("*** rprofile_d()")
*** rprofile_d()
> res <- startup::rprofile_d()
Backed up R startup file: '~/.Rprofile' (1 bytes) -> '~/.Rprofile.bak.20200902-194354' (1 bytes)
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
cannot open file '/home/hb/.Rprofile': Permission denied
Error in check_rprofile_eof(all = all, fix = fix, backup = backup, debug = debug) :
startup::check(): SYNTAX ERROR: Tried to add missing newline to the end of file ~/.Rprofile, which otherwise would cause R to silently ignore the file in the startup process, but failed.
Calls: <Anonymous> -> check -> check_rprofile_eof
Execution halted
── Test failures ──────────────────────────────────────────────────── check ────
> message("*** Checks ...")
*** Checks ...
>
> startup::check(fix = FALSE)
Error in check_rprofile_eof(all = all, fix = fix, backup = backup, debug = debug) :
startup::check(): SYNTAX ERROR: File ~/.Rprofile is missing a newline at the end of the file, which most likely will cause R to silently ignore the file in the startup process.
Calls: <Anonymous> -> check_rprofile_eof
Execution halted
── Test failures ────────────────────────────────────────────────── startup ────
> renviron_d <- startup::renviron_d
> rprofile_d <- startup::rprofile_d
>
> message("*** startup() ...")
*** startup() ...
>
> message("*** renviron_d() ...")
*** renviron_d() ...
>
> paths <- system.file("Renviron.d", package = "startup")
> print(paths)
[1] "/tmp/hb/RtmpNPHwHS/file25046dcf3af6/startup.Rcheck/startup/Renviron.d"
> api <- renviron_d(paths = paths, skip = FALSE)
> str(api)
List of 3
$ renviron_d:function (sibling = FALSE, all = FALSE, unload = FALSE, skip = NA, dryrun = NA,
debug = NA, paths = NULL)
$ rprofile_d:function (sibling = FALSE, all = FALSE, check = NA, unload = FALSE, skip = NA,
on_error = c("error", "warning", "immediate.warning", "message", "ignore"),
dryrun = NA, debug = NA, paths = NULL)
$ unload :function (debug = FALSE)
> renviron_d(paths = paths, skip = FALSE, dryrun = TRUE)
>
> message("*** renviron_d() ... DONE")
*** renviron_d() ... DONE
>
> message("*** rprofile_d() ...")
*** rprofile_d() ...
>
> paths <- system.file("Rprofile.d", package = "startup")
> print(paths)
[1] "/tmp/hb/RtmpNPHwHS/file25046dcf3af6/startup.Rcheck/startup/Rprofile.d"
> api <- rprofile_d(paths = paths, skip = FALSE)
Backed up R startup file: '~/.Rprofile' (1 bytes) -> '~/.Rprofile.bak.20200902-194355' (1 bytes)
Error in file(file, ifelse(append, "a", "w")) :
cannot open the connection
In addition: Warning message:
In file(file, ifelse(append, "a", "w")) :
cannot open file '/home/hb/.Rprofile': Permission denied
Error in check_rprofile_eof(all = all, fix = fix, backup = backup, debug = debug) :
startup::check(): SYNTAX ERROR: Tried to add missing newline to the end of file ~/.Rprofile, which otherwise would cause R to silently ignore the file in the startup process, but failed.
Calls: rprofile_d -> check -> check_rprofile_eof
Execution halted
Two types of problems occur:
Investigate the following error from https://www.r-project.org/nosvn/R.check/r-release-windows-ix86+x86_64/startup-00check.html: