Fails to build on composer with scssphp/scssphp:1.7.0
Overview
Building a site for Drupal 8/9 with composer fails since the release of scssphp 1.7.0
Reproduction steps
composer config extra.enable-patching true composer config extra.compile-mode all composer config minimum-stability dev composer config prefer-stable true composer -n require civicrm/civicrm-asset-plugin:~1.1 composer -n require civicrm/civicrm-core:"~5.41" civicrm/civicrm-packages:"~5.41" civicrm/civicrm-drupal-8:"~5.41"
Current behaviour
Compile: Greenwich CSS (dist/bootstrap3.css)
> @php -r 'require_once '\''/opt/drupal/vendor/autoload.php'\''; Civi\CompilePlugin\TaskTransfer::import(); \CCL::copy('\''../../bower_components/select2/select2-bootstrap.css'\'', '\''extern/select2/select2-bootstrap.scss'\'');'
> @php -r 'require_once '\''/opt/drupal/vendor/autoload.php'\''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS[\Civi\CompilePlugin\TaskTransfer::GLOBAL_VAR]);'
PHP Fatal error: Uncaught ScssPhp\ScssPhp\Exception\SassScriptException: $amount: Expected 5% to be within 0% and 1% in /opt/drupal/vendor/scssphp/scssphp/src/Exception/SassScriptException.php:30
Stack trace:
#0 /opt/drupal/vendor/scssphp/scssphp/src/Node/Number.php(265): ScssPhp\ScssPhp\Exception\SassScriptException::forArgument()
#1 /opt/drupal/vendor/scssphp/scssphp/src/Compiler.php(8450): ScssPhp\ScssPhp\Node\Number->valueInRange()
#2 /opt/drupal/vendor/scssphp/scssphp/src/Compiler.php(8459): ScssPhp\ScssPhp\Compiler->libOpacify()
#3 /opt/drupal/vendor/scssphp/scssphp/src/Compiler.php(6193): ScssPhp\ScssPhp\Compiler->libFadeIn()
#4 /opt/drupal/vendor/scssphp/scssphp/src/Compiler.php(3662): ScssPhp\ScssPhp\Compiler->callNativeFunction()
#5 /opt/drupal/vendor/scssphp/scssphp/src/Compiler.php(3588): ScssPhp\ScssPhp\Compiler->fncall()
#6 /opt/drupal/vendor/scssphp/scssphp/src/Compiler.php(2928): ScssPhp\ScssPhp\Compiler->reduce()
#7 /opt/drupal/vendor/scssphp/scssphp/src/Compiler.php(2327): ScssPhp\ScssPhp\Compiler->compileCh in /opt/drupal/vendor/scssphp/scssphp/src/Compiler.php on line 553
Script @php -r 'require_once '\''/opt/drupal/vendor/autoload.php'\''; Civi\CompilePlugin\TaskTransfer::import(); \CCL\Tasks::scss($GLOBALS[\Civi\CompilePlugin\TaskTransfer::GLOBAL_VAR]);' handling the shell-runner event returned with error code 255
Subcommand @composer compile returned with error code 255
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
[RuntimeException]
Subcommand @composer compile returned with error code 255
Expected behaviour
Should compile.
Environment information
- CiviCRM: 5.41.0
- PHP: 7.4
- CMS: Drupal 9.2.5
- Composer: 2.1.8
Comments
Adding scssphp/scssphp:1.6 to the last line of the sequence above makes compilation succeed:
composer -n require civicrm/civicrm-core:"~5.41" civicrm/civicrm-packages:"~5.41" civicrm/civicrm-drupal-8:"~5.41" scssphp/scssphp:1.6