Repository navigation
Call utils and stats functions with their namespace - #7
Merged
Merged
Conversation
`lib_path()`, `cuda_path()` and `.read_components()` called `packageName()`, `read.delim()` and `setNames()` unqualified, without importing utils or stats. With no default packages attached, as in `R_DEFAULT_PACKAGES=NULL` and the child processes of R CMD INSTALL and R CMD check, every exported path function errored with "could not find function packageName". A package that loads one of these at load time, such as torch, then fails to start under R CMD check. The calls now use `utils::` and `stats::`, both packages are declared in Imports, and sync.sh has propagated the change to every cuda* package. Fixes mlverse#5.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5. Should also fix mlverse/torch#1463.
Related: mlverse/torch#1478 makes torch warn and keep loading when
lib_path()errors, instead of reporting that torch failed to start. That guards against the symptom, and this PR fixes the cause.lib_path(),cuda_path()and.read_components()callpackageName(),read.delim()andsetNames()without importing utils or stats. When no default packages are attached, every exported path function errors with "could not find function packageName". R CMD INSTALL and R CMD check run R that way. torch callslib_path()at startup, so with cuda12.8 installed it can't preload the CUDA libraries and fails to start, and any package that loads torch fails R CMD check.The change qualifies the calls with
utils::andstats::, addsImports: stats, utilsto the DESCRIPTION template, and runs sync.sh to update all four cuda* packages.Checked with cuda12.8 installed with
CUDA_COMPONENTS=runtime:R_DEFAULT_PACKAGES=NULL,lib_path(),cuda_path(),include_path()andall_lib_paths()all error on main and return the expected paths with this change.R_DEFAULT_PACKAGES=NULL,loadNamespace("torch")fails on main with "could not find function packageName". With this change torch starts and mapslibcudart.so.12from the cuda12.8 lib directory.I left
PKG_VERSIONalone. Installs that already have 1.0.9 will need a version bump to pick this up throughupdate.packages().