Skip to content

Avoid using symfony/dependency-injection #2061

Closed

Description

@greg-1-anderson

Drupal core uses different versions of symfony/dependency-injection in the 8.1.x line than it does in the 8.0.x line. Even though these two versions are very close, and API-compatible, they definitely do NOT work well together.

The upshot of this is that if DrupalConsole uses symfony/dependency-injection for its DI container, then it will not be possible for a global install of it to work with both a Drupal 8.0.x version and a Drupal 8.1.x version, because the version of symfony/dependency-injection used in DrupalConsole can be compatible with at most one of these. This situation might get worse in the future; it appears that the version of Symfony never changed, even by a bugfix release, in the Drupal 8.0.x line, but I don't know that there is a policy on this. If there isn't, then it is possible that there might be a bugfix release in Drupal 8.1.x that bumps up the version of symfony/dependency-injection, making things even more difficult.

Of course, overall, site-local installs of Drush and DrupalConsole are the best way to go, but there are still a lot of folks who use global installs of these tools, so we're trying to keep things as compatible as possible. To make things more flexible for Drush, we selected league/container for our DI needs. After using it for a little while, I find that I prefer it to symfony/di. Converting wouldn't be too hard; you'd just need to convert your compiler passes to inflectors -- exact techniques might vary depending on what you're doing.

There is more discussion at drush-ops/drush#2018, especially near the end.

Activity

  1. joelpittet commented on Mar 27, 2016

    @joelpittet
    Contributor
  2. greg-1-anderson commented on Mar 30, 2016

    @greg-1-anderson
    ContributorAuthor
  3. greg-1-anderson commented on Apr 7, 2016

    @greg-1-anderson
    ContributorAuthor

    Now that Drupal 8.1 has a rc release, I was wondering what DrupalConsole's strategy was moving forward. Will any effort be made to allow a single DrupalConsole executable to work with both 8.0.x and 8.1.x releases of Drupal?

  4. greg-1-anderson commented on Apr 7, 2016

    @greg-1-anderson
    ContributorAuthor

    Related: #2022

  5. citlacom commented on Apr 15, 2016

    @citlacom
    Contributor

    Is there a fix for this? Should I upgrade Drupal Console to resolve this problem?

  6. greg-1-anderson commented on Apr 15, 2016

    @greg-1-anderson
    ContributorAuthor

    Right now, it is sort of a coincidence that only symfony/dependency-injection is causing problems with Drupal compatibility today. Drupal Console has other requirements in common with Drupal, and these could also cause incompatibilities in the future. So, avoiding this one component would not be a permanent lasting solution. Drupal Console prefers using components provided by Symfony, when available, in preference to similar components provided elsewhere.

    It is my understanding that Drupal Console's strategy is that, officially, any version of Drupal Console only officially supports one version of Drupal, although other versions may also happen to work.

    The maintainers should go ahead and close this issue if that is in fact the planned strategy. I agree that this is reasonable.

  7. citlacom commented on Apr 15, 2016

    @citlacom
    Contributor

    @greg-1-anderson. Good to know, thanks for your explanation.

    I hope that sooner than later a new release that supports officially Drupal 8.1 becomes available. Otherwise, the project I'm working on that depends on Drupal Commerce that also upgraded requirement to this Drupal version caused that this amazing tool is not totally functional. This makes my day very sad.

    However, thanks to all you for your efforts.

    Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions