0

Following install guide I get fatal error at compilation tasks in composer require civicrm/civicrm-core:'~5.35'.

The setup is on Aegir with Drupal 8.9 and drupal/recommended-project composer template, having a relocated document root.

Is this error related to the setup above, or it's CiviCRM related?

Error log:

Compiling additional files (For full details, use verbose "-v" mode.)
Compile: Generate CCL wrapper functions
> @php -r 'require_once '\''/var/aegir/platforms/d8.9.13/vendor/autoload.php'\''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::template($GLOBALS["COMPOSER_COMPILE_TASK"]);'
WARNING: Failed to read compilation-task from COMPOSER_COMPILE_TASK. Please use "composer compile".
PHP Fatal error:  Uncaught InvalidArgumentException: Invalid file reference (tpl-file=NULL) in /var/aegir/platforms/d8.9.13/vendor/civicrm/composer-compile-lib/src/Tasks/Template.php:62
Stack trace:
#0 /var/aegir/platforms/d8.9.13/vendor/civicrm/composer-compile-lib/src/Tasks/Template.php(21): CCL\Tasks\Template::assertFileField()
#1 /var/aegir/platforms/d8.9.13/vendor/civicrm/composer-compile-lib/src/Tasks.php(24): CCL\Tasks\Template::compile()
#2 Command line code(1): CCL\Tasks::template()
#3 {main}
  thrown in /var/aegir/platforms/d8.9.13/vendor/civicrm/composer-compile-lib/src/Tasks/Template.php on line 62
Script @php -r 'require_once '\''/var/aegir/platforms/d8.9.13/vendor/autoload.php'\''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::template($GLOBALS["COMPOSER_COMPILE_TASK"]);' handling the shell-runner event returned with error code 255
Subcommand @composer compile  returned with error code 255

Installation failed, reverting ./composer.json to its original content.

In ComposerPassthru.php line 72:

  Subcommand @composer compile  returned with error code 255
2

It turns out this compilation error is related to composer versions:

  • Using default composer version of 1.10 on Ubuntu 20.04 produces this fatal error.
  • Manually upgrading to composer 2.0 resolves this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.