Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .ci/atime/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ test.list <- atime::atime_test_list(
pkg_find_replace <- function(glob, FIND, REPLACE) {
atime::glob_find_replace(file.path(new.pkg.path, glob), FIND, REPLACE)
}
Package_regex <- gsub(".", "_?", old.Package, fixed = TRUE)
Package_ <- gsub(".", "_", old.Package, fixed = TRUE)
new.Package_ <- paste0(Package_, "_", sha)
Package_regex <- gsub(".", "([_.]?)", old.Package, fixed = TRUE)
Package_ <- gsub(".", "\\1", old.Package, fixed = TRUE)
new.Package_ <- paste0(Package_, "\\1", sha)
pkg_find_replace(
"DESCRIPTION",
paste0("Package:\\s+", old.Package),
Expand All @@ -112,10 +112,6 @@ test.list <- atime::atime_test_list(
file.path("R", "onLoad.R"),
Package_regex,
new.Package_)
pkg_find_replace(
file.path("R", "onLoad.R"),
sprintf('packageVersion\\("%s"\\)', old.Package),
sprintf('packageVersion\\("%s"\\)', new.Package))
pkg_find_replace(
file.path("src", "init.c"),
paste0("R_init_", Package_regex),
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
useDynLib("data_table", .registration=TRUE)
useDynLib("data.table", .registration=TRUE)

## For S4-ization
importFrom(methods, "S3Part<-", slotNames)
Expand Down
8 changes: 4 additions & 4 deletions R/onLoad.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# Runs when loaded but not attached to search() path; e.g., when a package just Imports (not Depends on) data.table
if (!exists("test.data.table", .GlobalEnv, inherits=FALSE)) {
# check when installed package is loaded but skip when developing the package with cc()
dllV = if (is.loaded("CdllVersion",PACKAGE="data_table")) .Call(CdllVersion) else "before 1.12.0"
dllV = if (is.loaded("CdllVersion",PACKAGE="data.table")) .Call(CdllVersion) else "before 1.18.99"
RV = as.character(packageVersion("data.table"))
if (dllV != RV) {
dll = if (.Platform$OS.type=="windows") "dll" else "so"
dll = .Platform$dynlib.ext
# https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17478
# TODO(R>=4.0.0): Remove or adjust this message once we're sure all users are unaffected
stopf("The data_table.%s version (%s) does not match the package (%s). Please close all R sessions to release the old %s and reinstall data.table in a fresh R session. Prior to R version 3.6.0 patched, R's package installer could leave a package in an apparently functional state where new R code was calling old C code silently: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17478. Once a package is in this mismatch state it may produce wrong results silently until you next upgrade the package. This mismatch between R and C code can happen with any package not just data.table. It is just that data.table has added this check.", dll, dllV, RV, toupper(dll))
stopf("The data.table.%s version (%s) does not match the package (%s). Please close all R sessions to release the old %s and reinstall data.table in a fresh R session. Prior to R version 3.6.0 patched, R's package installer could leave a package in an apparently functional state where new R code was calling old C code silently: https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17478. Once a package is in this mismatch state it may produce wrong results silently until you next upgrade the package. This mismatch between R and C code can happen with any package not just data.table. It is just that data.table has added this check.", dll, dllV, RV, toupper(dll))
}
builtPath = system.file("Meta", "package.rds", package="data.table")
if (builtPath != "" && !identical(session_r_version>="4.0.0", (build_r_version <- readRDS(builtPath)$Built$R)>="4.0.0")) {
Expand Down Expand Up @@ -143,7 +143,7 @@ getRversion = function(...) stopf("Reminder to data.table developers: don't use
# 4) Defining getRversion with a stopf() here helps prevent new switches on getRversion() being added in future. Easily circumvented but the point is to issue the message above.

.onUnload = function(libpath) {
library.dynam.unload("data_table", libpath)
library.dynam.unload("data.table", libpath)
}

# nocov end
3 changes: 0 additions & 3 deletions src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ PKG_LIBS = $(C_VISIBILITY) @PKG_LIBS@ @zlib_libs@
all: $(SHLIB)
@echo PKG_CFLAGS = $(PKG_CFLAGS)
@echo PKG_LIBS = $(PKG_LIBS)
if [ "$(SHLIB)" != "data_table$(SHLIB_EXT)" ]; then mv $(SHLIB) data_table$(SHLIB_EXT); fi
if [ "$(OS)" != "Windows_NT" ] && [ `uname -s` = 'Darwin' ]; then install_name_tool -id data_table$(SHLIB_EXT) data_table$(SHLIB_EXT); fi

3 changes: 0 additions & 3 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
PKG_CFLAGS = $(SHLIB_OPENMP_CFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS) -lz

all: $(SHLIB)
mv $(SHLIB) data_table$(SHLIB_EXT)
Loading