Repository navigation
Drop stale laranail archives from the composer cache - #3
Merged
Merged
Conversation
Composer's dist cache is keyed on a package name. `laranail/*` resolve through a
single **moving** `v0.1.0` tag, so the name stays the same while the contents
change underneath it — and a restored archive is then silently stale.
`composer install` reports success and unpacks whatever was cached the first time.
That is not hypothetical. It is why CI across the org fails with:
```
Could not open input file: vendor/bin/laranail-pint
```
`bin/laranail-pint` **is** in the `v0.1.0` tag and **is** declared in
`package-tools`' `composer.json`. CI was unpacking a cached archive from before
it existed. Measured 2026-09-04: **35 of 60** repos had a stale `package-tools`
archive, across nine distinct refs.
The cache key cannot fix this on its own — `hashFiles('composer.json')` does not
change when a *dependency's* tag moves, and `restore-keys` falls back to any
older cache. So the stale archive is dropped explicitly before install.
Everything else is immutable per version and stays cached, so the cache keeps
its value.
Verified on `laranail/atlas#3`: the step runs, `Install dependencies` succeeds,
and `Could not open input file` is gone — the binary now resolves.
`composer pint` runs `vendor/bin/laranail-pint`, which passes package-tools' shared pint.json rather than any local one. Once the stale composer cache stopped hiding that binary, the check ran for the first time and reported these files. Cosmetic. Every file already declared strict_types, so the config's declare_strict_types rule adds nothing here, and the suite returns the identical result before and after.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Composer's dist cache is keyed on a package name.
laranail/*resolve through asingle moving
v0.1.0tag, so the name stays the same while the contentschange underneath it — and a restored archive is then silently stale.
composer installreports success and unpacks whatever was cached the first time.That is not hypothetical. It is why CI across the org fails with:
bin/laranail-pintis in thev0.1.0tag and is declared inpackage-tools'composer.json. CI was unpacking a cached archive from beforeit existed. Measured 2026-09-04: 35 of 60 repos had a stale
package-toolsarchive, across nine distinct refs.
The cache key cannot fix this on its own —
hashFiles('composer.json')does notchange when a dependency's tag moves, and
restore-keysfalls back to anyolder cache. So the stale archive is dropped explicitly before install.
Everything else is immutable per version and stays cached, so the cache keeps
its value.
Verified on
laranail/atlas#3: the step runs,Install dependenciessucceeds,and
Could not open input fileis gone — the binary now resolves.