I'm trying to use Drupal.org's GitLab CI to test a module that has a dependency on a package that requires PHP's ext-sodium
to be installed:
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires PHP extension ext-sodium * but it is missing from your system. Install or enable PHP's sodium extension.
Problem 2
- kreait/firebase-php[7.0.0, ..., 7.0.3] require lcobucci/jwt ^4.2.1 -> satisfiable by lcobucci/jwt[4.2.1, ..., 4.4.x-dev].
- kreait/firebase-php[7.1.0, ..., 7.x-dev] require lcobucci/jwt ^4.3.0|^5.0 -> satisfiable by lcobucci/jwt[4.3.0, 4.3.x-dev, 4.4.x-dev, 5.0.0, ..., 5.4.x-dev].
- lcobucci/jwt[4.2.1, ..., 4.4.x-dev, 5.0.0, ..., 5.4.x-dev] require ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.
- Root composer.json requires kreait/firebase-php ^7 -> satisfiable by kreait/firebase-php[7.0.0, ..., 7.x-dev].
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/php-cli.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-sodium` to temporarily ignore these required extensions.
I tried adding ext-sodium
to the module's composer.json
:
"require": {
"php": ">=8.1",
"ext-sodium": "*",
"kreait/firebase-php": "^7"
},
But that doesn't help; I'm still getting the same error.
What's the proper approach to ensure that a PHP extension is enabled on Drupal.org's GitLab CI?
Update: It seems libsodium is uniquely a pain because it is now incorporated into PHP8.1. Issue here.