Skip to content

fix(pak): verify installed version matches pak's resolution before reporting OK#151

Merged
eliotmcintire merged 1 commit into
developmentfrom
fix/pak-install-verify-installed-version
May 16, 2026
Merged

fix(pak): verify installed version matches pak's resolution before reporting OK#151
eliotmcintire merged 1 commit into
developmentfrom
fix/pak-install-verify-installed-version

Conversation

@eliotmcintire
Copy link
Copy Markdown
Contributor

Summary

  • On binary-lag platforms (e.g. Mac when reproducible 3.1.0 is in source but only 3.0.0 is in binary), pak::pkg_deps() resolves to 3.1.0 while pak::pak() keeps the 3.0.0 binary. pakInstallFiltered then fell back to pakResolvedVersionMap without checking what actually landed on disk — so Install(\"reproducible (>= 3.1.0)\") printed Installed 1 packages and packageVersion(\"reproducible\") was still '3.0.0'.
  • Extracted the version-satisfaction predicate into pakConstraintSatisfied() (testable) and required identical(pakResolvedVer, installedVer) before trusting pak's resolution.
  • Added a pakResolvedNewer branch that emits an explicit could not be installed: pkg >= X; pak resolved Y but only Z is available as a binary on this platform warning, so the user actually sees the no-op instead of a silent failure.

Test plan

  • Added 4 unit tests in test-16installFailureMetadata_testthat.R covering the binary-lag scenario, the all-satisfied case, the pak-chose-installed case, and missing/blank pakResolvedVer fallback. All pass locally.
  • Field repro: on macOS with reproducible 3.1.0 only in source, Require::Install(\"reproducible (>= 3.1.0)\") should now warn rather than report Installed 1 packages.

🤖 Generated with Claude Code

…porting OK

On binary-lag platforms (e.g. Mac with reproducible 3.1.0 in source but only
3.0.0 in binary), pak's pkg_deps resolved to 3.1.0 while pak::pak() kept the
3.0.0 binary. The post-install reconciliation in pakInstallFiltered fell back
to pakResolvedVersionMap without checking that pak's resolution matched what
actually landed on disk -- so Install("reproducible (>= 3.1.0)") reported
"Installed 1 packages" while packageVersion("reproducible") was still 3.0.0.

Extract the predicate into pakConstraintSatisfied() (testable), require
identical(pakResolvedVer, installedVer) before trusting pak's resolution, and
emit an explicit "binary-lag" warning when pak resolved newer than disk has.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@eliotmcintire eliotmcintire merged commit 7f41080 into development May 16, 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