Page MenuHomePhabricator

composer-package-phpXX-docker jobs run with xdebug enabled
Closed, ResolvedPublic

Event Timeline

(FTR, I'm not sure if this is intentional, but I believe it may slow things down. There are several recent changes in integration/config, so one of those is likely the cause)

Hmm. Yes, that line is new as of 1d98a7264, but that was just duplicating the code in the now-removed composer-package-php70 image - see https://gerrit.wikimedia.org/r/plugins/gitiles/integration/config/+/57368f9cc707629a5ba46be51d1dfec1c9296271/dockerfiles/composer-package-php70/Dockerfile.template That dates from back when the image was just called composer-package, and was originally added in efed77aedccf57b57005502f307aabe252fc034c in 2017.

Perhaps that line didn't have any effect beforehand, but was meant to have?

Perhaps that line didn't have any effect beforehand, but was meant to have?

It almost certainly didn't have any effect, AFAICT. Trying to run phan with xdebug enabled will print a noticeable warning (like it did in the link above), and I've never seen that on a composer-package-* job. Since nobody complained about it in the past 3 years (apparently), I'm wondering whether it could be disabled again.

An interesting side effect of this: phan restarts itself if xdebug is enabled, but in doing so, it seems to pick PHP 7.3 in the php74 image, see https://integration.wikimedia.org/ci/job/composer-package-php74-docker/3856/console:

18:23:26 [debug] Running '/usr/bin/php7.3' '-n' '-c' '/tmp/SJp3ec' './vendor/phan/phan/phan' '--project-root-directory' '.' '--config-file' 'tests/general-phan-config.php' '--output' 'php://stdout' '--long-progress-bar'

Of note, if that change is meant to let composer-package jobs run PHPUnit with support for code coverage, once again I think that should use pcov (T234020) which can be left unconditionally enabled with a very tiny performance overhead (at least based on what I do locally), and that wouldn't cause a restart of phan.

It seems like xdebug was enabled for more jobs. As a case in point, all phan jobs are now running with xdebug enabled, see extension run, core run. Fortunately, it has basically no effect on phan because it restarts itself without xdebug.

Daimona renamed this task from composer-package-php72-docker runs with xdebug enabled to composer-package-phpXX-docker jobs run with xdebug enabled.Jul 15 2022, 12:16 PM

Change 814154 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[integration/config@master] [WIP] Enable pcov instead of xdebug in composer-package-phpXX

https://gerrit.wikimedia.org/r/814154

Update: after talking with @hashar, the new plan is to simply stop enabling xdebug by default, without enabling pcov. The reason is that it's unclear if there's even anything using xdebug for coverage reports that also needs xdebug to be enabled by default: nothing is configuring xdebug (i.e., 'xdebug.mode') in the whole integration/config repo. Instead, we will update the template for phpunit-coverage-{php}-docker-publish to use pcov rather than xdebug.

Change 838860 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[integration/config@master] jjb: Use pcov instead of xdebug in phpunit-coverage-{php}-docker-publish

https://gerrit.wikimedia.org/r/838860

Change 838861 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[integration/config@master] jjb: Use new images without xdebug enabled

https://gerrit.wikimedia.org/r/838861

Change 814154 merged by jenkins-bot:

[integration/config@master] dockerfiles: Stop enabling xdebug by default in composer-package-phpXX

https://gerrit.wikimedia.org/r/814154

Change 838860 merged by jenkins-bot:

[integration/config@master] jjb: Use pcov instead of xdebug in phpunit-coverage-{php}-docker-publish

https://gerrit.wikimedia.org/r/838860

Change 838861 merged by jenkins-bot:

[integration/config@master] jjb: Use new images without xdebug enabled

https://gerrit.wikimedia.org/r/838861

Daimona claimed this task.

This was done as explained in T269489#8287922. Some effects of this change:

  • The MW phan jobs (e.g. mwext-php74-phan-docker) no longer have xdebug enabled, so the output is shorter because phan doesn't need to restart itself
  • The composer-package jobs no longer have xdebug enabled, so they're presumably faster, and phan won't restart if run as part of composer test
  • phpunit-coverage-php74-docker-publish has been broken for a while now, because xdebug was not configured; for instance, from https://integration.wikimedia.org/ci/job/phpunit-coverage-php74-docker-publish/14/console:
+ exec docker run --entrypoint=php --workdir=/src --volume /srv/jenkins/workspace/phpunit-coverage-php74-docker-publish/src:/src --volume /srv/jenkins/workspace/phpunit-coverage-php74-docker-publish/cache:/cache --volume /srv/jenkins/workspace/phpunit-coverage-php74-docker-publish/log:/log --security-opt seccomp=unconfined --init --rm --label jenkins.job=phpunit-coverage-php74-docker-publish --label jenkins.build=14 --env-file /dev/fd/63 docker-registry.wikimedia.org/releng/composer-php74:0.2.0-s9 -d zend_extension=xdebug.so ./vendor/bin/phpunit --coverage-clover /log/coverage/clover.xml --coverage-html /log/coverage
++ /usr/bin/env
++ egrep -v '^(HOME|SHELL|PATH|LOGNAME|MAIL)='
PHPUnit 8.5.30 #StandWithUkraine

Error:         XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set

........................................................          56 / 56 (100%)

Time: 56 ms, Memory: 6.00 MB

Now it uses pcov and it works:

+ exec docker run --entrypoint=php --workdir=/src --volume /srv/jenkins/workspace/phpunit-coverage-php74-docker-publish/src:/src --volume /srv/jenkins/workspace/phpunit-coverage-php74-docker-publish/cache:/cache --volume /srv/jenkins/workspace/phpunit-coverage-php74-docker-publish/log:/log --security-opt seccomp=unconfined --init --rm --label jenkins.job=phpunit-coverage-php74-docker-publish --label jenkins.build=24 --env-file /dev/fd/63 docker-registry.wikimedia.org/releng/composer-php74:0.2.0-s9 -d extension=pcov.so -d pcov.enable=1 ./vendor/bin/phpunit --coverage-clover /log/coverage/clover.xml --coverage-html /log/coverage
++ /usr/bin/env
++ egrep -v '^(HOME|SHELL|PATH|LOGNAME|MAIL)='
PHPUnit 8.5.30 #StandWithUkraine


Error:         Package phpunit/php-invoker is required for enforcing time limits
...............................................................  63 / 106 ( 59%)
...........................................                     106 / 106 (100%)

Time: 4.34 seconds, Memory: 24.00 MB

I'm gonna open another task for some potential issues with pcov.