Skip to content
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

Scope composer tools with the bin plugin #28507

Merged
merged 1 commit into from
Aug 19, 2021

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Aug 19, 2021

This puts our current dev tools into isolation, so they and their dependencies won't interfere with vendored production dependencies.

Ref https://github.com/bamarni/composer-bin-plugin for those new to this plugin

Summary

  • Dev tools are no longer part of the production autoloader -> fewer conflicts
  • Dependencies are installed as before
  • Scripts are executed as before

Changes for developers: ✨none✨

The same trick has been used in Mail for months. It helped us get rid of tools that pulled in incompatible versions of Symfony.

@ChristophWurst
Copy link
Member Author

Neat side effect: when you composer i now the list of untracked files is really small. It was quite big before

$ git status
On branch enhancement/composer-bin-plugin-for-tools
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   lib/composer/composer/autoload_classmap.php
        modified:   lib/composer/composer/autoload_psr4.php
        modified:   lib/composer/composer/autoload_static.php
        modified:   lib/composer/composer/installed.json
        modified:   lib/composer/composer/installed.php

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        lib/composer/bamarni/

no changes added to commit (use "git add" and/or "git commit -a")

@juliusknorr
Copy link
Member

lib/composer/bamarni/ could probably be added to the gitignore file.

@ChristophWurst
Copy link
Member Author

lib/composer/bamarni/ could probably be added to the gitignore file.

Yes but no :P

What I don't like about that is that you get different autoloaders for composer i vs composer i --no-dev. When that lib is in the .gitignore then you could have the lib missing but the autoloader still points to it.

This might be a purely theoretical problem.

The other solution I'm fine with would be to just vendor the lib together with #28509.

@ChristophWurst ChristophWurst force-pushed the enhancement/composer-bin-plugin-for-tools branch from e13d55c to e3541da Compare August 19, 2021 10:26
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Aug 19, 2021
@ChristophWurst ChristophWurst merged commit 8bda0ca into master Aug 19, 2021
@ChristophWurst ChristophWurst deleted the enhancement/composer-bin-plugin-for-tools branch August 19, 2021 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants