composer.json currently require PHP "~8.1.6 || ~8.2.0 || ~8.3.0"

Are there known incompatibilites with PHP 8.4+?

CommentFileSizeAuthor
#12 recipe-installed.png29.06 KBgillesbailleux

Comments

bvoynick created an issue. See original summary.

gillesbailleux’s picture

Using Drupal CMS 2.1.0, Drupal AI 1.3.3 and PHP 8.4.20, I tried to install the "AI LLM Optmized Content" recipe via the Package Manager.

The following error has been displayed:
SandboxException: Failed to run process: The command "'/usr/bin/php' '/home/drupalcms/public_html/cms/vendor/composer/./composer/bin/composer' '--working-dir=/home/drupalcms/tmp/.package_managerbd422b8f-af63-4994-93ff-6bee6a225a27/r6Hvduqraa3A8csP0XRWymCojKa5YDN9' 'update' '--with-all-dependencies' '--optimize-autoloader' '--minimal-changes' 'drupal/ai_recipe_llm_optimized_content'" failed. Exit Code: 2(Misuse of shell builtins) Working directory: /home/drupalcms/public_html/cms/web Output: ================ Error Output: ================ 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 drupal/ai_recipe_llm_optimized_content ^1.0 -> satisfiable by drupal/ai_recipe_llm_optimized_content[1.0.0]. - drupal/ai_recipe_llm_optimized_content 1.0.0 requires drupal/llm_support ^1.0.4 -> satisfiable by drupal/llm_support[1.0.4]. - drupal/llm_support 1.0.4 requires php ~8.1.6 || ~8.2.0 || ~8.3.0 -> your php version (8.4.20) does not satisfy that requirement.

This confirms the need to add || ~8.4.0 in the composer.json file in order to install this recipe but also others which are displayed on /admin/modules/browse/ai_dashboard_recommended

  • mxr576 committed ae287268 on 1.x
    #3567548 Drop PHP version contraints
    
mxr576’s picture

Status: Active » Fixed

Fixed, I am sorry, I completely missed this issue somehow.

1.0.5 is out.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mxr576’s picture

Status: Fixed » Closed (fixed)
gillesbailleux’s picture

@mxr576: thank you very much

Awaiting this latest release (performing a composer update -W does not work yet and nothing appears in /admin/reports/updates/update)

user@server:~/public_html/cms$ composer update -W
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Writing lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
Generating optimized autoload files
Hardening vendor directory with .htaccess file.
72 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Cleaning installed packages.
> @php -r "@unlink('vendor/bin/composer');"
No security vulnerability advisories found.
gillesbailleux’s picture

This did the update:

user@server:~/public_html/cms$ composer require drupal/llm_support:^1.0.5
./composer.json has been updated
Running composer update drupal/llm_support
Loading composer repositories with package information
Updating dependencies
Lock file operations: 4 installs, 0 updates, 0 removals
  - Locking drupal/llm_support (1.0.5)
  - Locking drupal/llms_txt (1.0.6)
  - Locking drupal/markdownify (1.1.4)
  - Locking drupal/token_filter (2.2.1)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 4 installs, 0 updates, 0 removals
  - Downloading drupal/token_filter (2.2.1)
  - Downloading drupal/markdownify (1.1.4)
  - Downloading drupal/llms_txt (1.0.6)
  - Downloading drupal/llm_support (1.0.5)
  - Installing drupal/token_filter (2.2.1): Extracting archive
  - Installing drupal/markdownify (1.1.4): Extracting archive
  - Installing drupal/llms_txt (1.0.6): Extracting archive
  - Installing drupal/llm_support (1.0.5): Extracting archive
Generating optimized autoload files
Hardening vendor directory with .htaccess file.
72 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
drupal/llm_support unpacked.
Cleaning installed packages.
> @php -r "@unlink('vendor/bin/composer');"
No security vulnerability advisories found.
user@server:~/public_html/cms$ vendor/bin/drush updb
 [success] No pending updates.

Unfortunately, a project_browser error mentions this:

TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /home/drupalcms/public_html/cms/web/core/lib/Drupal/Component/Render/FormattableMarkup.php on line 238 in Drupal\Component\Utility\Html::escape() (line 433 of /home/drupalcms/public_html/cms/web/core/lib/Drupal/Component/Utility/Html.php).

christophweber’s picture

I have encountered the same error when trying to install AI LLM Optimized Content recipe from /admin/modules/browse/ai_dashboard_recommended. I don't think this is an issue with llm_support recipe or AI LLM Optimized Content recipe, but rather the Project Browser (which is still experimental).
The logs show that llm_support 1.0.5 is installed, and in the next step project browser itself throws the error:
Warning: Undefined array key 0 in Drupal\project_browser\Activator\RecipeActivator->activate() (line 138 of /var/www/html/web/modules/contrib/project_browser/src/Activator/RecipeActivator.php)
I get the same error when trying to install AI Guardrails Prompt Safety from the UI.

I am doing all this from a CMS 2.0 install on which core and contrib have all been updated to tjhe latest versions.

christophweber’s picture

Update: composer update from the command line resolved the issue.
What it did was to bring in a whole bunch of symfony dependencies, plus cleanly installed the code for all attempted recipes. After that, all recipe installs from /admin/modules/browse/ai_dashboard_recommended succeed.

Of course, Project Browser should not necessitate command line work with composer, but at least you now have a workaround for the bug.

gillesbailleux’s picture

@christophweber: the recipe has also been installed after performing a composer update -W command. The errors we both faced were due to a package manager/Drupal CMS issue.

gillesbailleux’s picture

StatusFileSize
new29.06 KB

@christophweber: the recipe is installed (see recipe-installed.png)