Page MenuHomePhabricator

REL1_35: composer.json: mediawiki/mediawiki-codesniffer (v31.0.0) cannot be installed
Closed, ResolvedPublic

Description

git clone --single-branch --branch REL1_35 --depth 1 https://gerrit.wikimedia.org/r/mediawiki/extensions/Flow
COMPOSER_ALLOW_SUPERUSER=1 composer update --no-plugins --no-scripts --no-dev

generates the following error:

...
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires mediawiki/mediawiki-codesniffer 31.0.0 -> satisfiable by mediawiki/mediawiki-codesniffer[v31.0.0].
    - phan/phan 2.6.1 requires composer/semver ^1.4 -> satisfiable by composer/semver[1.4.0, ..., 1.7.2].
    - You can only install one version of a package, so only one of these can be installed: composer/semver[1.4.0, ..., 1.7.2, 2.0.0].
    - mediawiki/mediawiki-phan-config 0.10.2 requires phan/phan 2.6.1 -> satisfiable by phan/phan[2.6.1].
    - mediawiki/mediawiki-codesniffer v31.0.0 requires composer/semver 1.5.1|2.0.0 -> satisfiable by composer/semver[1.5.1, 2.0.0].
    - Root composer.json requires mediawiki/mediawiki-phan-config 0.10.2 -> satisfiable by mediawiki/mediawiki-phan-config[0.10.2].

Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.

Which is caused by mediawiki/mediawiki-codesniffer (v31.0.0) not being available any longer. At the time of writing the closest one available was v38.0.0.

My current workaround is to change composer.json to look like: "mediawiki/mediawiki-codesniffer": ">=31.0.0",, so that v38.0.0 also meets the "require-dev".

Is this relaxation of the version the correct fix here?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
kostajh subscribed.

I'm not sure. Maybe we should republish v31.0.0 of mediawiki-codesniffer?

This is probably going to be fixed by T300009.

The version is still listed on packagist https://packagist.org/packages/mediawiki/mediawiki-codesniffer#v31.0.0

The conflict is on composer/semver where phan wants ^1.4 and codesniffer wants 1.5.1. In codesniffer 32.0.0 it was changed to ~1.5.1 to make it more flexible (https://gerrit.wikimedia.org/r/c/mediawiki/tools/codesniffer/+/626682)
But ^1.4 and 1.5.1 should be okay together - https://getcomposer.org/doc/articles/versions.md#caret-version-range-

Not sure what blocks it here. Is this running on php8?

CI and libup is not blocked on this - https://libraryupgrader2.wmcloud.org/logs2/566238

$ composer install
Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Updating dependencies (including require-dev)
Package operations: 35 installs, 0 updates, 0 removals
  - Installing psr/container (1.1.1): Loading from cache
  - Installing pimple/pimple (v3.3.1): Loading from cache
  - Installing squizlabs/php_codesniffer (3.5.5): Loading from cache
  - Installing composer/spdx-licenses (1.5.6): Loading from cache
  - Installing composer/semver (1.5.1): Loading from cache
  - Installing mediawiki/mediawiki-codesniffer (v31.0.0): Loading from cache
  - Installing symfony/polyfill-mbstring (v1.24.0): Loading from cache
  - Installing symfony/polyfill-intl-normalizer (v1.24.0): Loading from cache
  - Installing symfony/polyfill-intl-grapheme (v1.24.0): Loading from cache
  - Installing symfony/polyfill-ctype (v1.24.0): Loading from cache
  - Installing symfony/polyfill-php80 (v1.24.0): Loading from cache
  - Installing symfony/string (v5.4.2): Loading from cache
  - Installing symfony/deprecation-contracts (v2.5.0): Loading from cache
  - Installing symfony/service-contracts (v2.5.0): Loading from cache
  - Installing symfony/polyfill-php73 (v1.24.0): Loading from cache
  - Installing symfony/console (v5.4.2): Loading from cache
  - Installing psr/log (1.1.4): Loading from cache
  - Installing sabre/event (5.1.4): Loading from cache
  - Installing netresearch/jsonmapper (v2.1.0): Loading from cache
  - Installing microsoft/tolerant-php-parser (v0.0.20): Loading from cache
  - Installing phpdocumentor/reflection-common (2.2.0): Loading from cache
  - Installing webmozart/assert (1.10.0): Loading from cache
  - Installing phpdocumentor/type-resolver (1.6.0): Loading from cache
  - Installing phpdocumentor/reflection-docblock (5.3.0): Loading from cache
  - Installing felixfbecker/advanced-json-rpc (v3.2.1): Loading from cache
  - Installing composer/xdebug-handler (1.4.6): Loading from cache
  - Installing phan/phan (2.6.1): Loading from cache
  - Installing mediawiki/phan-taint-check-plugin (3.0.2): Loading from cache
  - Installing mediawiki/mediawiki-phan-config (0.10.2): Loading from cache
  - Installing mediawiki/minus-x (1.1.0): Loading from cache
  - Installing php-parallel-lint/php-console-color (v0.3): Loading from cache
  - Installing php-parallel-lint/php-console-highlighter (v0.5): Loading from cache
  - Installing php-parallel-lint/php-parallel-lint (v1.2.0): Loading from cache
  - Installing symfony/css-selector (v2.8.52): Loading from cache
  - Installing symfony/dom-crawler (v2.8.52): Loading from cache
symfony/service-contracts suggests installing symfony/service-implementation
symfony/console suggests installing symfony/event-dispatcher
symfony/console suggests installing symfony/lock
symfony/console suggests installing symfony/process
phan/phan suggests installing ext-ast (Needed for parsing ASTs (unless --use-fallback-parser is used). 1.0.1+ is needed, 1.0.6+ is recommended.)
Writing lock file
Generating autoload files
12 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

@Umherirrender PHP is 7.4: PHP 7.4.27 (cli) (built: Jan 26 2022 18:11:58) ( NTS ). Is this an issue? Am I running a non-supported environment?

Reedy renamed this task from REL1_35: composer.json: mediawiki/mediawiki-codesniffer (v31.0.0) no longer available to REL1_35: composer.json: mediawiki/mediawiki-codesniffer (v31.0.0) cannot be installed.Feb 8 2022, 3:55 PM

This is probably going to be fixed by T300009.

I would concur. But nothing to stop someone doing that ahead of time if they want to bump mediawiki/mediawiki-codesniffer and then disable all the failing rules :)

@Umherirrender PHP is 7.4: PHP 7.4.27 (cli) (built: Jan 26 2022 18:11:58) ( NTS ). Is this an issue? Am I running a non-supported environment?

The environment is supported (as far as I know). But I have no good explaination why it happens on that php version.

Change 761020 had a related patch set uploaded (by Zabe; author: Zabe):

[mediawiki/extensions/Flow@REL1_35] build: Updating mediawiki/mediawiki-codesniffer to 38.0.0

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

Change 761020 merged by jenkins-bot:

[mediawiki/extensions/Flow@REL1_35] build: Updating mediawiki/mediawiki-codesniffer to 38.0.0

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

Zabe closed this task as Resolved.EditedFeb 8 2022, 8:51 PM
Zabe claimed this task.

Bumped required version of mediawiki/mediawiki-codesniffer to 38.0.0.

I confirm that I am no longer able to reproduce the issue, and the issue is solved for me. Thank you for the engagement, prompt reply, and welcoming environment! <3

I confirm that I am no longer able to reproduce the issue, and the issue is solved for me. Thank you for the engagement, prompt reply, and welcoming environment! <3

Thank you for the report!