michaelmcandrew / civicrm-buildkit-docker

This is a read only copy. Please make PRs here: https://lab.civicrm.org/michaelmcandrew/civicrm-buildkit-docker
https://lab.civicrm.org/michaelmcandrew/civicrm-buildkit-docker
GNU Affero General Public License v3.0
40 stars 31 forks source link

Updates for XDebug 3 #61

Open valenvb opened 3 years ago

valenvb commented 3 years ago

It seems the images (from master) now contain XDebug 3, which has a few significant breaking configuration changes from version 2: https://xdebug.org/docs/upgrade_guide

At first glance it seems changes are only needed in the entrypoint where it writes the XDebug config (and the VSCode launch.json for the new client port).

I'm currently updating my own copy of this to support it. I'll see if I can do up a pull request with the changes sometime this week.

michaelmcandrew commented 3 years ago

thanks for the report @valenvb - would be great to hear how you get on.

valenvb commented 3 years ago

I've gotten it rudimentarily working on a branch in my fork: https://github.com/valenvb/civicrm-buildkit-docker/tree/xdebug-3

A couple of snags I want to address before opening a PR; Not sure if this is a XDebug 3 change, or something I missed in my configurations, but with v2 XDebug was inactive on the CLI php invocations. With the defaults config for v3 civibuild et al are full of XDebug logs (since I'm typically not running the debugger at this stage).. not ideal when trying to use those tools. I have a workaround of setting an alternate PHP_INI_SCAN_DIR before I run the tools, but it feels like there should be a cleaner solution. On this front, @michaelmcandrew what is the distinction between buildkit.ini and the debug.ini written by the entrypoint? I'm not too familiar with the internals of Buildkit, if those are settings only required for the CLI tools or something else - might be able to condense all this into a single php-cli.ini

I've also had an issue with docker on macOS - the current method of using the gateway host as the XDebug client no longer seems to work, I was able to get it to work using host.docker.internal... however this address isn't (yet?) available on all Linux versions of docker...

valenvb commented 3 years ago

I've worked some solutions to the above, splitting the Xdebug config between buildkit.ini (global), php.ini (web only), and php-cli.ini (cli only) makes it easy to the cli and web settings to avoid unnecessary logs from Xdebug. It could still be turned on via env vars if you need to debug something on the cli.

I've opened #62 with my changes.

wmortada commented 2 years ago

I can confirm that this PR fixes the issue for me. Thanks @valenvb!