Remove --no-scripts from PHP composer install command#464
Remove --no-scripts from PHP composer install command#464Spirit55555 wants to merge 2 commits intorailwayapp:mainfrom
Conversation
--no-scripts prevents pre-install-cmd and post-install-cmd events from running.
|
@Spirit55555 I'm not familiar with the PHP ecosystem, unfortunately! So you'll have to walk me through this.
|
In post. yes, it's possible. Maybe add support for an env like
I added a
I do not use a framework and I unfortunately have no experience with development using Laravel. |
|
@Spirit55555 Thanks so much for the detail. I'll need to read up on how all of these PHP frameworks operate a bit more. The tests are failing here, so I can't merge this without understanding the different patterns and improving a generalized solution here. |
Don't install dev depends.
|
@iloveitaly The error looks like a file permission issue to me, but I will have to test some to be sure. |
|
@iloveitaly After a bit of testing, it seems like the issue is that Composer is run before the |
|
@Spirit55555 in what cases would an installation process require access to the entire app? Just not familiar with the PHP ecosystem, and in ruby/python/go/typescript (which I'm familiar with) packages generally don't need access to your application source code. The reason we try to separate build from install steps is to enable layer caching to repeats builds are much faster (i.e. if the same dependencies are used, no need to redownload them). |
|
@iloveitaly From the documentation: https://getcomposer.org/doc/articles/scripts.md
There are plenty of examples here on GitHub: https://github.com/search?q=%22post-install-cmd%22&type=code The default is to run the pre/post scripts, so I think there should be very good reasons not to do this. If you want to download the dependencies early in the process, you could run And later: |
|
@Spirit55555 Super helpful. This all makes sense. I need to spend some time with it and think through what changes are breaking, etc. I'm going to be able to get to it this week, but I think I have all of the detail I need from you, which is great. |
--no-scriptspreventspre-install-cmdandpost-install-cmdevents from running.I see no reason to prevent this and I had to add a workaround to my own applications, due to this.
It was added as part of this commit: 1547fa7