For two computers with the same set-up with different R and package versions devtools::check() is successfull on one computer, and failing with
In dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE) :
cannot create dir 'C:\Users\myName\AppData\Local\Temp\18\RtmpKshZRc\temp_libpath593477b81f6d;C:\Program Files', reason 'Invalid argument'
I traced the error back to
pkgbuild:::rcmd_build_tools("build",
c("E:\\Steffi\\test", c("--no-resave-data" ,"--no-manual")),
wd = "C:\\Users\\myName\\AppData\\Local\\Temp\\18\\RtmpKshZRc\\file59347b141e29",
fail_on_status = TRUE, required = FALSE, quiet = quiet)
where it doesn't happen vs.
pkgbuild:::withr_with_temp_libpaths(
pkgbuild:::rcmd_build_tools("build",
c("E:\\Steffi\\test", c("--no-resave-data" ,"--no-manual")),
wd = "C:\\Users\\myName\\AppData\\Local\\Temp\\18\\RtmpKshZRc\\file59347b141e29",
fail_on_status = TRUE, required = FALSE, quiet = quiet)
)
where the error appears.
It seems like the temp libpaths set in withr_with_temp_libpaths are concatenated with a semicolon.
The error happens on R version 4.4.1, pkgbuild version 1.4.8
It does not happen on R version 4.3.0, pkgbuild version 1.4.7
the regular libpaths as well as the temp libpaths set in the package look alike on both computers.