Acquia Lightning Blog: Acquia Doctrine dependencies

Acquia Doctrine dependencies
Adam Balsam
Tue, 07/25/2020 – 15:07

We started receiving reports of broken Lightning builds due to the release of doctrine/common:2.8.0 and/or doctrine/inflector:1.2.0 which require php ~7.1 and php ^7.0 respectively.

Lightning actually doesn’t have a direct dependency on anything under the doctrine namespace. The dependencies come from drupal/core. So should drupal/core constrain doctrine/common to <=2.7.3 so that it continues to support php 5.6? No.

If you follow the dependency tree for what happens when you run composer update for a Lightning project in a php 5.6 environment, it looks like this:

acquia/lightning:2.1.7 requires:
drupal/core:~8.3.1, drupal/core:8.3.5 requires:
doctrine/common:^2.5, doctrine/common:2.8.0 requires php ~7.1, so it will resolve to 2.7.3, which requires:
doctrine/inflector:1.*, doctrine/inflector:1.2.0 requires php:^7.0, so it will resolve to 1.1.0, which simply requires php:>=5.3.2
So why are we getting reports of broken builds?

The problem arises when:

Your project commits its composer.lock file (which it generally should)
Your development environment has a different php version than your CI or production/test environment
If you have php 7.0 installed locally, the dependency resolution for doctrine/inflector will look like this:

acquia/lightning:2.1.7 requires:
drupal/core:~8.3.1, drupal/core:8.3.5 requires:
doctrine/common:^2.5, doctrine/common:2.8.0 requires php ~7.1, so it will resolve to 2.7.3, which requires:
doctrine/inflector:1.*, which will resolve to doctrine/inflector:1.2.0
Which will lock doctrine/inflector to v1.2.0; which requires php ^7.0. Then when you push to your php 5.6 CI environment, you’ll get an error like this:

Problem 1
    – Installation request for doctrine/inflector v1.2.0 -> satisfiable by doctrine/inflector[v1.2.0].
    – doctrine/inflector v1.2.0 requires php ^7.0 -> your PHP version (5.6.24) does not satisfy that requirement.
Problem 2
    – doctrine/inflector v1.2.0 requires php ^7.0 -> your PHP version (5.6.24) does not satisfy that requirement.
    – doctrine/common v2.7.3 requires doctrine/inflector 1.* -> satisfiable by doctrine/inflector[v1.2.0].
    – Installation request for doctrine/common v2.7.3 -> satisfiable by doctrine/common[v2.7.3].

The solution, of course, is to run composer update in a dev environment that matches your CI/test/production environment.

Source: New feed

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Acquia Lightning Blog: Acquia Doctrine dependencies

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.