wp-cli / wp-cli-dev

🛠 WP-CLI development environment that allows for easy development across all packages
36 stars 36 forks source link

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

Closed strarsis closed 2 years ago

strarsis commented 2 years ago

Describe the current, buggy behavior composer install doesn't succeed with current main branch:

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

Problem 1
    - Root composer.json requires wp-cli/automated-tests dev-master, found wp-cli/automated-tests[dev-main] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 2
    - Root composer.json requires wp-cli/cache-command dev-master, found wp-cli/cache-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 3
    - Root composer.json requires wp-cli/checksum-command dev-master, found wp-cli/checksum-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 4
    - Root composer.json requires wp-cli/config-command dev-master, found wp-cli/config-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 5
    - Root composer.json requires wp-cli/doctor-command dev-master, found wp-cli/doctor-command[dev-main] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 6
    - Root composer.json requires wp-cli/embed-command dev-master, found wp-cli/embed-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 7
    - Root composer.json requires wp-cli/eval-command dev-master, found wp-cli/eval-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 8
    - Root composer.json requires wp-cli/i18n-command dev-master, found wp-cli/i18n-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 9
    - Root composer.json requires wp-cli/language-command dev-master, found wp-cli/language-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 10
    - Root composer.json requires wp-cli/maintenance-mode-command dev-master, found wp-cli/maintenance-mode-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 11
    - Root composer.json requires wp-cli/package-command dev-master, found wp-cli/package-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 12
    - Root composer.json requires wp-cli/rewrite-command dev-master, found wp-cli/rewrite-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 13
    - Root composer.json requires wp-cli/role-command dev-master, found wp-cli/role-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 14
    - Root composer.json requires wp-cli/server-command dev-master, found wp-cli/server-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 15
    - Root composer.json requires wp-cli/shell-command dev-master, found wp-cli/shell-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 16
    - Root composer.json requires wp-cli/super-admin-command dev-master, found wp-cli/super-admin-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 17
    - Root composer.json requires wp-cli/widget-command dev-master, found wp-cli/widget-command[dev-main, 2.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 18
    - Root composer.json requires wp-cli/wp-cli-bundle dev-master, found wp-cli/wp-cli-bundle[dev-main, 2.6.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 19
    - Root composer.json requires wp-cli/wp-cli-tests dev-master, found wp-cli/wp-cli-tests[dev-main, 3.0.x-dev (alias of dev-main)] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 20
    - Root composer.json requires wp-cli/wp-config-transformer dev-master as 1.2.x-dev, found wp-cli/wp-config-transformer[dev-main] but it does not match the constraint. Perhaps dev-master was renamed to dev-main?
  Problem 21
    - Root composer.json requires wp-cli/scaffold-package-command dev-master -> satisfiable by wp-cli/scaffold-package-command[dev-master].
    - wp-cli/scaffold-package-command dev-master requires wp-cli/package-command ^2 -> found wp-cli/package-command[dev-main, 2.x-dev (alias of dev-main)] but it conflicts with your root composer.json require (dev-master).

Describe how other contributors can replicate this bug Follow the installation instructions in this repository/of this package. composer install fails to complete successfully.

Describe what you would expect as the correct outcome composer install succeeds.

Let us know what environment you are running this on

OS:     Linux 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64
Shell:  /bin/bash
PHP binary:     /usr/bin/php7.4
PHP version:    7.4.28
php.ini used:   /etc/php/7.4/cli/php.ini
MySQL binary:   /usr/bin/mysql
MySQL version:  mysql  Ver 8.0.28-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))
SQL modes:
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /home/build/src/wp-cli-dev
WP-CLI packages dir:    /home/build/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:  /home/build/src/wp-cli-dev/wp-cli.yml
WP-CLI version: 2.6.0

Provide a possible solution Update incorrect versions in the composer packages to be installed?

janw-me commented 2 years ago

I'm also noticed this problem and I started updating a couple of these to dev-main but then you get errors like.

  Problem 17
    - Root composer.json requires wp-cli/automated-tests dev-main -> satisfiable by wp-cli/automated-tests[dev-main].
    - wp-cli/automated-tests dev-main requires wp-cli/wp-cli-bundle dev-main -> found wp-cli/wp-cli-bundle[dev-main, 2.6.x-dev (alias of dev-main)] but it conflicts with your root composer.json require (dev-master).
  Problem 18
    - Root composer.json requires wp-cli/config-command dev-main -> satisfiable by wp-cli/config-command[dev-main].
    - wp-cli/config-command dev-main requires wp-cli/wp-config-transformer ^1.2.1 -> satisfiable by wp-cli/wp-config-transformer[v1.2.1, ..., v1.3.0] from composer repo (https://repo.packagist.org) but wp-cli/wp-config-transformer[dev-main] from path repo (wp-config-transformer) has higher repository priority. The packages from the higher priority repository do not match your constraint and are therefore not installable. That repository is canonical so the lower priority repo's packages are not installable. See https://getcomposer.org/repoprio for details and assistance.
  Problem 19
    - Root composer.json requires wp-cli/scaffold-package-command dev-master -> satisfiable by wp-cli/scaffold-package-command[dev-master].
    - wp-cli/scaffold-package-command dev-master requires wp-cli/package-command ^2 -> found wp-cli/package-command[dev-main, 2.x-dev (alias of dev-main)] but it conflicts with your root composer.json require (dev-master).
strarsis commented 2 years ago

@janw-me: A bit on a tangent here: I need/installed this package because I want to test changes on the wp i18n package. While the initial tests run fine, the behat tests currently don't run on my workstation with this error:

> run-behat-tests
ERROR 1045 (28000): Access denied for user 'wp_cli_test'@'localhost' (using password: YES)
Script run-behat-tests handling the behat event returned with error code 1
Script @behat was called via test

The database has to be prepared first, I want to use the wp-cli-dev package for that - would this be the right approach for setting up the environment for testing of wp cli components?

janw-me commented 2 years ago

By default behat expects the following:

Before running the functional tests, you’ll need a MySQL (or MariaDB) user called wp_cli_test with the password password1 that has full privileges on the MySQL database wp_cli_test.

source

But you can set your own by exporting variables. Read this.

strarsis commented 2 years ago

@janw-me: Edit: I actually read the thing and it is mentioned there 😊, I should read docs more rigorously:

The database can be set up by running composer prepare-tests. This will create the database and the user and configure the necessary privileges. Note that this operation is not needed for every test run, it only needs to be run the first time for the initial setup.

janw-me commented 2 years ago

I don't think so you could create a script for it. But I think you are hitting on something.

This is a barrier to entry. I think the error message should point to instructions. For people who do this for the first time, or once in a blue moon (me).

Also a optional php config file to override these settings. instead of adding the bash variables every time.

janw-me commented 2 years ago

Earlier today I updated documentation pointing to set these variables.

My suggestion: Create a config file with CONSTANTS that are the current defaults. And allow users to set these. instead of running a bunch of exports every reboot/login.

A danger might be that setting that config file might end up in a pull request. But form a technical point I would say good-first-issue

schlessera commented 2 years ago

Ideally, the process should no what the potential user errors are (if you've missed a step from the documentation) and print helpful messages to unblock the users at each potential pitfall.

danielbachhuber commented 2 years ago

It looks like the original issue was resolved here. Feel free to re-open if not, and open new issues for any further work.