Skip to content

Commit

Permalink
Avoid LinkingTo dependencies in package resolution
Browse files Browse the repository at this point in the history
Packages listed under LinkingTo are required for building dependent
packages, but not at runtime as they are header-only or statically
linked libraries.

So, we can ignore these packages when we're looking for dependencies to
bundle for webR. In webR 0.4.1, these packages will also be ignored
when invoking `webr::install()`.
  • Loading branch information
georgestagg committed Aug 2, 2024
1 parent 2d4be82 commit 546d3fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions R/packages.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ sys_env_max_filesize <- function() {
if (max_fs_env == "") NULL else max_fs_env
}

# Resolve package list hard dependencies
# Resolve package list, dependencies listed in Depends and Imports
resolve_dependencies <- function(pkgs, local = TRUE) {
pkg_refs <- if (local) {
refs <- find.package(pkgs, lib.loc = NULL, quiet = FALSE, !is_quiet())
glue::glue("local::{refs}")
} else {
pkgs
}
inst <- pkgdepends::new_pkg_deps(pkg_refs)
wasm_config <- list(dependencies = c("Depends", "Imports"))
inst <- pkgdepends::new_pkg_deps(pkg_refs, config = wasm_config)
inst$resolve()
unique(inst$get_resolution()$package)
}
Expand Down

0 comments on commit 546d3fc

Please sign in to comment.