Skip to content

Better caching during installations/pkgDeps#152

Merged
eliotmcintire merged 2 commits into
developmentfrom
fix/pak-honor-type-source
May 22, 2026
Merged

Better caching during installations/pkgDeps#152
eliotmcintire merged 2 commits into
developmentfrom
fix/pak-honor-type-source

Conversation

@eliotmcintire
Copy link
Copy Markdown
Contributor

No description provided.

eliotmcintire and others added 2 commits May 16, 2026 18:09
type was collected by Install()/Require() but never threaded into the
pak backbone, so pak did its default binary-preferring resolution. On
Windows/Mac, when CRAN has the new source (e.g. reproducible 3.1.0) but
only the old binary (3.0.0), pak would keep/install the stale binary --
either a no-op or a silent downgrade -- ignoring an explicit
type="source".

Thread type into pakDepsToPkgDT + pakInstallFiltered and pin
pkg.platforms="source" for the resolve+install when type=="source"
(pak ignores base R's pkgType; pkgdepends' platforms config is the
real knob). on.exit restores prior options. No behavior change unless
type is explicitly "source". PR #151's detection/warning unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The first fix threaded type into the pak path, but pakDepsCacheKey()
keyed only on {pkgs, wh, repos, userPkgs}. A type="source" call landed
on a stale binary-era cached pak_result (observed: "using cache (11
packages, 3.7h old)"), so pak::pkg_deps never re-ran under
pkg.platforms="source": deps got rebuilt from source but reproducible
itself was "kept" at the old 3.0.0 plan -> still the binary-lag
downgrade, with the same misleading "could not be installed" warning.

Fold a source-only discriminator into the cache key and thread type
through pakDepsResolve + pakDepsCacheInvalidate so read and invalidate
use the same key. Binary/both callers keep one shared key (one-time
miss on upgrade); source calls now miss the binary entry and re-resolve.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@eliotmcintire eliotmcintire merged commit 52323b5 into development May 22, 2026
15 checks passed
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.

1 participant