devtools::check

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.

Seems like pkgbuild does not work when R_LIBS_USER is not a single directory. Should it? If yes, then this is a bug in pkgbuild, you can report it here: GitHub · Where software is built

Hi Gabor, thanks for your reply. I created withr_with_temp_libpaths causes dir.create error for multiple .libPaths · Issue #217 · r-lib/pkgbuild