Skip to content

Don't invalidate container cache on user-interactions in the shell#4924

Merged
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
staabm:cache-container
Feb 14, 2026
Merged

Don't invalidate container cache on user-interactions in the shell#4924
ondrejmirtes merged 1 commit intophpstan:2.1.xfrom
staabm:cache-container

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Feb 14, 2026

refs phpstan/phpstan#14072 (comment)


ENV variables used for building the container key sometimes change, based on user interactions in the shell.

Image

it happens after you cd between folders and run PHPStan again.

see https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html

OLDPWD
The previous working directory as set by the cd builtin.


I see another case: the container invalidates as soon as you re-size the shell window, because a ENV var exists which defines the LINES and COLUMNS in the window

Image

while I think this is just a workaround for a more general problem - I see no way atm to find out which ENV vars are relevant for us and which are not

@staabm staabm marked this pull request as ready for review February 14, 2026 07:57
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

@ondrejmirtes ondrejmirtes merged commit e2067b2 into phpstan:2.1.x Feb 14, 2026
638 of 643 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

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.

3 participants