Problem/Motivation
The \Drupal\DrupalInstalled::VERSIONS_HASH is calculated from the set of packages installed by composer. Unfortunately the sort order of the packages returned by \Composer\Repository\RepositoryInterface::getPackages() is not guaranteed to be the same for an equivalent set of packages. This can result in otherwise identical builds having a different versions hash.
Steps to reproduce
On 11.x checkout of Drupal:
composer require drupal/gin drupal/entity_usage
// Store version hash to compare for later.
composer remove drupal/gin
composer require drupal/gin
// Check version hash - they should match but they do not.
Proposed resolution
Sort the packages before producing the hash.
Remaining tasks
User interface changes
None
Introduced terminology
N/a
API changes
None
Data model changes
None
Release notes snippet
N/a
Issue fork drupal-3572527
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3572527-drupaldrupalinstalledversionshash-is-not
changes, plain diff MR !14707
Comments
Comment #2
alexpottComment #4
alexpottComment #5
alexpottTest only run fails as expected: https://git.drupalcode.org/issue/drupal-3572527/-/jobs/8433713
Comment #6
chr.fritschThe fix looks good to me and it also fixes the problem it in our multi arch docker build where I first discovered it.
Comment #10
catchCommitted/pushed to main, 11.x and 11.3.x, thanks!