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
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
Comment #2
adrianm6254 commentedComment #3
adrianm6254 commentedComment #4
pandaski commentedHaving the same issue from this morning.
Here is the release note for dealerdirect/phpcodesniffer-composer-installer
https://github.com/PHPCSStandards/composer-installer/releases/tag/v1.1.0
Comment #5
rfayI guess https://github.com/PHPCSStandards/composer-installer/issues/239 needs a better or more complete repro case to convince the maintainer there?
Comment #6
sharif.elshobkshy commentedA 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"Comment #7
ericpoir commentedI can confirm that #6 works.
Comment #8
mlubbers commentedI can also confirm that option #6 works.
I got this message for only 2 out of ten websites running on the same server.
Comment #9
elamanPerhaps, you can also do something like this:
So that new version with a fix will automatically go through:
Comment #10
kgaut commented#6 fix the issue for my project after updating to drupal 11.2.*
Comment #11
liam morlandThe 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.
Comment #12
julien tekrane commented#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
Comment #13
neclimduldang, 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
Comment #14
catchI think we can/should commit #9 to core.
Comment #17
catchThanks for the 10.5 MR, however we also need an 11.x MR here so we can backport from there.
Comment #19
immaculatexavier commentedCreated MR against 11.x
Comment #21
kmontyIs this justifiable for a backport to 10.4 as well?
Comment #22
xjmDang, wish I had known about this 24h ago when we tagged 11.2.1.
Comment #23
rkollerhm the MR is setting
dealerdirect/phpcodesniffer-composer-installerto1.1.0, but the actual fix in https://github.com/PHPCSStandards/composer-installer/pull/245 that got merged is targeted for the to be released1.1.1?Comment #24
alexpott@rkoller the MR is saying we conflict with 1.1.0 so it will not be installed.
Comment #25
rkollerargh apologies, missed the conflict line :( was only focus on the version number and missed the context. thanks for the explanation!
Comment #26
xjmRegarding 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.0version as a workaround:Adding the workaround to the IS.
Comment #27
xjmAnd a reminder to remove the pinned requirement once upstream is fixed.
Comment #32
catchGoing 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.
Comment #35
anthonyroundtree commentedIs there a plan to address 11.1.x users?
Comment #36
gwanjama commented#9 worked like a charm for me.
Comment #37
catch@anthonyroundtree see #32
Comment #38
sleitner commentedI wonder when
(root)/composer.jsonfor 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.jsonfor drupal/core?Comment #39
catchI think @sleitner is probably right... This is why we shouldn't commit issues from needs review even when they're trivial.
Comment #43
sleitner commentedComment #44
xjmIs there any reason not to declare the conflict in both places, for both tooling and production metapackages?
Comment #45
sleitner commentedI don't think it's necessary because drupal/core is a dependency, but maybe better safe than sorry.
Comment #46
joegl commentedThere's been a release today with a change to resolve the issue: https://github.com/PHPCSStandards/composer-installer/releases/tag/v1.1.1
Comment #47
smustgrave commentedSurprised the bot didn't pick this up but the MR appears to have merge conflicts
Comment #48
sleitner commentedComment #49
vladimirausTested on D 10.5 and D11.2.
Good to go.
Comment #54
alexpottCommitted 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!
Comment #55
xjmThanks for sorting this properly.