Problem/Motivation

I receive composer error: "Running composer install get error "The provided cwd "../squizlabs/php_codesniffer" does not exist."

Steps to reproduce

When executing 'composer install' after doing the latest 'composer update -W' the error appears.
I was able to isolate the issue to this module by executing the command 'composer update dealerdirect/phpcodesniffer-composer-installer -W'. After doing this the composer failure appears.

Drupal 10.5.0
PHP 8.3.21
Mariadb 10.6.21

Proposed resolution

Declare a conflict with v 1.1.0.

Workaround

composer require dealerdirect/phpcodesniffer-composer-installer:"1.0.0"

Be sure to remove this top-level requirement once core or the upstream package is updated to resolve the issue.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3532187

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

adrianm6254 created an issue. See original summary.

adrianm6254’s picture

Issue summary: View changes
adrianm6254’s picture

pandaski’s picture

Having the same issue from this morning.

The provided cwd "../squizlabs/php_codesniffer" does not exist.

Here is the release note for dealerdirect/phpcodesniffer-composer-installer

https://github.com/PHPCSStandards/composer-installer/releases/tag/v1.1.0

rfay’s picture

I guess https://github.com/PHPCSStandards/composer-installer/issues/239 needs a better or more complete repro case to convince the maintainer there?

sharif.elshobkshy’s picture

A PR has been created by the author to address this bug.

Until the bug is fixed, you can temporarily revert to the previous version.

composer require dealerdirect/phpcodesniffer-composer-installer:"1.0.0"

ericpoir’s picture

I can confirm that #6 works.

mlubbers’s picture

I can also confirm that option #6 works.
I got this message for only 2 out of ten websites running on the same server.

elaman’s picture

Perhaps, you can also do something like this:

{
    ...
    "conflict": {
        "dealerdirect/phpcodesniffer-composer-installer": "1.1.0"
    },
    ...
}

So that new version with a fix will automatically go through:

kgaut’s picture

#6 fix the issue for my project after updating to drupal 11.2.*

liam morland’s picture

The fix in #9 fixes it for me. It has the same effect as #6 except that later updates, when the issue is fixed, will be installed.

julien tekrane’s picture

#9 is working for me. Thank you

I prefer this solution because it does not add extra stuff and not lock to a specific version

neclimdul’s picture

dang, needed contrib testing to work today and this is blocking it. That sucks.

Looks like an upstream fix is in the works to be released soon.

https://github.com/PHPCSStandards/composer-installer/pull/245

catch’s picture

I think we can/should commit #9 to core.

immaculatexavier made their first commit to this issue’s fork.

catch’s picture

Version: 10.5.x-dev » 11.x-dev

Thanks for the 10.5 MR, however we also need an 11.x MR here so we can backport from there.

immaculatexavier’s picture

Status: Active » Needs review

Created MR against 11.x

alexpott made their first commit to this issue’s fork.

kmonty’s picture

Is this justifiable for a backport to 10.4 as well?

xjm’s picture

Priority: Normal » Critical
Issue tags: +11.2.0 update

Dang, wish I had known about this 24h ago when we tagged 11.2.1.

rkoller’s picture

hm the MR is setting dealerdirect/phpcodesniffer-composer-installer to 1.1.0, but the actual fix in https://github.com/PHPCSStandards/composer-installer/pull/245 that got merged is targeted for the to be released 1.1.1?

alexpott’s picture

@rkoller the MR is saying we conflict with 1.1.0 so it will not be installed.

rkoller’s picture

argh apologies, missed the conflict line :( was only focus on the version number and missed the context. thanks for the explanation!

xjm’s picture

Issue summary: View changes

Regarding a 10.4 backport, @catch and I discussed and agreed that we will consider backporting this to 11.1 and 10.4 and creating a tagged release declaring the conflict on those branches as well. We will do so if it is not fixed upstream in advance of the next security window, since this could interfere with site updates. In the meanwhile, we recommend sites blocked on this explicitly require the 1.0.0 version as a workaround:

composer require dealerdirect/phpcodesniffer-composer-installer:"1.0.0"

Adding the workaround to the IS.

xjm’s picture

Issue summary: View changes

And a reminder to remove the pinned requirement once upstream is fixed.

  • catch committed 11260a0f on 11.2.x
    Issue #3532187 by immaculatexavier, alexpott, adrianm6254, xjm, sharif....

  • catch committed 6f029005 on 11.x
    Issue #3532187 by immaculatexavier, alexpott, adrianm6254, xjm, sharif....

  • catch committed daa33ee3 on 10.6.x
    Issue #3532187 by immaculatexavier, alexpott, adrianm6254, xjm, sharif....

  • catch committed f6592814 on 10.5.x
    Issue #3532187 by immaculatexavier, alexpott, adrianm6254, xjm, sharif....
catch’s picture

Version: 11.x-dev » 11.1.x-dev
Status: Needs review » Patch (to be ported)

Going to go ahead and commit from needs review here given they are trivial MRs and this is urgent.

Committed/pushed to 11.x/11.2.x/10.6.x/10.5.x respectively.

Leaving open for 11.1 and 10.4 backports depending on whether there's an upstream release soon.

anthonyroundtree’s picture

Is there a plan to address 11.1.x users?

gwanjama’s picture

#9 worked like a charm for me.

catch’s picture

@anthonyroundtree see #32

sleitner’s picture

I wonder when (root)/composer.json for drupal/drupal is involved in install or update? I still have the problem that phpcodesniffer-composer-installer 1.1.0 is installed when updating to Drupal 10.5.1 with composer.

Shouldn't the conflict setting be placed in core/composer.json for drupal/core?

catch’s picture

Version: 11.1.x-dev » 11.x-dev
Status: Patch (to be ported) » Needs work

I think @sleitner is probably right... This is why we shouldn't commit issues from needs review even when they're trivial.

sleitner changed the visibility of the branch 3532187-composer-issue-when to hidden.

sleitner’s picture

Status: Needs work » Needs review
xjm’s picture

Is there any reason not to declare the conflict in both places, for both tooling and production metapackages?

sleitner’s picture

I don't think it's necessary because drupal/core is a dependency, but maybe better safe than sorry.

joegl’s picture

There's been a release today with a change to resolve the issue: https://github.com/PHPCSStandards/composer-installer/releases/tag/v1.1.1

smustgrave’s picture

Status: Needs review » Needs work

Surprised the bot didn't pick this up but the MR appears to have merge conflicts

sleitner’s picture

Status: Needs work » Needs review
vladimiraus’s picture

Status: Needs review » Reviewed & tested by the community

Tested on D 10.5 and D11.2.
Good to go.

  • alexpott committed e325ec12 on 10.5.x
    Issue #3532187 by sleitner, immaculatexavier, alexpott, catch,...

  • alexpott committed f7d3976e on 10.6.x
    Issue #3532187 by sleitner, immaculatexavier, alexpott, catch,...

  • alexpott committed 52370ec9 on 11.2.x
    Issue #3532187 by sleitner, immaculatexavier, alexpott, catch,...

  • alexpott committed cd9743a8 on 11.x
    Issue #3532187 by sleitner, immaculatexavier, alexpott, catch,...
alexpott’s picture

Version: 11.x-dev » 10.5.x-dev
Status: Reviewed & tested by the community » Fixed

Committed cd9743a and pushed to 11.x. Thanks!
Committed 52370ec and pushed to 11.2.x. Thanks!
Committed f7d3976 and pushed to 10.6.x. Thanks!
Committed e325ec1 and pushed to 10.5.x. Thanks!

xjm’s picture

Thanks for sorting this properly.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.