Skip to content

Commit c0e9b0c

Browse files
committed
Does this reproduce the read.dcf(<bytes>) problem?
Seen previously on GHA: 错误位于startsWith(lines, "#"): 不允许用"bytes"编码进行字符翻译” Calls: <Anonymous> ... idesc_create_text -> read_dcf -> read.dcf -> startsWith
1 parent 2a36892 commit c0e9b0c

1 file changed

Lines changed: 30 additions & 49 deletions

File tree

.github/workflows/R-CMD-check-occasional.yaml

Lines changed: 30 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,9 @@ jobs:
1616
strategy:
1717
fail-fast: false
1818
matrix:
19-
os: [macOS-latest, windows-latest, ubuntu-latest]
20-
r: ['devel', 'release', '3.5', '3.6', '4.0', '4.1', '4.2', '4.3', '4.4', '4.5']
21-
locale: ['en_US.utf8',
22-
# Multibyte characters: Mandarin
23-
'zh_CN.utf8',
24-
# Encoding: non-UTF-8 locales for French, Mandarin, and Russian
25-
'fr_CA', 'zh_CN.GB18030', 'ru_RU.KOI8-R', # fr_CA is implicitly 'ISO-8859-1'
26-
# Collate order (#3502, see also #7837): Latvian, Azeri, Hungarian, Faroese, Albanian
27-
'lv_LV.utf8', 'az_AZ.utf8', 'hu_HU.utf8', 'fo_FO.utf8', 'sq_MK.utf8',
28-
# Local time formatting (for R bug #19117)
29-
'vi_VN.utf8']
19+
os: [ubuntu-latest]
20+
r: ['devel']
21+
locale: ['zh_CN.GB18030']
3022
# we're constrained by GHA inflexibility to do a tedious thing here with 'exclude' below.
3123
# better would be for GHA to support multiple 'matrix' configs (one for ubuntu, one for other OS);
3224
# an approach with multiple jobs would tediously require copy-pasting the _rest_ of the steps
@@ -151,37 +143,38 @@ jobs:
151143
options(crayon.enabled=TRUE)
152144
dir.create("~/.R", showWarnings=FALSE)
153145
# suppress noisy Annotation for e.g. {hexbin} about tabs v. spaces
154-
cat("FCFLAGS += -Wno-tabs\nFFLAGS += -Wno-tabs\n", file="~/.R/Makevars", append=TRUE)
146+
#cat("FCFLAGS += -Wno-tabs\nFFLAGS += -Wno-tabs\n", file="~/.R/Makevars", append=TRUE)
155147
# e.g. Annotation about lacking macosx binaries: bin/macosx/sonoma-arm64/contrib/4.7
156148
if (grepl("Under development", R.version$status)) options(pkgType="source")
157149
# to avoid Annotation about certain packages being unavailable, use this old snapshot repo
158-
if (getRversion() < "3.6") options(repos=c(CRAN="https://packagemanager.posit.co/cran/2020-04-24"))
150+
#if (getRversion() < "3.6") options(repos=c(CRAN="https://packagemanager.posit.co/cran/2020-04-24"))
159151
message("*** Using the following repos for installation ***")
160152
print(getOption("repos"))
161-
message("*** Installing Suggested packages ***")
162-
sugg <- names(tools:::.split_dependencies(read.dcf("DESCRIPTION", "Suggests")))
163-
install.packages(sugg)
164-
165-
other_deps_expr = parse('inst/tests/other.Rraw', n=1L)
166-
eval(other_deps_expr)
167-
other_pkgs = setdiff(
168-
get(as.character(other_deps_expr[[1:2]])),
169-
tools:::.get_standard_package_names()$base) # skip parallel
170-
# Many will not install on oldest R versions
171-
message("*** Installing fully optional packages ***")
172-
try(install.packages(c(other_pkgs, "rcmdcheck")))
173-
174-
has_other_pkg = sapply(other_pkgs, requireNamespace, quietly=TRUE)
175-
run_other = all(has_other_pkg)
176-
if (run_other) {
177-
desc = read.dcf("DESCRIPTION")
178-
desc[1L, "Suggests"] = toString(unique(c(desc[1, "Suggests"], other_pkgs)))
179-
write.dcf(desc, "DESCRIPTION")
180-
message("Setting TEST_DATA_TABLE_WITH_OTHER_PACKAGES=TRUE to run other.Rraw")
181-
} else {
153+
#message("*** Installing Suggested packages ***")
154+
#sugg <- names(tools:::.split_dependencies(read.dcf("DESCRIPTION", "Suggests")))
155+
#install.packages(sugg)
156+
157+
#other_deps_expr = parse('inst/tests/other.Rraw', n=1L)
158+
#eval(other_deps_expr)
159+
#other_pkgs = setdiff(
160+
# get(as.character(other_deps_expr[[1:2]])),
161+
# tools:::.get_standard_package_names()$base) # skip parallel
162+
## Many will not install on oldest R versions
163+
#message("*** Installing fully optional packages ***")
164+
#try(install.packages(c(other_pkgs, "rcmdcheck")))
165+
install.packages("rcmdcheck")
166+
167+
#has_other_pkg = sapply(other_pkgs, requireNamespace, quietly=TRUE)
168+
#run_other = all(has_other_pkg)
169+
#if (run_other) {
170+
# desc = read.dcf("DESCRIPTION")
171+
# desc[1L, "Suggests"] = toString(unique(c(desc[1, "Suggests"], other_pkgs)))
172+
# write.dcf(desc, "DESCRIPTION")
173+
# message("Setting TEST_DATA_TABLE_WITH_OTHER_PACKAGES=TRUE to run other.Rraw")
174+
#} else {
182175
message(sprintf("Skipping other.Rraw since some required packages are not available: %s\n", toString(other_pkgs[!has_other_pkg])))
183-
}
184-
Sys.setenv(TEST_DATA_TABLE_WITH_OTHER_PACKAGES=as.character(run_other))
176+
#}
177+
#Sys.setenv(TEST_DATA_TABLE_WITH_OTHER_PACKAGES=as.character(run_other))
185178
186179
do_vignettes = requireNamespace("litedown", quietly=TRUE)
187180
@@ -192,19 +185,7 @@ jobs:
192185
build_args = "--no-build-vignettes"
193186
check_args = c(check_args, "--no-build-vignettes", "--ignore-vignettes")
194187
}
195-
if (requireNamespace("rcmdcheck", quietly=TRUE)) {
196-
rcmdcheck::rcmdcheck(args=check_args, build_args=build_args, error_on="warning", check_dir="check")
197-
} else {
198-
Rbin = if (.Platform$OS.type == "windows") "R.exe" else "R"
199-
system2(Rbin, c("CMD", "build", ".", build_args))
200-
dt_tar = list.files(pattern = "^data[.]table_.*[.]tar[.]gz$")
201-
if (!length(dt_tar)) stop("Built tar.gz not found among: ", toString(list.files()))
202-
res = system2(Rbin, c("CMD", "check", dt_tar[1L], check_args), stdout=TRUE, stderr=TRUE)
203-
if (!is.null(attr(res, "status")) || anyNA(res) || any(grepl("^Status:.*(ERROR|WARNING)", res))) {
204-
writeLines(as.character(res))
205-
stop("R CMD check failed")
206-
}
207-
}
188+
rcmdcheck::rcmdcheck(args=check_args, build_args=build_args, error_on="warning", check_dir="check")
208189
shell: Rscript {0}
209190

210191
- name: Upload check results

0 commit comments

Comments
 (0)