magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.55k stars 9.32k forks source link

Failed to set PHP CodeSniffer installed_paths Config (2.4.2, Composer 2) #32609

Closed maciej-orba closed 3 years ago

maciej-orba commented 3 years ago

Summary (*)

Failed to set PHP CodeSniffer installed_paths Config In my opinion its a deployment order: CS, should be configured after Magento deployManager (missing NonComposerComponentRegistration.php deployed via deployManager) Works fine with composer 1

Examples (*)

mkdir ~/cs-test
cd ~/cs-test
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition -vvv
[...]
> post-update-cmd: Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin->onDependenciesChangedEvent
Running PHPCodeSniffer Composer Installer
Executing command (/Users/XXX/project-community-edition/vendor/bin): phpcs --config-show installed_paths
Executing command (/Users/XXX/project-community-edition/vendor/squizlabs/php_codesniffer): '/usr/local/Cellar/php@7.4/7.4.13_1/bin/php' -d allow_url_fopen='1' -d disable_functions='' -d memory_limit='2G' ./bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility
Failed to set PHP CodeSniffer installed_paths Config

Warning: require(/Users/XXX/project-community-edition/vendor/composer/../../app/etc/NonComposerComponentRegistration.php): failed to open stream: No such file or directory in /Users/XXX/project-community-edition/vendor/composer/autoload_real.php on line 75

Fatal error: require(): Failed opening required '/Users/XXX/project-community-edition/vendor/composer/../../app/etc/NonComposerComponentRegistration.php' (include_path='/Users/XXX/project-community-edition/vendor/magento/zendframework1/library:.:/usr/local/Cellar/php@7.4/7.4.13_1/share/php@7.4/pear') in /Users/XXX/project-community-edition/vendor/composer/autoload_real.php on line 75

> post-update-cmd: MagentoHackathon\Composer\Magento\Plugin->onNewCodeEvent
start magento deploy via deployManager
start magento deploy for magento/magento2-base
jump over deployLibraries as no Magento libraryPath is set
[...]
composer -V
Composer version 2.0.11 2021-02-24 14:57:23

Proposed solution

Reorder CS config AFTER magento deployment


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

m2-assistant[bot] commented 3 years ago

Hi @maciej-orba. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 3 years ago

Hi @ihor-sviziev. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

ihor-sviziev commented 3 years ago

Hi @maciej-orba, It looks like the issue was in the Magento composer installer package, and it seems like it already fixed inversion 0.2.1 https://github.com/magento/magento-composer-installer/commit/b9f929f718ef93ed61b6410bad85d40c37fd5ed3.

Could you confirm that now the issue is gone?

ihor-sviziev commented 3 years ago

Hi @maciej-orba, Unfortunately, we didn't get any response from you for a long time, so I'll close this issue as fixed. In case if you still have this issue - please drop a comment here.

maciej-orba commented 3 years ago

yes i can confirm, fixed in installer 0.2.1

maciej-orba commented 3 years ago

PHP CodeSniffer Config installed_paths set to ../../magento/magento-coding-standard,../../phpcompatibility/php-compatibility

PiroozMB commented 2 years ago

Still having this issue when upgrading to magento version 2.4.3 . Any solution to that?

AtifChatdroid commented 2 years ago

Same issue here when upgrading to magento version 2.4.3-p1

crowd42 commented 2 years ago

I'm facing the same issue, does anyone know how to fix it? thanks

hostep commented 2 years ago

According to the comments above, you should first upgrade magento/magento-composer-installer to at least version 0.2.1, before attempting to upgrade Magento itself. @PiroozMB, @AtifChatdroid, @crowd42 has anyone already tried that?

alltomasterpiece commented 2 years ago

I've had the same issue. I was deploying magento 2.4.3 project on Windows. When I'd run composer install, I'd got this error. Failed to set PHP CodeSniffer installed_paths Config I've finally found the solution. The fact is, I hadn't run the xampp.