-
-
Notifications
You must be signed in to change notification settings - Fork 579
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
build: compile Xdebug 3.2.2 for PHP 8.0, 8.1, 8.2, fixes #6159 #6181
build: compile Xdebug 3.2.2 for PHP 8.0, 8.1, 8.2, fixes #6159 #6181
Conversation
I will make a new build of the Docker image only after the next PR goes in: |
And it can be tested manually using |
Please open an issue with https://bugs.xdebug.org/my_view_page.php explaining your results with php 8.3, thanks! |
It's not compatible (see https://xdebug.org/docs/compat) so they won't fix it. |
Oh, I understand now, thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like the right strategy to me. We just have to do some good solid testing on multiple PHP versions with and without xdebug.
41bff40
to
3b472ea
Compare
3b472ea
to
df5a372
Compare
I added a new stage for Xdebug, because the size of the Docker image linux/amd64 333.86 MB => 426.51 MB Also I added cleanup for
Building a new image. |
I was thinking about that last night, about build-essential getting into the final image. Thanks for catching that! |
This comment was marked as outdated.
This comment was marked as outdated.
There is a question remaining: If we can't downgrade for PHP8.3... should we still be downgrading for PHP8.1/2? |
It is still supported https://www.php.net/supported-versions.php |
Oh, I see you were already building as we spoke. |
Yes, but it failed after 30 minutes (connection timeout to php repo), I just restarted it again. |
0c993c6
to
779ab2e
Compare
Download the artifacts for this pull request:
See Testing a PR. |
I ran a basic debugging session with a single breakpoint and step over, using PHP 8.0, 8.1, 8.2. Used Linux amd64 with PhpStorm 2023.3.6. And tested Xdebug 3.3.2 with PHP 8.3 to make sure it works the same for me. |
And this works too, so we don't limit everyone to 3.2.2: webimage_extra_packages: ['php${DDEV_PHP_VERSION}-xdebug'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're good to go on this. You've tested carefully manually, I tested a couple of ways, code looks good. It's more complicated than I hoped, and I hope we can remove it at some point. I love the commenting, which reduces the fear factor of introducing this.
ARG XDEBUG_VERSION="3.2.2" | ||
ARG XDEBUG_BUILD_PACKAGES="build-essential php-pear php8.0-dev php8.1-dev php8.2-dev" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should both be ENV shouldn't they? Don't bother changing it, but they're not ARGS into the build are they? They way you have it they're just taking the assigned value because there is no ARG of this name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I used ARG
because we don't want these variables to be inside the container:
$ docker run --rm -it ddev/ddev-php-base:v1.23.1 bash -c 'echo $XDEBUG_VERSION'
(nothing here)
See Docker ARG vs ENV.
But when you declare it with ENV
, it will be available inside, e.g.:
$ docker run --rm -it ddev/ddev-php-base:v1.23.1 bash -c 'echo $php83_arm64'
apcu bcmath bz2 curl cli common fpm gd imagick intl ldap mbstring memcached mysql opcache pgsql readline redis soap sqlite3 uploadprogress xdebug xhprof xml xmlrpc zip
I think it doesn't really matter here, since ddev/ddev-php-base
isn't what users end up with, it's empty anyway:
$ docker run --rm -it ddev/ddev-webserver:v1.23.1 bash -c 'echo $php83_arm64'
(nothing here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is awesome, thanks, always great to learn from you! I always use them only for when there's a --build-arg one way or another, but this is a great differentiator.
RUN apt-get -qq remove -y php8.0-xdebug php8.1-xdebug php8.2-xdebug | ||
COPY --from=ddev-xdebug-build /usr/lib/php/20200930/xdebug.so /usr/lib/php/20200930/xdebug.so | ||
COPY --from=ddev-xdebug-build /usr/lib/php/20210902/xdebug.so /usr/lib/php/20210902/xdebug.so | ||
COPY --from=ddev-xdebug-build /usr/lib/php/20220829/xdebug.so /usr/lib/php/20220829/xdebug.so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is scary wild stuff!
@@ -117,14 +140,21 @@ RUN for v in $PHP_VERSIONS; do \ | |||
pkgs=$(echo ${!pkgvar} | awk -v v="$v" ' BEGIN {RS=" "; } { printf "%s-%s ",v,$0 ; }' ); \ | |||
[[ ${pkgs// } != "" ]] && (apt-get -qq install --no-install-recommends --no-install-suggests -y $pkgs || exit $?) \ | |||
done | |||
### ---------------------------ddev-xdebug-build-------------------------------------- | |||
### The dates from /usr/lib/php/YYYYMMDD/ represent PHP API versions https://unix.stackexchange.com/a/591771 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the excellent commenting.
The Issue
How This PR Solves The Issue
Compiles Xdebug 3.2.2 library for PHP 8.0, 8.1, 8.2.
Unfortunately we can't build Xdebug 3.2.2 for PHP 8.3:
Xdebug Compatibility https://xdebug.org/docs/compat
Manual Testing Instructions
Automated Testing Overview
Related Issue Link(s)
Release/Deployment Notes