Always list base packages in workspace_dependencies()#1329
Open
DavisVaughan wants to merge 1 commit into
Open
Conversation
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.
I noticed that if you open purrr to https://github.com/tidyverse/purrr/blob/481e829f297fd4315b386518215157f361475ad0/R/adverb-safely.R#L42 and just try to goto definition on
force(), then nothing happens.That's because
force()is a base function, but base isn't listed in Imports or Depends so it doesn't get picked up inworkspace_dependencies()and we never try and set its packageR/sources.Similar story if you open an arbitrary workspace of scripts where you use any package from the default R
search()path without first callinglibrary()or::on that package somewhere in the file.I think the right thing to do is to just ensure that the default
search()packages are always listed inworkspace_dependencies(). This is definitely right for workspace scripts. For workspace packages technically an individual package file would only need {base}, but if you add any extra scripts into the package, likeinst/data.R, then we'd require the rest of the base packages anyways, so I think it is fine to just default to all of the defaultsearch()packages for workspace packages too. It doesn't affect diagnostics there, just the set of packages we try and download sources for, so over approximation is pretty harmless.