-
Notifications
You must be signed in to change notification settings - Fork 3
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
Composer json parsing doesn't account for scripts described as objects #81
Comments
Hi @cedricziel! Do you have further examples of this usage pattern? What exactly does the key in the object achieve? AFAICT it's simply ignored, Composer will only run the value part with the command string? |
Hi @dzuelke The CNB fails to parse the composer.json file entirely and can't complete the build. I think it's less an issue of with composer and more an issue with the way this build pack gathers metadata. |
Yeah, I understand what's happening, @cedricziel. My question was what this object notation is: "auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"importmap:install": "symfony-cmd"
}, Every value in the But Composer does not use the keys you provide there; this object syntax is not documented in the Composer docs, and the keys are not used inside Composer's I researched, and it's a Symfony Flex thing, it magically expands these entries: https://github.com/symfony/flex/blob/4dc11919791f81d087a12db2ab4c7e044431ef6b/src/ScriptExecutor.php#L79-L91 I'll see what I can do to support this. |
That would be great - I imagine this is a potential blocker for a large share of modern PHP apps and resolving it could help others adopt the CNB |
Yup for sure. Just not the easiest of things given how we're using |
I looked at it before I opened the ticket, but had just started with rust. I think a struct for scripts with a custom serializer / deserializer could do that. Essentially always having a Vec. |
Usually, composer scripts are arrays or sequences of commands. In symfony projects, a set of framework provided scripts is defined as objects:
This buildpack fails to build when a script is described as object.
Proposed solution
Allow scripts to be defined as objects as well
The text was updated successfully, but these errors were encountered: