Skip to content

fix(pkgman): honor XDG_CACHE_HOME and keep the previous install until the new one is complete - #335

Merged
Pijukatel merged 4 commits into
masterfrom
claude/keen-mendel-rhx37q
Sep 18, 2026
Merged

Pijukatel merged 4 commits into
masterfrom
claude/keen-mendel-rhx37q

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Sep 17, 2026

Copy link
Copy Markdown
Contributor
  • userCacheDir honors an absolute XDG_CACHE_HOME on Linux.
  • install() extracts into a sibling staging dir and swaps it in only after download, extraction and version stamping succeed, so a failed fetch keeps the previous install. A symlinked install dir keeps its link; the target is replaced.
  • Staging dirs left by an interrupted install are swept on the next run.

Closes: #334

… the new one is complete

Stage the extracted browser next to INSTALL_DIR and swap it in only after
download, extraction and version stamping succeed, so a failed fetch no
longer removes a working install.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fu1933SSDGKaJnTEvu4c5b
…gnore relative XDG_CACHE_HOME

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fu1933SSDGKaJnTEvu4c5b

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Critical install-recovery and concurrency issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Updates package installation to honor XDG cache settings and stage replacements safely.

Changes:

  • Supports absolute XDG_CACHE_HOME on Linux.
  • Stages downloads and extraction before replacing installations.
  • Adds tests and documentation for cache and install behavior.
File summaries
File Summary
src/pkgman.ts Implements cache resolution and staged installation, but requires fixes for interrupted swaps, symlinked install paths, and concurrent installs.
test/pkgman.test.ts Adds coverage for cache resolution and installation behavior.
README.md Documents XDG cache and install directory configuration.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/pkgman.ts Outdated
Comment thread src/pkgman.ts
Comment thread src/pkgman.ts Outdated
@Pijukatel
Pijukatel marked this pull request as ready for review September 18, 2026 06:07
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Sep 18, 2026
@apify-service-account apify-service-account added the t-tooling Issues with this label are in the ownership of the tooling team. label Sep 18, 2026

@janbuchar janbuchar left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Pijukatel
Pijukatel merged commit c62fa2a into master Sep 18, 2026
6 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Install dir is hardcoded to ~/.cache/camoufox (no override, ignores XDG_CACHE_HOME) and is wiped before every fetch

5 participants