php / pie

The PHP Installer for Extensions
BSD 3-Clause "New" or "Revised" License
193 stars 4 forks source link

Improve messaging when we can't find a package matching the constraint #15

Closed asgrim closed 6 days ago

asgrim commented 4 months ago

When I run bin/pie download xdebug/xdebug:3.4.0alpha1, I see:

Unable to find an installable package xdebug/xdebug for version 3.4.0alpha1  

It does not tell me why it can't find it, as there is certainly a release on packagist.

When you run bin/pie download xdebug/xdebug:3.4.0alpha1@alpha this works.

In this case, it is because the default stability flag is stable. This may be because we're missing something in version resolution in Composer, but either way, this could be improved with better messaging.

asgrim commented 2 weeks ago

This also applies when the downstream dependency depends on an extension that is missing. For example, I built PHP 7.4 using --disable-json and tried to install mongodb/mongodb-extension:

$ bin/pie download --with-php-config=/home/james/workspace/oss/php-src-build/bin/php-config mongodb/mongodb-extension:v1.x-dev@dev
You are running PHP 8.3.10
Target PHP installation: 7.4.33 ts, on Linux/OSX/etc x86_64 (from /home/james/workspace/oss/php-src-build/bin/php)

In UnableToResolveRequirement.php line 16:

  Unable to find an installable package mongodb/mongodb-extension for version v1.x-dev@dev.  

download [--with-php-config [WITH-PHP-CONFIG]] [--with-php-path [WITH-PHP-PATH]] [--] <requested-package-and-version>

Whilst it is correct, it is not particularly helpful in telling the user that the only thing preventing installation is that ext-json is missing... :sweat_smile: