Windows: `R CMD check` leaves a `'NULL'` folder because the R_LIBS_USER block does not recognise the quoted `'NULL'`
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 84/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Rust
- Star
- 1k
- Fork
- 42
- Merge trung bình
- 10 giờ 7 phút
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của r-lib/rig
-
bug documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
.Renviron activation in rig proj: handling project secrets and Posit Assistant restrictionsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
documentation good first issue help wanted
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 78/100
fidan-lang/fidan#18 ·
-
area:contracts kind:docs prio:low
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
[Feature]: Add locale for FrenchĐang mởenhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
opentaikai/stemma-flow#142 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:kernel needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
bherbruck/solvecraft#26460 ·