acquia / lightning-project

A Composer-based installer for the Lightning distribution of Drupal 8. Support ended on November 2, 2021 and this project is no longer maintained.
133 stars 60 forks source link

Drupal Console Alteration? #15

Closed mark-schaal closed 7 years ago

mark-schaal commented 8 years ago

I've noticed in the community that there has been divisiveness over whether to track Drupal Console in the composer file, or as a reference to a local/global installation on a machine. Is there documentation or clarification on what the latest (1.11) version of Lightning expects or how it should be integrated?

I'm seeing the following and sussing out what will be more sustainable for continued use with Lightning:

[ERROR] Drupal Console is not installed at: /Users/mschaal/Dropbox/Web                                                 
         Applications/Drupal/D8-Demos/Lightning-Demo/docroot/     

You must execute this composer command:

 composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader 

And also:

ITLP00361:Lightning-Demo mschaal$ composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader
./composer.json has been updated
No patches supplied.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - drupal/console 1.0.0-alpha1 requires symfony/css-selector ~2.8 -> satisfiable by symfony/css-selector[2.8.x-dev].
    - drupal/console 1.0.0-rc1 requires symfony/css-selector ~2.8 -> satisfiable by symfony/css-selector[2.8.x-dev].
    - drupal/console 1.0.0-rc2 requires symfony/css-selector ~2.8 -> satisfiable by symfony/css-selector[2.8.x-dev].
    - drupal/console 1.0.0-rc3 requires symfony/css-selector ~2.8 -> satisfiable by symfony/css-selector[2.8.x-dev].
    - drupal/console 1.0.0-rc4 requires symfony/css-selector ~2.8 -> satisfiable by symfony/css-selector[2.8.x-dev].
    - drupal/console 1.0.0-rc5 requires symfony/css-selector ~2.8 -> satisfiable by symfony/css-selector[2.8.x-dev].
    - Conclusion: don't install symfony/css-selector 2.8.x-dev
    - Conclusion: don't install drupal/console 1.0.0-beta5
    - Conclusion: don't install drupal/console 1.0.0-beta4
    - Conclusion: don't install drupal/console 1.0.0-beta3
    - Conclusion: don't install drupal/console 1.0.0-beta2
    - Conclusion: don't install drupal/console 1.0.0-beta1
    - Installation request for symfony/css-selector (locked at v2.7.19, required as 2.7.*) -> satisfiable by symfony/css-selector[v2.7.19].
    - Conclusion: remove symfony/config v3.1.5
    - Installation request for drupal/console ~1.0 -> satisfiable by drupal/console[1.0.0-alpha1, 1.0.0-alpha2, 1.0.0-beta1, 1.0.0-beta2, 1.0.0-beta3, 1.0.0-beta4, 1.0.0-beta5, 1.0.0-rc1, 1.0.0-rc2, 1.0.0-rc3, 1.0.0-rc4, 1.0.0-rc5].
    - Conclusion: don't install symfony/config v3.1.5
    - drupal/console 1.0.0-alpha2 requires symfony/config ~2.8 -> satisfiable by symfony/config[2.8.x-dev, v2.8.0, v2.8.0-BETA1, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.2, v2.8.3, v2.8.4, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9].
    - Can only install one of: symfony/config[2.8.x-dev, v3.1.5].
    - Can only install one of: symfony/config[v2.8.0, v3.1.5].
    - Can only install one of: symfony/config[v2.8.0-BETA1, v3.1.5].
    - Can only install one of: symfony/config[v2.8.1, v3.1.5].
    - Can only install one of: symfony/config[v2.8.10, v3.1.5].
    - Can only install one of: symfony/config[v2.8.11, v3.1.5].
    - Can only install one of: symfony/config[v2.8.12, v3.1.5].
    - Can only install one of: symfony/config[v2.8.2, v3.1.5].
    - Can only install one of: symfony/config[v2.8.3, v3.1.5].
    - Can only install one of: symfony/config[v2.8.4, v3.1.5].
    - Can only install one of: symfony/config[v2.8.5, v3.1.5].
    - Can only install one of: symfony/config[v2.8.6, v3.1.5].
    - Can only install one of: symfony/config[v2.8.7, v3.1.5].
    - Can only install one of: symfony/config[v2.8.8, v3.1.5].
    - Can only install one of: symfony/config[v2.8.9, v3.1.5].
    - Installation request for symfony/config (locked at v3.1.5) -> satisfiable by symfony/config[v3.1.5].

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

I could muddle through some dependency adjustments and sort this out for the current application we run, but I'm more interested in any vision/feedback from the engineers on where they plan on driving the integration, thanks!

jmolivas commented 8 years ago

Hey @phenaproxima @grasmash @balsama any feedback on this one?

I tried a fresh install

composer create-project acquia/lightning-project:^8.1.0 lightning --no-interaction

And after that I executed:

composer require drupal/console:~1.0

And got the same error message

After running composer show symfony/css-selector I can see 2.7.21 for that dependency

> composer show symfony/css-selector
name     : symfony/css-selector
descrip. : Symfony CssSelector Component
keywords :
versions : * v2.7.21
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
source   : [git] https://github.com/symfony/css-selector.git 3b37ddb7b68fbb0b7595037b392347a6f60acb80
dist     : [zip] https://api.github.com/repos/symfony/css-selector/zipball/3b37ddb7b68fbb0b7595037b392347a6f60acb80 3b37ddb7b68fbb0b7595037b392347a6f60acb80
names    : symfony/css-selector

autoload
psr-4
Symfony\Component\CssSelector\ => .
exclude-from-classmap

requires
php >=5.3.9
jmolivas commented 8 years ago

@mark-schaal Starting on RC releases DrupalConsole should be installed per site.

The global executable is only a Launcher tool to find DrupalConsole installed on the site.

balsama commented 7 years ago

I defer to @jmolivas on best practices regarding global vs local/per site installation of DrupalConsole - and he indicates above that per site is preferred. I don't think lightning-project will include it in its dev dependencies until there comes a time where we use DrupalConsole for our tests or somewhere else in our development.

Either way, that leaves us with figuring out where the root of the dependency conflict is. I'm happy to loosen out constraints if needed.

jmolivas commented 7 years ago

@mark-schaal To avoid dependency conflicts you can add DrupalConsole when downloading the Lightning distribution by following this steps.

Instead of executing

composer create-project acquia/lightning-project:^8.1.0 lightning

Pass the --no-install flag

composer create-project acquia/lightning-project:^8.1.0 lightning --no-install

Using --no-install flag will skip installation of the package dependencies

Then execute:

composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader --sort-packages

This last command will add the DrupalConsole dependency to the composer.json file and then resolve and download Lightning + DrupalConsole.

balsama commented 7 years ago

@jmolivas I suppose the following should work for existing projects then (just adding the --no-update flag to the require command)?

composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader --sort-packages --no-update

Followed by:

composer update
jmolivas commented 7 years ago

@balsama I just tested and it that also works thanks. cc: @mark-schaal

balsama commented 7 years ago

Great. @mark-schaal let me know if think anything else can be clarified/documented. @jmolivas blogged about this here: https://drupalconsole.com/articles/add-drupalconsole-to-a-project-using-acquia-lightning-distribution Closing for now. Feel feee to reopen if you there is anything else.

(thanks @jmolivas !)

jmolivas commented 7 years ago

@balsama will be great to have this fixed out-of-the-box let me know when you have some time to test this and make changes on the dependencies of both projects.

balsama commented 7 years ago

@jmolivas I think it's your symfony/domcrawler dependency. Lightning doesn't have a specific constraint on it, but it installs 3.1.7 based on symfony/browser-kit, fapbot/goutte, and behat/mink-browserkit-driver.

Can DrupalConsole loosen/update its dom-crawler constraints? I opened a PR here: https://github.com/hechoendrupal/DrupalConsole/pull/2983

mark-schaal commented 7 years ago

This works for me! Thanks @jmolivas and @balsama for the great clarification and the wonderful work!

TigerC10 commented 7 years ago

@balsama You're a genius! Thank you, I was pulling out my hair until I read your comment about how to get around the issue.