Answers.Body: <p>It turns out this compilation error is related to composer versions:</p>
  <ul>
  <li>Using default composer version of 1.10 on Ubuntu 20.04 produces this fatal error.</li>
  <li>Manually upgrading to composer 2.0 resolves this issue.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-15T10:07:07.293Z
Answers.LastActivityDate: 2021-03-15T10:07:07.293Z
Answers.UserDisplayName: Doka
Body: <p>Following <a href="https://docs.civicrm.org/installation/en/latest/drupal8/" rel="nofollow noreferrer">install guide</a> I get fatal error at compilation tasks in <code>composer require civicrm/civicrm-core:'~5.35'</code>.</p>
  <p>The setup is on <a href="https://docs.aegirproject.org/" rel="nofollow noreferrer">Aegir</a> with Drupal 8.9 and <a href="https://github.com/drupal/recommended-project/tree/8.9.x" rel="nofollow noreferrer">drupal/recommended-project</a> composer template, having a relocated document root.</p>
  <p>Is this error related to the setup above, or it's CiviCRM related?</p>
  <p>Error log:</p>
  <pre><code>Compiling additional files (For full details, use verbose &quot;-v&quot; mode.)
  Compile: Generate CCL wrapper functions
  &gt; @php -r 'require_once '\''/var/aegir/platforms/d8.9.13/vendor/autoload.php'\''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::template($GLOBALS[&quot;COMPOSER_COMPILE_TASK&quot;]);'
  WARNING: Failed to read compilation-task from COMPOSER_COMPILE_TASK. Please use &quot;composer compile&quot;.
  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[&quot;COMPOSER_COMPILE_TASK&quot;]);' 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
  </code></pre>
  
Tags: <drupal-8><composer><aegir>
Title: Compilation error when installing on Drupal8
ThreadText: # Compilation error when installing on Drupal8
  
  (Asked by: username_0 on 2021-03-15)
  
  Following [install guide](https://docs.civicrm.org/installation/en/latest/drupal8/) I get fatal error at compilation tasks in `composer require civicrm/civicrm-core:'~5.35'`.
  
  The setup is on [Aegir](https://docs.aegirproject.org/) with Drupal 8.9 and [drupal/recommended-project](https://github.com/drupal/recommended-project/tree/8.9.x) 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
  
  ```
  
  **Tags:** drupal-8, composer, aegir
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-03-15. Score: 3 | Accepted answer
  
  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.
  
  
  ---
  
  