Skip to content

Conversation

@nicolas-grekas
Copy link
Contributor

Right now, when composer runs with --no-scripts, it not only disables "scripts" entries from the composer.json file, but it also prevents plugins from actually doing anything. This PR fixes it.

@nicolas-grekas
Copy link
Contributor Author

nicolas-grekas commented Jun 4, 2021

This change basically means that Installer::setRunScripts(), AutoloadGenerator::setRunScripts(), and the related logic are now useless. I didn't remove them because I don't know how you want to deal with any BC on the topic.

@Seldaek Seldaek changed the base branch from 2.0 to master June 5, 2021 14:15
@Seldaek Seldaek added this to the 2.1 milestone Jun 5, 2021
@Seldaek Seldaek added the Bug label Jun 5, 2021
@Seldaek
Copy link
Member

Seldaek commented Jun 5, 2021

I think this is fine as is. Keeping setRunScripts in those places is probably fine, because when Installer is running in dry-run mode, I think suppressing the dispatching of events completely is probably a good idea still to avoid having plugins doing weird stuff while we output operations which aren't being executed. This is done automatically when dry-run is enabled, so I deprecated the setter in Installer.

@Seldaek Seldaek merged commit edf9951 into composer:master Jun 5, 2021
@nicolas-grekas nicolas-grekas deleted the fix-no-scripts branch June 5, 2021 14:28
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Jun 15, 2021
This PR was merged into the 5.3 branch.

Discussion
----------

[Runtime] Add a note for --no-scripts

Ref composer/composer#9942

I think it's worth documenting :)

Commits
-------

53a1829 [Runtime] Add a note for --no-scripts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants