drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.34k stars 1.08k forks source link

Drush 8.3.1 "make" command throws fatal error if makefile is YML and drush is phar. #4253

Closed jonpugh closed 4 years ago

jonpugh commented 4 years ago

Describe the bug

Using drush make on a yml file throws a fatal error.

To Reproduce

  1. Download latest drush 8.x phar and chmod +x: https://github.com/drush-ops/drush/releases/tag/8.3.1
  2. drush make https://raw.githubusercontent.com/opendevshop/devshop/1.x/build-devmaster-dev.make.yml test

Expected behavior Drush make builds out the Drupal site.

Actual behavior Fatal error: missing file.

include(phar:///home/jon/drush/vendor/composer/../../src/Internal/Symfony/Yaml/Yaml.php): failed to open stream: phar error:        [warning]
"src/Internal/Symfony/Yaml/Yaml.php" is not a file in phar "/home/jon/drush" ClassLoader.php:444
include(): Failed opening 'phar:///home/jon/drush/vendor/composer/../../src/Internal/Symfony/Yaml/Yaml.php' for inclusion           [warning]
(include_path='.:/usr/share/pear:/usr/share/php') ClassLoader.php:444
PHP Fatal error:  Uncaught Error: Class 'Drush\Internal\Symfony\Yaml\Yaml' not found in phar:///home/jon/drush/lib/Drush/Make/Parser/ParserYaml.php:26
Stack trace:
#0 phar:///home/jon/drush/commands/make/make.utilities.inc(662): Drush\Make\Parser\ParserYaml::parse('\n# DevShop Deve...')
#1 phar:///home/jon/drush/commands/make/make.utilities.inc(40): _make_determine_format('\n# DevShop Deve...')
#2 phar:///home/jon/drush/commands/make/make.utilities.inc(15): _make_parse_info_file('https://raw.git...')
#3 phar:///home/jon/drush/commands/make/make.drush.inc(309): make_parse_info_file('https://raw.git...')
#4 phar:///home/jon/drush/includes/command.inc(422): drush_make('https://raw.git...', 'test')
#5 phar:///home/jon/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#6 phar:///home/jon/drush/includes/command.inc(199): drush_command('https://raw.git...', 'test')
#7 phar:///home/jon/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#8 phar:///home/jon/drush/includes/preflight.inc(67): Drush\Boot\BaseBoot in phar:///home/jon/drush/lib/Drush/Make/Parser/ParserYaml.php on line 26
Drush command terminated abnormally due to an unrecoverable error.                                                                  [error]
Error: Uncaught Error: Class 'Drush\Internal\Symfony\Yaml\Yaml' not found in
phar:///home/jon/drush/lib/Drush/Make/Parser/ParserYaml.php:26
Stack trace:
#0 phar:///home/jon/drush/commands/make/make.utilities.inc(662): Drush\Make\Parser\ParserYaml::parse('\n# DevShop Deve...')
#1 phar:///home/jon/drush/commands/make/make.utilities.inc(40): _make_determine_format('\n# DevShop Deve...')
#2 phar:///home/jon/drush/commands/make/make.utilities.inc(15): _make_parse_info_file('https://raw.git...')
#3 phar:///home/jon/drush/commands/make/make.drush.inc(309): make_parse_info_file('https://raw.git...')
#4 phar:///home/jon/drush/includes/command.inc(422): drush_make('https://raw.git...', 'test')
#5 phar:///home/jon/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#6 phar:///home/jon/drush/includes/command.inc(199): drush_command('https://raw.git...', 'test')
#7 phar:///home/jon/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#8 phar:///home/jon/drush/includes/preflight.inc(67): Drush\Boot\BaseBoot in
phar:///home/jon/drush/lib/Drush/Make/Parser/ParserYaml.php, line 26

Workaround Download and install a prior version of Drush 8.x: https://github.com/drush-ops/drush/releases/tag/8.3.0

System Configuration

Q A
Drush version? 8.3.1
Drupal version? 7.x/8.x
PHP version 7.3
OS? Fedora 31
hanoii commented 4 years ago

I am also having this issue

hanoii commented 4 years ago

I am also experiencing this.

greg-1-anderson commented 4 years ago

Please test again with the HEAD of the 8.x branch.

Build your own phar per before_deploy in .travis.yml:

  - gem install mime-types -v 2.6.2 # https://github.com/travis-ci/travis-ci/issues/5145
  - curl -LSs https://box-project.github.io/box2/installer.php | php
  - composer install --prefer-dist --no-dev --optimize-autoloader --no-interaction
  - php box.phar build

Run drush.phar and see if make works better. Should be better now. I'll tag a stable release once someone confirms.

jonpugh commented 4 years ago
[jon@mufasa drush]$ ./drush.phar --version
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
 Drush Version   :  8.3.2-dev 
jonpugh commented 4 years ago

The make part seems to work, however....

./drush.phar  make https://raw.githubusercontent.com/opendevshop/devshop/1.x/build-devmaster-dev.make.yml test
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
Beginning to build                                                                             [ok]
https://raw.githubusercontent.com/opendevshop/devshop/1.x/build-devmaster-dev.make.yml.
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
sh: switchml: line 1: syntax error: unexpected end of file
sh: error importing function definition for `switchml'
sh: module: line 1: syntax error: unexpected end of file
sh: error importing function definition for `module'
sh: scl: line 1: syntax error: unexpected end of file
sh: error importing function definition for `scl'
sh: _module_raw: line 1: syntax error: unexpected end of file
sh: error importing function definition for `_module_raw'
drupal-7.67 downloaded.                                                                        [ok]
greg-1-anderson commented 4 years ago

Not sure what is causing the errors you are seeing from the .phar you built locally. The .phar built on Travis will probably work for you.

jonpugh commented 4 years ago

@greg-1-anderson Can you publish a "pre-release" phar? Then I would be able to link directly to it in a PR on my end.

greg-1-anderson commented 4 years ago

I would have to do something strange like make an 8.3.2-rc1 release to get it on GitHub. I just need to copy the one I built locally somewhere so that you can download it.

greg-1-anderson commented 4 years ago

Try drush.phar

hanoii commented 4 years ago

@greg-1-anderson it worked for me!

jonpugh commented 4 years ago

:D Perfect!

Works great, thanks @greg-1-anderson

jonpugh commented 4 years ago

No bizarro errors on my end, FWIW.

greg-1-anderson commented 4 years ago

Building an 8.3.2 release on Travis now.