Problem/Motivation

It is possible to run "composer create-project" to download a site using e.g PHP 7.2 but then only have it fail later on during the install when the codebase realizes that APIs from PHP 7.3 are not available.

Steps to reproduce

Run "composer create-project" with PHP 7.2.

Proposed resolution

Update the root composer.json file to list PHP 7.3 as a requirement.

Remaining tasks

Update composer.json.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Release notes snippet

TBD

Comments

DamienMcKenna created an issue. See original summary.

damienmckenna’s picture

Issue summary: View changes
StatusFileSize
new471 bytes

Does this solve the problem?

damienmckenna’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: drupal-n3170285-2.patch, failed testing. View results

raman.b’s picture

Version: 9.0.x-dev » 9.1.x-dev
Status: Needs work » Needs review
StatusFileSize
new952 bytes
new429 bytes
$ composer validate

./composer.json is valid
damienmckenna’s picture

Ah, thanks.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Rationale makes sense, patch is as minimal as can be.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

@DamienMcKenna how are you running composer create-project? The supported way and the unsupported way both report an error.

composer create-project drupal/recommended-project blah2 9.0.5
Creating a "drupal/recommended-project" project at "./blah2"
Installing drupal/recommended-project (9.0.5)
  - Installing drupal/recommended-project (9.0.5): Downloading (100%)
Created project in /Users/alex/dev/sites/test/blah2
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for drupal/core 9.0.5 -> satisfiable by drupal/core[9.0.5].
    - drupal/core 9.0.5 requires php >=7.3 -> your PHP version (7.2.33) does not satisfy that requirement.
  Problem 2
    - Installation request for drupal/core-composer-scaffold 9.0.5 -> satisfiable by drupal/core-composer-scaffold[9.0.5].
    - drupal/core-composer-scaffold 9.0.5 requires php >=7.3.0 -> your PHP version (7.2.33) does not satisfy that requirement.
  Problem 3
    - Installation request for drupal/core-project-message 9.0.5 -> satisfiable by drupal/core-project-message[9.0.5].
    - drupal/core-project-message 9.0.5 requires php >=7.3.0 -> your PHP version (7.2.33) does not satisfy that requirement.
  Problem 4
    - drupal/core 9.0.5 requires php >=7.3 -> your PHP version (7.2.33) does not satisfy that requirement.
    - drupal/core-recommended 9.0.5 requires drupal/core 9.0.5 -> satisfiable by drupal/core[9.0.5].
    - Installation request for drupal/core-recommended 9.0.5 -> satisfiable by drupal/core-recommended[9.0.5].
composer create-project drupal/core blah2 9.0.5
Creating a "drupal/core" project at "./blah2"


  [InvalidArgumentException]
  Could not find package drupal/core with version 9.0.5 in a version installable using your PHP version 7.2.33.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs work » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

In #8 the issue was not reproducible. In the same comment more information was asked for 2 years ago and none has been supplied. Furthermore, since support for PHP 7.3 is dropped in Drupal 9.4 this may be outdated.

Since we need more information to move forward with this issue, I am setting the status to Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

Thanks!

mile23’s picture

If it's desired that the metapackages have the same PHP constraints as the drupal/core package, then the solution is this:

Update the metapackage generator to include the PHP constraint information from the core package. I believe there is a test which builds using the metapackages, which would fail if the testbot is on the wrong version of PHP, so look out for that.

This IS refers to an old version of core and is specific to recommended-project. The issue needs a little rescope to be more general.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Closing as outdated as no supported versions of Drupal support 7.3