From fc56b46aff36d6eafcebd21d5ed3448311056151 Mon Sep 17 00:00:00 2001 From: Kevin Ushey Date: Thu, 23 Jul 2026 15:36:33 -0700 Subject: [PATCH] rename systemFile() to archSystemFile() The previous name did not convey how the helper differs from system.file(); the distinguishing behavior is injection of the architecture-specific subdirectory. --- R/tbb.R | 6 +++--- R/utils.R | 4 ++-- R/zzz.R | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/R/tbb.R b/R/tbb.R index 1c2c221a..152fd163 100644 --- a/R/tbb.R +++ b/R/tbb.R @@ -42,7 +42,7 @@ tbbLibraryPath <- function(name = NULL) { if (file.exists(tbbName)) return(tbbName) - tbbName <- systemFile("lib", libName) + tbbName <- archSystemFile("lib", libName) if (file.exists(tbbName)) return(tbbName) @@ -88,7 +88,7 @@ tbbLdFlags <- function() { # on Windows, we statically link to oneTBB if (is_windows()) { - libPath <- systemFile("libs") + libPath <- archSystemFile("libs") ldFlags <- sprintf("-L%s -lRcppParallel", asBuildPath(libPath)) return(ldFlags) @@ -123,6 +123,6 @@ tbbRoot <- function() { if (nzchar(TBB_LIB)) return(TBB_LIB) - systemFile("lib") + archSystemFile("lib") } diff --git a/R/utils.R b/R/utils.R index 490065b6..9f412706 100644 --- a/R/utils.R +++ b/R/utils.R @@ -1,7 +1,7 @@ # like system.file(), but injects the architecture-specific subdirectory -# used on Windows when set; e.g. systemFile("lib") resolves 'lib/x64' -systemFile <- function(dir, name = NULL) { +# used on Windows when set; e.g. archSystemFile("lib") resolves 'lib/x64' +archSystemFile <- function(dir, name = NULL) { arch <- .Platform$r_arch parts <- c(dir, if (nzchar(arch)) arch, name) system.file(paste(parts, collapse = "/"), package = "RcppParallel") diff --git a/R/zzz.R b/R/zzz.R index 77db75e8..582b8115 100644 --- a/R/zzz.R +++ b/R/zzz.R @@ -23,7 +23,7 @@ loadTbbLibrary <- function(name) { # NOTE: resolve against the package's own library directory, where # install.libs.R places the stub; tbbRoot() would prefer TBB_LIB, # which on Windows points at Rtools and holds only static libraries - path <- systemFile("lib", paste0(name, ".dll")) + path <- archSystemFile("lib", paste0(name, ".dll")) if (!file.exists(path)) return(NULL)