Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[FrameworkBundle] Split "var/build" from "var/cache" when compiling for the "prod" env#57556
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
if ('prod' === $this->getEnvironment() && Kernel::class === (new \ReflectionMethod(parent::class, 'getCacheDir'))->class) { | ||
return $this->getProjectDir().'/var/build/'.$this->environment; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
it feels a bit dirty ... what about a new (temporary?) configuration env? to be used upstream:
symfony/src/Symfony/Component/HttpKernel/Kernel.php
Lines 302 to 303 in3729c5c
// Returns $this->getCacheDir() for backward compatibility | |
return$this->getCacheDir(); |
which brings me to; can we get rid of the parent calls in a trait, by making the envs defacto config envs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't understand your proposal sorry (nor its "why"). Please expand if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
e.g.APP_USE_BUILD_DIR=1
so we dont hardcode the prod env and rely on reflection
also im wondering handling the APP_ envs like APP_CACHE_DIR can be dealt with inKernel
as a firt clas feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
An alternative implementation might be to define APP_BUILD_DIR in .env.prod in a recipe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍 i tend to prefer a pure configuration solution
but isnt the bigger goal to eventually swap the current implementation?
symfony/src/Symfony/Component/HttpKernel/Kernel.php
Lines 300 to 304 in3729c5c
publicfunctiongetBuildDir():string | |
{ | |
// Returns $this->getCacheDir() for backward compatibility | |
return$this->getCacheDir(); | |
} |
Uh oh!
There was an error while loading.Please reload this page.
I think it's time to consider defaulting to having separate build vs cache folders.
#50391 opened the way, then@Okhoshi continued it in#52962,#52981,#54384, with a tweak in#57553.
I know that doing this change will improve the DX of deploying on Platform.sh: the container compilation happening during the offline generation of the container image will be reusable right away, without any step to copy the related artifacts in a writeable folder. I'm confident this can benefit other hosting systems too.
Let's have this discussion and figure out any blockers.