Skip to content

Commit eddec87

Browse files
tdhockToby Dylan Hockingaitap
authored
fix Rtools gcc on old fwrite (#7690)
* atime: require C99 compatibility Older versions of data.table (seen in fwrite) use function declarations with empty prototypes. Newer versions of R default to C23, which interprets those as empty prototypes. Anticipate future addition of SystemRequirements: libzstd. Co-authored-by: Toby Dylan Hocking <toby.dylan.hocking@usherbrooke.ca> Co-authored-by: Ivan K <krylov.r00t@gmail.com>
1 parent 70b7794 commit eddec87

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.ci/atime/tests.R

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ test.list <- atime::atime_test_list(
120120
file.path("src", "init.c"),
121121
paste0("R_init_", Package_regex),
122122
paste0("R_init_", gsub("[.]", "_", new.Package_)))
123+
# require C<23 for empty prototype declarations to work, #7689
124+
descfile = file.path(new.pkg.path, "DESCRIPTION")
125+
desc = as.data.frame(read.dcf(descfile))
126+
desc$SystemRequirements = paste(
127+
c(desc$SystemRequirements, "USE_C99"),
128+
collapse = "; ")
129+
write.dcf(desc, descfile)
123130
# allow compilation on new R versions where 'Calloc' is not defined
124131
pkg_find_replace(
125132
file.path("src", "*.c"),
@@ -199,11 +206,11 @@ test.list <- atime::atime_test_list(
199206
v2 = sample(5L, N, TRUE)
200207
)
201208
},
202-
expr = data.table:::`[.data.table`(d, , max(v1) - min(v2), by = id),
203209
PR7401="0216983c51e03e3f61d5e6f08f4ba0c42cceb22c", # Merge commit (https://github.com/Rdatatable/data.table/commit/0216983c51e03e3f61d5e6f08f4ba0c42cceb22c) of a PR (https://github.com/Rdatatable/data.table/pull/7401) which increased speed and memory usage of this test (https://github.com/Rdatatable/data.table/issues/7687)
204210
Before = "7a9eaf62ede487625200981018d8692be8c6f134", # Parent of the first commit (https://github.com/Rdatatable/data.table/commit/515de90a6068911a148e54343a3503043b8bb87c) in the PR (https://github.com/Rdatatable/data.table/pull/4164/commits) that introduced the regression
205211
Regression = "c152ced0e5799acee1589910c69c1a2c6586b95d", # Parent of the first commit (https://github.com/Rdatatable/data.table/commit/15f0598b9828d3af2eb8ddc9b38e0356f42afe4f) in the PR (https://github.com/Rdatatable/data.table/pull/4558/commits) that fixes the regression
206-
Fixed = "f750448a2efcd258b3aba57136ee6a95ce56b302"), # Second commit of the PR (https://github.com/Rdatatable/data.table/pull/4558/commits) that fixes the regression
212+
Fixed = "f750448a2efcd258b3aba57136ee6a95ce56b302", # Second commit of the PR (https://github.com/Rdatatable/data.table/pull/4558/commits) that fixes the regression
213+
expr = data.table:::`[.data.table`(d, , max(v1) - min(v2), by = id)),
207214

208215
# Issue with sorting again when already sorted, as reported in https://github.com/Rdatatable/data.table/issues/4498
209216
# Test case adapted from https://github.com/Rdatatable/data.table/pull/4501#issue-625311918 which is the fix PR.

0 commit comments

Comments
 (0)