Skip to content

fix(pak): install deferred culprits in dependency order + retry pass#176

Merged
eliotmcintire merged 3 commits into
developmentfrom
fix/defer-dependency-order-and-retry
Jun 10, 2026
Merged

fix(pak): install deferred culprits in dependency order + retry pass#176
eliotmcintire merged 3 commits into
developmentfrom
fix/defer-dependency-order-and-retry

Conversation

@eliotmcintire

Copy link
Copy Markdown
Contributor

Symptom

Under Require.noRemotes = TRUE (Linux, R 4.6), the install ended with:

ℹ Building LandR.CS 2.0.0.9006
✖ Failed to build LandR.CS 2.0.0.9006
...
✔ Installed LandR 1.2.0.9002 (github::PredictiveEcology/LandR@f9d7d39)
=== Install summary: 1 package(s) not installed ===
  LandR.CS  [build-error]  dependency 'LandR' is not available for package 'LandR.CS'

LandR.CS Imports LandR. Both were deferred build-failure culprits, and the identify-and-defer final serial phase installed them in deferral order — so LandR.CS was built before LandR, failed its R CMD INSTALL pre-flight dep check, and was never retried once LandR landed.

Fix

  1. orderRefsByMissingDepEdges() — topologically order deferred culprits using pak's own dependency 'X' is not available for package 'Y' lines (Y depends on X), so X installs before Y. Index-based + stable; bails out of cycles without dropping refs; handles curly- and straight-quote messages.
  2. Retry pass — after the serial install, re-attempt still-missing culprits while progress is being made (a dependency installed late in the pass unblocks its dependent). Stops as soon as a pass makes no progress (≤ 3 passes).

Regression test added (orderRefsByMissingDepEdges: dependency ordered before dependent; no ref dropped; unrelated/foreign edges leave order intact). Bump 2.0.0.90342.0.0.9035.

Note: separately, that LandR built from GitHub under noRemotes = TRUE suggests LandR.CS's internal Remotes: is being followed during its source build (bypassing the r-universe resolution noRemotes intends). That's a distinct noRemotes-completeness question, not addressed here.

🤖 Generated with Claude Code

identify-and-defer's final serial phase installed deferred build-failure
culprits in deferral order. When both a dependency and its dependent were
deferred (e.g. LandR and LandR.CS, which Imports LandR), the dependent could be
built BEFORE its dependency:

  Building LandR.CS -> Failed: dependency 'LandR' is not available for package 'LandR.CS'
  ...later... Installed LandR
  => LandR.CS [build-error], never retried

Two fixes:
- orderRefsByMissingDepEdges(): topologically order the deferred culprits using
  pak's own "dependency 'X' is not available for package 'Y'" lines (Y depends
  on X) so X installs before Y. Index-based, stable, bails out of cycles without
  dropping refs.
- Retry pass after the serial install: re-attempt still-missing culprits while
  progress is being made, so a dependency installed late in the pass unblocks
  its dependent.

Surfaced under Require.noRemotes = TRUE on Linux R 4.6 where LandR/LandR.CS build
from source and the dependent was attempted first. Test added. Bump .9034 -> .9035.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
eliotmcintire and others added 2 commits June 10, 2026 13:55
…singDepEdges

R CMD check WARNING "checking code files for non-ASCII characters" (warnings-as-
errors on CI) -- the regex used literal ‘ ’ (U+2018/U+2019). Replace with ‘
/’ escapes: ASCII source, identical runtime match (still parses pak's
curly-quote "dependency 'X' is not available for package 'Y'" lines).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@eliotmcintire eliotmcintire merged commit 018d0e2 into development Jun 10, 2026
14 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