-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Add config option to ignore view cache timestamps #55536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add config option to ignore view cache timestamps #55536
Conversation
87d75ca
to
471cb52
Compare
Hmm, why does my unit test fail? Even better: How can I run phpunit locally to debug it? version: '3'
services:
+ phpunit:
+ image: php:8.3-alpine
+ environment:
+ DB_PORT: 3306
+ DB_USERNAME: root
+ DYNAMODB_CACHE_TABLE: laravel_dynamodb_test
+ DYNAMODB_ENDPOINT: "http://localhost:8888"
+ AWS_ACCESS_KEY_ID: randomKey
+ AWS_SECRET_ACCESS_KEY: randomSecret
+ entrypoint: >
+ sh -exc '
+ mkdir -p /opt/laravel/framework;
+ cd /opt/laravel/framework;
+ apk add --no-cache composer php83-dom php83-fileinfo php83-ftp php83-gmp php83-session php83-simplexml php83-tokenizer php83-xml php83-xmlwriter;
+ composer config version "12.x-dev"
+ composer install;
+ exec "$@"
+ ' "$@"
+ command: vendor/bin/phpunit --display-deprecation --fail-on-deprecation
+ volumes:
+ - .:/opt/laravel/framework
dynamodb:
image: amazon/dynamodb-local:2.0.0
ports: and running it gives me:
Surely there is a less painful way to run unit tests locally. 😄 What am I missing? |
471cb52
to
191271a
Compare
Got it. I copied a faulty constructor call. That poses the question why the test I copied and adapted is working. 🤔 |
a282a0f
to
a17289c
Compare
Fixed. \o/ |
When running in a read-only filesystem container with views pre-cached at build time, Laravel checks if the cached view's timestamp is older than the source's to decide when to recompile. This is fine as long as we do not make OCI image builds reproducible.
If we do however, the timestamps match (because timestamps of all files are set to 01.01.1970), so Laravel recompiles the view, tries to write to a read-only filesystem and the container crashes.
This patch introduces a new config option
view.ignore_cache_timestamps
which does exactly what the name suggests.This renders #55450 and #55517 obsolete, at least for the scenario described above.