Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup:di:compile verbosity does nothing #35391

Closed
adamlavery opened this issue Apr 28, 2022 · 8 comments
Closed

Setup:di:compile verbosity does nothing #35391

adamlavery opened this issue Apr 28, 2022 · 8 comments
Labels
Area: Other Developer Tools Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it

Comments

@adamlavery
Copy link

Summary (*)

setup:di:compile produces no useful output when there is a coding error. Using -v, -vv, -vvv or --verbose does nothing to help. The stack trace doesn't identify the file being processed let alone the source line of the error. If we've uploaded multiple files, none of which show any error in the code editor, we have no indicators where to find the code error.

Examples (*)

$ bin/magento set:di:com -vvv
Compilation was started.
Repositories code generation... 1/9 [===>------------------------]  11% < 1 sec 127.0 MiBsyntax error, unexpected '->' (T_OBJECT_OPERATOR)#0 [root]/vendor/composer/ClassLoader.php(428): Composer\Autoload\includeFile()
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#2 [internal function]: spl_autoload_call()
#3 [root]/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists()
#4 [root]/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass()
#5 [root]/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(87): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract()
#6 [root]/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php(61): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList()
#7 [root]/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php(56): Magento\Setup\Module\Di\App\Task\Operation\RepositoryGenerator->doOperation()
#8 [root]/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php(216): Magento\Setup\Module\Di\App\Task\Manager->process()
#9 [root]/vendor/symfony/console/Command/Command.php(255): Magento\Setup\Console\Command\DiCompileCommand->execute()
#10 [root]/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run()
#11 [root]/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#12 [root]/vendor/magento/framework/Console/Cli.php(115): Symfony\Component\Console\Application->doRun()
#13 [root]/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun()
#14 [root]/bin/magento(23): Symfony\Component\Console\Application->run()
#15 {main}

Nothing here indicates where the error is.

Proposed solution

As a minimum, the ClassLoader must identify the class it is trying to load. Preferably it would also include the line that generated the error.

  • [x ] Severity: S0 - Affects critical data or functionality and leaves users with no workaround.
@adamlavery adamlavery added the Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it label Apr 28, 2022
@m2-assistant
Copy link

m2-assistant bot commented Apr 28, 2022

Hi @adamlavery. Thank you for your report.
To speed up processing of this issue, make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

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

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

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

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

@m2-assistant
Copy link

m2-assistant bot commented Jul 19, 2022

Hi @engcom-Charlie. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Charlie
Copy link
Contributor

✔️ Issue Confirmed

Tried to reproduce the issue on magento 2.4-develop and its reproducible.

Manual testing scenario:

  1. Clean Magento setup
  2. Created coding error by adding some extra or wrong operator in controller
  3. Executed bin/magento set:di:com -vvv
  4. Also tried with -v, -vv options
  5. We are getting the error on compile

Expected Result:
We should get the proper indication that where the error is or where to find the error. Verbosity is not working, on error it should tell the file or specifically line that generated the error

Actual Result:
Getting the error without any clear indication of class or file.
image

As per above findings confirming the issue.

@engcom-Charlie engcom-Charlie added Area: Other Developer Tools Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Jul 20, 2022
@m2-community-project m2-community-project bot moved this from Ready for Confirmation to Confirmed in Issue Confirmation and Triage Board Jul 20, 2022
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-5994 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Jul 20, 2022

✅ Confirmed by @engcom-Charlie. Thank you for verifying the issue.
Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@engcom-Charlie engcom-Charlie added the Priority: P3 May be fixed according to the position in the backlog. label Jul 20, 2022
@m2-community-project m2-community-project bot added this to Ready for Development in Low Priority Backlog Jul 20, 2022
@artskirk
Copy link

The issue is not reproduced on 2.4-develop
image
Seems like it already fixed.

@adamlavery
Copy link
Author

That is not testing a code error. The point is when di:com fails it should provide adequate information to identify where the issue is.

@engcom-Hotel
Copy link
Contributor

Hello @,

As I can see this issue got fixed in the scope of the internal Jira ticket AC-5994 by the internal team
Related commits: fd7e45e

Based on the Jira ticket, the target version is 2.4.6.

Thanks

@m2-community-project m2-community-project bot moved this from Dev In Progress to Done in Low Priority Backlog Aug 29, 2022
@m2-community-project m2-community-project bot added Progress: done and removed Progress: PR Created Indicates that Pull Request has been created to fix issue labels Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Other Developer Tools Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Triage: Dev.Experience Issue related to Developer Experience and needs help with Triage to Confirm or Reject it
Projects
Development

No branches or pull requests

5 participants