Skip to content

Fix pkgBiocRevDeps(recursive = TRUE) leaking forward dependencies#82

Merged
seandavi merged 2 commits into
develfrom
fix-issue-81-recursive-revdeps
Jun 25, 2026
Merged

Fix pkgBiocRevDeps(recursive = TRUE) leaking forward dependencies#82
seandavi merged 2 commits into
develfrom
fix-issue-81-recursive-revdeps

Conversation

@seandavi

@seandavi seandavi commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Problem

pkgBiocRevDeps("Rarr", recursive = TRUE) returned 25,613 packages — essentially the entire CRAN+Bioconductor repository — including "Suggests" and "Enhances" dependencies of the queried package such as curl, jsonlite, knitr, and rmarkdown.

Fixes #81.

Root cause

The recursive branch passed recursive = TRUE to tools::package_dependencies(). With the default which = "all", the reverse recursion follows Suggests / Enhances edges. Those edges form a near-fully-connected graph (thousands of packages Suggests knitr/testthat/rmarkdown), so recursing reverse over them closes over almost the whole repository.

Fix

Restrict the recursion to strong dependencies (recursive = "strong"). Level-1 reverse deps still honor the user's which (a package that merely Suggests the target still counts), but recursion only propagates through Depends/Imports/LinkingTo — the standard "what would break if this package broke" semantics.

Test

Adds tests/testthat/test-pkgBiocDeps.R, a regression test asserting the result is a small fraction of the repository.

seandavi and others added 2 commits June 25, 2026 10:16
Recursing reverse dependencies over 'Suggests' / 'Enhances' edges explodes
to nearly the entire repository (e.g. thousands of packages 'Suggests'
knitr), which pulled in the queried package's own forward (non-reverse)
dependencies. Restrict the recursion to strong dependencies so only genuine
reverse dependencies are returned.

For Rarr this reduces the recursive result from 25,613 packages to 4.

Adds a regression test and bumps the version with a NEWS entry.

Fixes #81

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ve-revdeps

# Conflicts:
#	DESCRIPTION
#	NEWS
@seandavi
seandavi merged commit 182833b into devel Jun 25, 2026
0 of 4 checks passed
@seandavi
seandavi deleted the fix-issue-81-recursive-revdeps branch June 25, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pkgBiocRevDeps(recursive = TRUE) also returns (non-reverse) dependencies

1 participant