Page MenuHomePhabricator

MediaWiki core creates error due to changes in method signature for setProvides in Composer 2.2
Closed, ResolvedPublicBUG REPORT

Description

Due to a change in Composer 2.2 which deprecates using an indexed array in link setters, MediaWiki core now generates an exception from setProvides() here

  • Update your composer version to at least 2.2.0
  • Run a composer update

What happens?:

Script ComposerHookHandler::onPreUpdate handling the pre-update-cmd event terminated with an exception
  [ErrorException]                                                                                                                                                 
  Package::setProvides must be called with a map of lowercased package name => Link object, got a indexed array, this is deprecated and you should fix your usage.

What should have happened instead?:
Composer runs without error.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
This has been reproduced by several people on various recent versions of MediaWiki 1.35.5 to 1.37 and master.

Event Timeline

Change 749761 had a related patch set uploaded (by Cicalese; author: Cicalese):

[mediawiki/core@master] Pass link in a map

https://gerrit.wikimedia.org/r/749761

taavi triaged this task as High priority.Dec 23 2021, 5:53 PM
taavi added a project: MediaWiki-General.

Change 749767 had a related patch set uploaded (by Cicalese; author: Cicalese):

[mediawiki/core@REL1_37] Pass link in a map

https://gerrit.wikimedia.org/r/749767

Change 749768 had a related patch set uploaded (by Cicalese; author: Cicalese):

[mediawiki/core@REL1_36] Pass link in a map

https://gerrit.wikimedia.org/r/749768

Change 749769 had a related patch set uploaded (by Cicalese; author: Cicalese):

[mediawiki/core@REL1_35] Pass link in a map

https://gerrit.wikimedia.org/r/749769

Change 749761 merged by jenkins-bot:

[mediawiki/core@master] Pass link in a map

https://gerrit.wikimedia.org/r/749761

Change 749769 merged by jenkins-bot:

[mediawiki/core@REL1_35] Pass link in a map

https://gerrit.wikimedia.org/r/749769

Change 749767 merged by jenkins-bot:

[mediawiki/core@REL1_37] Pass link in a map

https://gerrit.wikimedia.org/r/749767

Change 749768 merged by jenkins-bot:

[mediawiki/core@REL1_36] Pass link in a map

https://gerrit.wikimedia.org/r/749768

Reedy assigned this task to cicalese.
Reedy removed a project: Patch-For-Review.