-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New renv 1.0.0 not working. Error in renv::renv_bootstrap_validate_version() #1625
Comments
That is pretty surprising to me. Is there anything unique about the It might be helpful if you could |
The Y drive is a dual protocol drive (SMB+NFS), and security is controlled in Unix style. Debug was not so helpful: > debug(packageDescription)
> path <- getNamespaceInfo("renv", "path")
> path
[1] "Y:/Cytemation_Dev/R packages/test222/renv/library/R-4.2/x86_64-w64-mingw32/renv"
> packageDescription("renv", lib.loc = dirname(path))
debugging in: packageDescription("renv", lib.loc = dirname(path))
debug: {
retval <- list()
if (!is.null(fields)) {
fields <- as.character(fields)
retval[fields] <- NA
}
pkgpath <- if (is.null(lib.loc)) {
if (pkg == "base")
file.path(.Library, "base")
else if (isNamespaceLoaded(pkg))
getNamespaceInfo(pkg, "path")
else if ((envname <- paste0("package:", pkg)) %in% search()) {
attr(as.environment(envname), "path")
}
}
if (is.null(pkgpath))
pkgpath <- ""
if (pkgpath == "") {
libs <- if (is.null(lib.loc))
.libPaths()
else lib.loc
for (lib in libs) if (file.access(file.path(lib, pkg),
5) == 0L) {
pkgpath <- file.path(lib, pkg)
break
}
}
if (pkgpath == "") {
warning(gettextf("no package '%s' was found", pkg), domain = NA)
return(NA)
}
if (file.exists(file <- file.path(pkgpath, "Meta", "package.rds"))) {
desc <- readRDS(file)$DESCRIPTION
if (length(desc) < 1)
stop(gettextf("metadata of package '%s' is corrupt",
pkg), domain = NA)
desc <- as.list(desc)
}
else if (file.exists(file <- file.path(pkgpath, "DESCRIPTION"))) {
dcf <- read.dcf(file = file)
if (NROW(dcf) < 1L)
stop(gettextf("DESCRIPTION file of package '%s' is corrupt",
pkg), domain = NA)
desc <- as.list(dcf[1, ])
}
else file <- ""
if (nzchar(file)) {
enc <- desc[["Encoding"]]
if (!is.null(enc) && !is.na(encoding)) {
if (missing(encoding) && Sys.getlocale("LC_CTYPE") ==
"C")
encoding <- "ASCII//TRANSLIT"
if (encoding != enc) {
newdesc <- try(lapply(desc, iconv, from = enc,
to = encoding))
dOk <- function(nd) !inherits(nd, "try-error") &&
!anyNA(nd)
ok <- dOk(newdesc)
if (!ok && !endsWith(encoding, "//TRANSLIT"))
ok <- dOk(newdesc <- try(lapply(desc, iconv,
from = enc, to = paste0(encoding, "//TRANSLIT"))))
if (!ok)
ok <- dOk(newdesc <- try(lapply(desc, iconv,
from = enc, to = "ASCII//TRANSLIT", sub = "?")))
if (ok)
desc <- newdesc
else warning("'DESCRIPTION' file has an 'Encoding' field and re-encoding is not possible",
call. = FALSE)
}
}
if (!is.null(fields)) {
ok <- names(desc) %in% fields
retval[names(desc)[ok]] <- desc[ok]
}
else retval[names(desc)] <- desc
}
if ((file == "") || (length(retval) == 0)) {
warning(gettextf("DESCRIPTION file of package '%s' is missing or broken",
pkg), domain = NA)
return(NA)
}
if (drop && length(fields) == 1L)
return(retval[[1L]])
class(retval) <- "packageDescription"
if (!is.null(fields))
attr(retval, "fields") <- fields
attr(retval, "file") <- file
retval
}
Browse[2]> c
exiting from: packageDescription("renv", lib.loc = dirname(path))
[1] NA
Warning message:
In packageDescription("renv", lib.loc = dirname(path)) :
no package 'renv' was found But I searched for the difference in this code on different drives and the file.access is the issue. > file.access(file.path(lib, pkg), 5)
Y:/Cytemation_Dev/R packages/test222/renv/library/R-4.2/x86_64-w64-mingw32/renv
-1
> file.info(file.path(lib, pkg))
size isdir mode
Y:/Cytemation_Dev/R packages/test222/renv/library/R-4.2/x86_64-w64-mingw32/renv 0 TRUE 777
mtime
Y:/Cytemation_Dev/R packages/test222/renv/library/R-4.2/x86_64-w64-mingw32/renv 2023-08-03 09:04:23
ctime
Y:/Cytemation_Dev/R packages/test222/renv/library/R-4.2/x86_64-w64-mingw32/renv 2023-08-03 10:23:43
atime exe
Y:/Cytemation_Dev/R packages/test222/renv/library/R-4.2/x86_64-w64-mingw32/renv 2023-08-03 10:23:43 no Same test on Y is working on Linux Posit workbench. |
Thanks! I believe 138325f should resolve the issue, but the fact that R's |
Thanks for solving this issue. We don't have issue with renv::init() anymore. But yes, file.access() is causing another issue with renv. I posted it in an new issue: |
Non of my R projects is working with the new renv 1.0.0 version. Therefore I started a complete fresh project and called renv:init():
The related function with the error is renv_bootstrap_validate_version (https://github.com/rstudio/renv/blob/1490ee1d41db6c2f38848ae18af5607a549bfdde/R/bootstrap.R)
Testing just this code is causing the issue which is causing later the error of calling the description$Version.
Call packageDescription just with the package name is working in giving me the correct path in the renv project library:
The package is correctly installed in the project library, but cannot be found with the lib.loc statement in packageDescription function.
Same issue will show up for any installed package in the project library.
FYI: I don't have this issue on my Posit Workbech running on linux server.
R version 4.2.3 (2023-03-15) -- "Shortstop Beagle" and Platform: x86_64-pc-linux-gnu (64-bit)
The text was updated successfully, but these errors were encountered: