Closed Sectimus closed 4 months ago
Just to add with a few changes it does look like it actually reads the correct file, it's just the output of the extension that is printing the wrong information [check:2] Spawning PHPStan with the following configuration: {"binStr":"docker","args":["exec","-t","REDACTED_apiphp-1","php","/var/www/REDACTED/vendor/bin/phpstan","analyse","-c","/var/www/REDACTED/build/phpstan/tests.2.neon.dist","--error-format=json","--no-interaction","--memory-limit=4096M"],"tmpDir":"**/tmp/phpstan_**"}
Ah yeah that would explain it. It was intentional that the tmpDir wasn't being used since it's not trivial to parse a neon file, but indeed on machines/docker-images that reboot often, storing cache in tmp will cause a lot of full checks.
Will try to fix this but again I'm a bit busy currently. But thanks for the report!
Turns out I didn't need to parse the neon file, the default wasn't needed at all and I just removed it. Will ship this in a release soon, I'll try to tackle the other issue first to get them shipped together.
When the vscode setting "
phpstan.tmpDir
" is unset, we should not default to/tmp/phpstan
. We should instead honor thetmpDir
setting in each of the passed config files:Currently we ignore this value altogether and attempt to set the cache to /tmp/phpstan which can cause really awful performance on docker environments since we won't have a prebuilt cache there on container start (unless we bind the /tmp/phpstan directory to somewhere on the host. And this is also wiped on restart of the container, causing every first run (after opening vscode) to take exceedingly long.
This also means if we are using more than one config file via "
phpstan.configFile
" then every single run is going to never use the cache, since they both try to write to the same cache, which causes it to be invalid as per the PHPStan result cache docs: