В Thu, 12 Feb 2026 14:57:59 -0800
Michael Chirico <[email protected]> пишет:

> I suspect that's due to a difference of running the check on the built
> package vs. on the package sources:
> 
> tools:::.check_packages_used(dir = ".") # nothing
> tools:::.check_packages_used(package = <pkg>)
> # Namespaces in Imports field not imported from:
> #   ‘R6’ ‘stats’
> #   All declared Imports should be used.

I wonder what happens on Win-Builder during the check. According to the
code (tools/R/check.R line 2156, function check_R_code),
tools:::.check_packages_used(dir = ...) is only used if !do_install,
and 00check.log from Win-Builder doesn't seem to divulge anything that
would set do_install to FALSE. (Checking with --install=fake or
--install=check:... still sets do_install to TRUE and causes the NOTE).
The function is quite self-contained; indeed, it only walks LANGSXP
call objects, expression vectors, and pairlists made from functions.

Does tools:::.check_packages_used(package=...) really fail to notice
the "unused" imports on Win-Builder? Does something unseen really set
do_install <- FALSE? Is there a third reason?

-- 
Best regards,
Ivan

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

Reply via email to