consolidation / site-alias

Manage alias records for local and remote sites.
Other
60 stars 15 forks source link

symfony/filesystem 4.4 does not have path, which causes issues with the 3.1.6 release #57

Closed MdNadimHossain closed 1 year ago

MdNadimHossain commented 1 year ago

Steps to reproduce

Used consolidation/site-alias 3.1.6 (latest release) with the symfony/filesystem 4.4 version, cause other packages in composer has this version dependency.

Expected behavior

The build should work, as it is mentioned in the composer.json it should work with 4.4 - https://github.com/consolidation/site-alias/compare/3.1.5...3.1.6#diff-d2ab9925cad7eac58e0ff4cc0d251a937ecf49e4b6bf57f8b95aab76648a9d34R29

Actual behavior

I get the following error, because symfony/filesystem 4.4 version does not have the Symfony\Component\Filesystem\Path

PHP Fatal error:  Uncaught Error: Class 'Symfony\Component\Filesystem\Path' not found in /app/vendor/consolidation/site-alias/src/HostPath.php:156
Stack trace:
#0 /app/vendor/consolidation/site-alias/src/HostPath.php(239): Consolidation\SiteAlias\HostPath->getPath()
#1 /app/vendor/consolidation/site-alias/src/HostPath.php(255): Consolidation\SiteAlias\HostPath->fullyQualifiedPath()
#2 /app/vendor/drush/drush/src/Commands/core/RsyncCommands.php(65): Consolidation\SiteAlias\HostPath->fullyQualifiedPathPreservingTrailingSlash()
#3 [internal function]: Drush\Commands\core\RsyncCommands->rsync('@bay.production...', '/tmp/.data/', Array, Array)
#4 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#5 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#6 /app/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): in /app/vendor/consolidation/site-alias/src/HostPath.php on line 156
 [warning] Drush command terminated abnormally.

System Configuration

Which O.S. and PHP version are you using?

MaxwellKeeble commented 1 year ago

Confirming this issue - Drupal 9.4 uses Symfony 4 but this change to site-alias requiring Filesystem/Path (only available in Symfony 5) has now broken drush sql:sync with the same error as above.

Drupal 9.4.8 PHP 7.4 Drush 10.6.2

greg-1-anderson commented 1 year ago

We reverted the switch from Symfony/Filesystem/Path and went back to using webmozart/path-util for the 3.x branch. Released 3.1.7 to address this. A new 4.x branch was created to continue forward using Symfony/Filesystem/Path instead of webmosart/path-util. This new branch is not compatible with symfony/filesystem 4.x.

Drush will also need some changes to retain compatibility with symfony/filesystem 4.x; that will be next. For now, though, you should be able to use Drupal 9 with consolidation/site-alias:3.1.7 and an older version of Drush 11.