Windows: `R CMD check` leaves a `'NULL'` folder because the R_LIBS_USER block does not recognise the quoted `'NULL'`
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 84/100
Direzione di ricerca
Start with the ## rig R_LIBS_USER start block that rig adds to <R_HOME>/library/base/R/Rprofile, then reproduce with the issue’s Rterm.exe commands on Windows. The reported failure is that quoted R_LIBS_USER='NULL' bypasses the check and creates a 'NULL' folder. Done means the block ignores that value and the folder is not created.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
On Windows, R CMD check --as-cran of any package ends with this NOTE when R was installed with rig:
* checking for non-standard things in the check directory ... NOTE
Found the following files/directories:
''NULL''
The folder is created by the ## rig R_LIBS_USER start block that rig adds to <R_HOME>/library/base/R/Rprofile:
userlibs <- strsplit(Sys.getenv("R_LIBS_USER"), .Platform$path.sep)[[1]]
if (length(userlibs) == 0) return()
if (userlibs[[1]] == "NULL") return()
userlib1 <- userlibs[1]
dir.create(userlib1, recursive = TRUE, showWarnings = FALSE)
R CMD check starts its child R processes (examples, tests, several code checks) with R_LIBS_USER='NULL' and R_LIBS_SITE='NULL'. On Windows these are passed as arguments to Rterm.exe, and the single quotes are kept, so Sys.getenv("R_LIBS_USER") is 'NULL' with the quotes. The test above does not match it, and dir.create() creates a folder named 'NULL' in the working folder of each child process: the check folder (from the examples), tests/, and 00_pkg_src/<pkg>/. With --as-cran, the folder in the check folder produces the NOTE.
Reproduce
In an empty folder, with a rig-installed R on Windows:
echo "invisible(1)" > in.R
Rterm.exe "R_LIBS_USER='NULL'" --vanilla -f in.R # creates the folder 'NULL'
Rterm.exe R_LIBS_USER=NULL --vanilla -f in.R # creates nothing
The same NOTE appears for a minimal package with one function and no dependencies.
Suggested fix
Strip surrounding quotes before the comparison, for example:
if (gsub("^['\"]|['\"]$", "", userlibs[[1]]) == "NULL") return()
Versions
- rig 0.11.1
- R 4.6.2 (ucrt), Windows 11
- Lingua principale
- Rust
- Stelle
- 1k
- Fork
- 42
- Merge medio
- 10h 7m
- PR unite (30g)
- 23
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di r-lib/rig
-
bug documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
I maintainer di solito rispondono entro 1 giorno
-
feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
-
.Renviron activation in rig proj: handling project secrets and Posit Assistant restrictionsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
documentation good first issue help wanted
Difficoltà 2/5 Mezza giornata Idoneità per principianti 78/100
fidan-lang/fidan#18 ·
-
area:contracts kind:docs prio:low
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
opentaikai/stemma-flow#142 ·
I maintainer di solito rispondono entro 1 giorno
-
area:kernel needs-triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
bherbruck/solvecraft#26460 ·