Skip to content

Restore corrupted package metadata in composer.lock - #49

Merged
saarnilauri merged 1 commit into
WordPress:trunkfrom
noruzzamans:fix/48-composer-lock-conflict
Oct 23, 2026
Merged

saarnilauri merged 1 commit into
WordPress:trunkfrom
noruzzamans:fix/48-composer-lock-conflict

Conversation

@noruzzamans

Copy link
Copy Markdown
Member

What?

Restores corrupted package metadata entries in composer.lock so that composer install succeeds cleanly on trunk.

Fixes #48.

Why?

During a previous merge conflict resolution on composer.lock (d8c3e53), fragments from phpcompatibility/php-compatibility and phpstan/phpstan were inadvertently spliced into four packages-dev entries:

  1. nyholm/psr7 (1.8.2): Acquired "replace": { "wimg/php-compatibility": "*" }, a duplicate "require-dev" key, "default-branch": true, "type": "phpcodesniffer-standard", and "license": ["LGPL-3.0-or-later"]. Because both nyholm/psr7 and phpcompatibility/php-compatibility claimed to replace wimg/php-compatibility, composer install failed with:

    Only one of these can be installed: phpcompatibility/php-compatibility[dev-develop], nyholm/psr7[1.8.2]. They both replace wimg/php-compatibility and thus cannot coexist.

  2. phar-io/manifest (2.0.4): Acquired a phpcsstandards "require-dev" block and "type": "phpcodesniffer-standard" instead of "type": "library".
  3. php-http/discovery (1.20.0): Acquired "license": ["LGPL-3.0-or-later"] instead of "MIT".
  4. sebastian/global-state (5.0.8): Acquired "bin": ["phpstan", "phpstan.phar"] and a duplicate "type": "library" key.

How?

Restores the canonical package metadata for those four locked packages in composer.lock without churning unrelated dependency versions or altering the lockfile content-hash.

Testing Instructions

  1. Check out this branch.
  2. Run composer validate and verify the lock file is valid.
  3. Run composer install and verify all 45 dev dependencies install without conflict.
  4. Run composer test and composer lint.

@noruzzamans
noruzzamans marked this pull request as ready for review October 9, 2026 09:25
@noruzzamans
noruzzamans requested a review from a team October 9, 2026 09:25
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: noruzzamans <noruzzaman@git.wordpress.org>
Co-authored-by: Arkenon <arkenon@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@jeffpaul jeffpaul added this to the 1.1.0 milestone Oct 9, 2026

@saarnilauri saarnilauri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I checked this beyond the four entries in the description. I generated a fresh lock that pins all 45 packages to their exact locked versions and commits, then compared every entry field by field, including key order. On trunk, 5 entries differ; on this branch, only PHPCompatibility's time differs. That's expected for a dev-develop#<ref> constraint after develop has moved on. So the repair is complete and matches Composer's own output exactly.

composer install fails on trunk with the #48 error, and on this branch all 45 packages install and composer test / composer lint pass.

@saarnilauri
saarnilauri merged commit 8069197 into WordPress:trunk Oct 23, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

composer.lock on trunk can't be installed: php-compatibility dev-develop conflicts with nyholm/psr7

3 participants