Skip to content

withr_with_temp_libpaths causes dir.create error for multiple .libPaths #217

@steffiOnCode

Description

@steffiOnCode

There seems to be a bug when .libPaths is not a single directory.

Building the package still works:
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)

But building it with temportary libpaths doesn't:
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) )

The error is
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'

Appearantly, the multiple directories in .libPaths are concatenated (with a semicolong separtor).

https://forum.posit.co/t/devtools-check/208755

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions