Skip to content
This repository has been archived by the owner on Oct 16, 2022. It is now read-only.

Bug: requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.3.0] on composer install #93

Closed
5 tasks done
strarsis opened this issue Jun 8, 2022 · 6 comments
Labels

Comments

@strarsis
Copy link

strarsis commented Jun 8, 2022

Terms

Description

What's wrong?

When trying to install the composer dependencies using composer v2 (which recent Trellis also does, hence it also causes a deployment error there), composer fails to install the dependencies because the composer.json expects composer-plugin-api v1.x while composer v2 has the composer-plugin-api v2.x.

What have you tried?

composer install inside the site/ directory of this repository.

What insights have you gained?

Incompatibilities with composer v2 which is the current version and also used in recent Trellis.

Possible solutions

Update the composer dependencies / update the composer.lock lockfile.

Temporary workarounds

Steps To Reproduce

A.

  1. Use this repository as a Trellis site (repo: [email protected]:roots/roots-example-project.com.git).
  2. Deploy the site, note that Trellis deployment fails.

B.

  1. Clone this repository (e.g. git clone [email protected]:roots/roots-example-project.com.git).
  2. Go into the site/ directory (cd roots-example-project.com/site.
  3. Invoke composer install.
    Note the error that occurs.

Expected Behavior

No composer errors when installing the dependencies using composer install.

Actual Behavior

composer error when using composer install.

Relevant Log Output

composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - composer/installers is locked to version v1.6.0 and an update of this package was not requested.
    - composer/installers v1.6.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.3.0] but it does not match the constraint.
  Problem 2
    - roots/wordpress-core-installer is locked to version 1.1.0 and an update of this package was not requested.
    - roots/wordpress-core-installer 1.1.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.3.0] but it does not match the constraint.
  Problem 3
    - composer/installers v1.6.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.3.0] but it does not match the constraint.
    - roots/wp-password-bcrypt 1.0.0 requires composer/installers ~1.0 -> satisfiable by composer/installers[v1.6.0].
    - roots/wp-password-bcrypt is locked to version 1.0.0 and an update of this package was not requested.

Versions

  • Update to WordPress 5.2 (#432)
@strarsis strarsis added the bug label Jun 8, 2022
@strarsis
Copy link
Author

strarsis commented Jun 8, 2022

So I started updating Bedrock and Sage in the example project.
For updating Trellis I noticed that trellis (Trellis CLI now has a trellis new command that creates the whole example project, including a bedrock site. Except for Sage, but there is a simple composer create-project roots/sage sage dev-main command for that (inside the site/web/app/themes/ directory).

This should be added as a note to this project: For getting the most recent and working (with composer v2) example project, use trellis new from Trellis CLI, and composer create-project roots/sage sage dev-main inside site/web/app/themes/ of the directory newly created by trellis.

@swalkinshaw
Copy link
Member

We've talked about just retiring this repo entirely since we aren't sure how useful it is.

Do you use this as a template?

@strarsis
Copy link
Author

strarsis commented Jun 8, 2022

@swalkinshaw: I don't know if this already exists (and I simply missed it), but it would be great if the Trellis repository wordpress_sites.yml uses a real, recent Bedrock example site (the currently used [email protected]:example/example.com.git repository doesn't exist).
This helps with testing deployments from an unchanged Trellis, otherwise an empty Bedrock site repository needs to be created first. It would be great if the example there would just deploy an empty but recent Bedrock site.

Edit: Maybe not for production (due to security reasons, as someone may accidentally deploy an empty site to production), but for staging this would be quite useful.

@strarsis
Copy link
Author

strarsis commented Jun 8, 2022

@swalkinshaw: Edit 2: The Bedrock repository itself could be used as the example site?

@swalkinshaw
Copy link
Member

It can be... I actually use it locally for testing. I think I just wanted [email protected]:example/example.com.git to be obvious that it should be replaced. 1) since it's clearly a placeholder, and 2) it would fail anyway

Maybe it doesn't matter much since there's already a comment (and docs)

@strarsis
Copy link
Author

strarsis commented Jun 8, 2022

OK, so IMHO this repository can be retired as it is quite outdated now and trellis new offers a way to create an example project with Trellis + Bedrock that is recent.

Edit: The Bedrock repo can be added as comment to the example site in Trellis on production and staging. So it is very easy to copy/enable it if Trellis deployments should be tested quickly.

@strarsis strarsis closed this as completed Jun 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants