mongodb / mongo-php-driver

The Official MongoDB PHP driver
https://pecl.php.net/package/mongodb
Apache License 2.0
888 stars 202 forks source link

PIE: Could not find release by tag name for mongodb/mongodb-extension:1.20.0 #1716

Open mickverm opened 2 weeks ago

mickverm commented 2 weeks ago

Bug Report

I was trying out the initial release of PIE (https://github.com/php/pie/releases/tag/0.1.0) and was unable to install this extension. I'm guessing it's caused by the missing v16 in the PHP 8.3 release file names on Github. Installing older versions doesn't work either, since they don't include the vs16/vs17 at all, which seems to be a requirement of PIE: https://github.com/php/pie/blob/main/docs/extension-maintainers.md#windows-support

image

Environment

Test Script

php .\pie.phar install mongodb/mongodb-extension -v
This command may need elevated privileges, and may prompt you for your password.
You are running PHP 8.3.12
Target PHP installation: 8.3.12 ts, vs16, on Windows x86_64 (from C:\Apache24\php\php.exe)
Found package: mongodb/mongodb-extension:1.20.0 which provides ext-mongodb

In CouldNotFindReleaseAsset.php line 28:

  [Php\Pie\Downloading\Exception\CouldNotFindReleaseAsset]
  Could not find release by tag name for mongodb/mongodb-extension:1.20.0

Exception trace:
  at phar://C:/pie.phar/src/Downloading/Exception/CouldNotFindReleaseAsset.php:28
 Php\Pie\Downloading\Exception\CouldNotFindReleaseAsset::forPackageWithMissingTag() at phar://C:/pie.phar/src/Downloading/GithubPackageReleaseAssets.php:100
 Php\Pie\Downloading\GithubPackageReleaseAssets->getReleaseAssetsForPackage() at phar://C:/pie.phar/src/Downloading/GithubPackageReleaseAssets.php:43
 Php\Pie\Downloading\GithubPackageReleaseAssets->findWindowsDownloadUrlForPackage() at phar://C:/pie.phar/src/Downloading/WindowsDownloadAndExtract.php:26
 Php\Pie\Downloading\WindowsDownloadAndExtract->__invoke() at phar://C:/pie.phar/src/Command/CommandHelper.php:183
 Php\Pie\Command\CommandHelper::downloadPackage() at phar://C:/pie.phar/src/Command/InstallCommand.php:52
 Php\Pie\Command\InstallCommand->execute() at phar://C:/pie.phar/vendor/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at phar://C:/pie.phar/vendor/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/pie.phar/vendor/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at phar://C:/pie.phar/vendor/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at phar://C:/pie.phar/bin/pie:63
 require() at C:\pie.phar:15

install [--with-php-config [WITH-PHP-CONFIG]] [--with-php-path [WITH-PHP-PATH]] [--] <requested-package-and-version>
mickverm commented 2 weeks ago

I see the file name has changed, but the issue persists. The file name probably wasn't the issue.

php .\pie.phar install mongodb/mongodb-extension -vvv

Box Requirements Checker
========================

> Using PHP 8.3.12
> PHP is using the following php.ini file:
  C:\Apache24\php\php.ini

> Checking Box requirements:
  ✔ This application requires a PHP version matching "8.1.*||8.2.*||8.3.*||8.4.*".
  ✔ The package "guzzlehttp/guzzle" requires the extension "json".
  ✔ The package "composer/ca-bundle" requires the extension "openssl".
  ✔ The package "composer/ca-bundle" requires the extension "pcre".
  ✔ This application requires the extension "zip".
  ✔ The package "symfony/service-contracts" conflicts with the extension "psr".

 [OK] Your system is ready to run the application.

Loading config file C:/Users/mv/AppData/Roaming/Composer/config.json
Loading config file C:/Users/mv/AppData/Roaming/Composer/auth.json
Checked CA file C:\Apache24\php\extras\ssl\curl-ca-bundle.crt: valid
Executing command (C:\): git branch -a --no-color --no-abbrev -v
Executing command (C:\): git describe --exact-match --tags
Executing command (CWD): git --version
Executing command (C:\): git log --pretty="%H" -n1 HEAD --no-show-signature
Executing command (C:\): hg branch
Executing command (C:\): fossil branch list
Executing command (C:\): fossil tag list
Executing command (C:\): svn info --xml
Reading C:/Users/mv/AppData/Roaming/Composer/composer.json (C:\Users\mv\AppData\Roaming\Composer\composer.json)
Loading config file C:/Users/mv/AppData/Roaming/Composer/config.json
Loading config file C:/Users/mv/AppData/Roaming/Composer/auth.json
Loading config file C:/Users/mv/AppData/Roaming/Composer/composer.json (C:\Users\mv\AppData\Roaming\Composer\composer.json)
Loading config file C:\Users\mv\AppData\Roaming\Composer/auth.json
Reading C:\Users\mv\AppData\Roaming\Composer/auth.json (C:\Users\mv\AppData\Roaming\Composer\auth.json)
This command may need elevated privileges, and may prompt you for your password.
You are running PHP 8.3.12
Target PHP installation: 8.3.12 ts, vs16, on Windows x86_64 (from C:\Apache24\php\php.exe)
Downloading https://repo.packagist.org/packages.json
[200] https://repo.packagist.org/packages.json
Writing C:/Users/mv/AppData/Local/Composer/repo/https---repo.packagist.org/packages.json into cache
Downloading https://repo.packagist.org/p2/mongodb/mongodb-extension.json
[200] https://repo.packagist.org/p2/mongodb/mongodb-extension.json
Writing C:/Users/mv/AppData/Local/Composer/repo/https---repo.packagist.org/provider-mongodb~mongodb-extension.json into cache
Found package: mongodb/mongodb-extension:1.20.0 which provides ext-mongodb

In CouldNotFindReleaseAsset.php line 28:

  [Php\Pie\Downloading\Exception\CouldNotFindReleaseAsset]
  Could not find release by tag name for mongodb/mongodb-extension:1.20.0

Exception trace:
  at phar://C:/pie.phar/src/Downloading/Exception/CouldNotFindReleaseAsset.php:28
 Php\Pie\Downloading\Exception\CouldNotFindReleaseAsset::forPackageWithMissingTag() at phar://C:/pie.phar/src/Downloading/GithubPackageReleaseAssets.php:100
 Php\Pie\Downloading\GithubPackageReleaseAssets->getReleaseAssetsForPackage() at phar://C:/pie.phar/src/Downloading/GithubPackageReleaseAssets.php:43
 Php\Pie\Downloading\GithubPackageReleaseAssets->findWindowsDownloadUrlForPackage() at phar://C:/pie.phar/src/Downloading/WindowsDownloadAndExtract.php:26
 Php\Pie\Downloading\WindowsDownloadAndExtract->__invoke() at phar://C:/pie.phar/src/Command/CommandHelper.php:183
 Php\Pie\Command\CommandHelper::downloadPackage() at phar://C:/pie.phar/src/Command/InstallCommand.php:52
 Php\Pie\Command\InstallCommand->execute() at phar://C:/pie.phar/vendor/symfony/console/Command/Command.php:326
 Symfony\Component\Console\Command\Command->run() at phar://C:/pie.phar/vendor/symfony/console/Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/pie.phar/vendor/symfony/console/Application.php:324
 Symfony\Component\Console\Application->doRun() at phar://C:/pie.phar/vendor/symfony/console/Application.php:175
 Symfony\Component\Console\Application->run() at phar://C:/pie.phar/bin/pie:63
 require() at C:\pie.phar:15

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

I'll have a look into the source code of PIE, to see what goes wrong.

mickverm commented 2 weeks ago

Found the issue, this line makes a request to the incorrect URL: https://api.github.com/repos/mongodb/mongodb-extension/releases/tags/1.20.0.

It even has a @todo comment above it 😛

jmikola commented 2 weeks ago

Found the issue, this line makes a request to the incorrect URL: https://api.github.com/repos/mongodb/mongodb-extension/releases/tags/1.20.0.

I assume it's pulling that from https://github.com/mongodb/mongo-php-driver/blob/v1.x/composer.json#L2. I'll leave @alcaeus to sort this out, as he previously worked with @asgrim on this. I'm not sure if the appropriate fix is on our side or in PIE itself (although the @todo suggests it may be upstream).

asgrim commented 2 weeks ago

Yep I agree it appears it's related to the @todo :) will investigate php/pie#68 soon and hopefully fix :+1:

Just to note, you will need the vs/vc version in the Windows assets though!