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

Explore using Phive to manage tools instead of Composer #5807

Open
dktapps opened this issue Jun 6, 2023 · 2 comments
Open

Explore using Phive to manage tools instead of Composer #5807

dktapps opened this issue Jun 6, 2023 · 2 comments
Labels
Category: Tests Pertaining to unit / integration tests Status: Blocked Depends on other changes which are yet to be completed Type: Enhancement Contributes features or other improvements to PocketMine-MP

Comments

@dktapps
Copy link
Member

dktapps commented Jun 6, 2023

Description

Having phpunit/phpunit as a Composer dev dependency is very obnoxious, because:

  • its deps may conflict with ours
  • everything gets dumped into the same vendor folder inseparably
    • making phar builds more inconvenient
    • also spamming IDE auto-complete with tons of junk that's hard to filter out

https://phar.io/ (Phive) is a potential solution to this problem, recommended by the PHPUnit docs. This section of the PHPUnit docs in particular provides an excellent summary of the problems faced by including phpunit into the project as a Composer dependency.

Justification

Alternative methods

We could:

  • have a separate composer.json specifically for installing tools - not great because namespace collisions (phpunit.phar in particular is shaded thanks to php-scoper, and phpstan is shaded by something similar)
  • curl the tools directly as-needed - inconvenient, prone to errors, and hard to remember
@dktapps dktapps added Type: Enhancement Contributes features or other improvements to PocketMine-MP Category: Tests Pertaining to unit / integration tests labels Jun 6, 2023
@dktapps
Copy link
Member Author

dktapps commented Jun 6, 2023

Currently this is a bit inconvenient, because Phive uses curl SSL, which does not work in our currently distributed prebuilt PHP binaries due to missing SSL certificate bundles (pmmp/PHP-Binaries#70)

@dktapps
Copy link
Member Author

dktapps commented Jun 7, 2023

This is also a bit annoying for PHPStan, since PHPStan extensions can't be easily used if we install PHPStan using Phive. However, PHPUnit will definitely benefit.

@dktapps dktapps added the Status: Blocked Depends on other changes which are yet to be completed label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Tests Pertaining to unit / integration tests Status: Blocked Depends on other changes which are yet to be completed Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

No branches or pull requests

1 participant