GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||
GeezerVison is showing github.com — Composer global-home fallback checks ~/.composer before the XDG home, so scan -g finds no Composer 2 global packages when a stale ~/.composer exists and composer isn't on PATH · Issue #586 · SocketDev/socket-patch Closed Labels agent:triagedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentpm:composerComposerComposerpriority:p2 Description[agent] Found by the scheduled Composer bug-hunt routine (ledger #321). SummaryWhen So on Linux with Composer 2, any leftover The doc comment at ImpactGlobally installed Composer tools (phpunit, php-cs-fixer, laravel/installer, …) go silently unpatched, with a success exit code, on Linux machines that have both directories and no Repro (Linux, PHP 8.3, Composer 2.10.3 phar, main
|
| Composer | Composer's own home (both dirs exist) | socket-patch, no composer on PATH |
control: on PATH | control: no ~/.composer |
|---|---|---|---|---|
| 1.10.28 | ~/.composer (both cases) |
matches Composer (not affected) | n/a | n/a |
| 2.2.30 | ~/.config/composer / $XDG_CONFIG_HOME/composer |
0 packages ×2 layouts | n/a | n/a |
| 2.10.3 | ~/.config/composer / $XDG_CONFIG_HOME/composer |
0 packages ×2 layouts | 1 package | 1 package |
macOS: untested. Composer's useXdg() is normally false there (no XDG_* vars, no /etc/xdg), so ~/.composer first is correct, but a macOS user with an XDG_* variable set would hit this. Windows isn't affected (%APPDATA%\Composer comes first).
This isn't a regression in #442. The pre-#442 fallback (v4.0.0) already probed ~/.composer before ~/.config/composer. #442 added $XDG_CONFIG_HOME but kept the order.
crates/socket-patch-core/src/crawlers/composer_crawler.rs:407-434 (composer_home_candidates: home.join(".composer") at :424 is pushed before the XDG candidates at :428/:432), consumed at :387-390. A fix needs to mirror useXdg() (any XDG_* env var, or /etc/xdg exists) and, when it's true, put the XDG dir first. Composer 1's order differs, but without a composer binary the version can't be detected cheaply, so preferring the Composer 2 rule (or crawling every existing candidate) seems the safer choice.
[agent] Triaged: priority:p2 (Composer). This isn't a duplicate. #438 / #442 added the fallback but kept the Composer 1 order, and I found no open PR. The cause is confirmed in composer_home_candidates (crawlers/composer_crawler.rs), which pushes ~/.composer before the XDG candidates.
Generated by Claude Code
[agent] Claiming this issue (shared root cause: the Composer home fallback probes ~/.composer before the XDG home, which is Composer 1's order; Composer 2 checks the XDG home first on XDG systems). Branch: agent/fix-composer-xdg-home-order. Claim-ID: 2026-10-12T07:21:23Z-9d3c73
Generated by Claude Code