-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
ext/gd/tests: external gd-2.3.3 compatibility. #11262
Conversation
Support for the legacy "gd" image format was removed from gd-2.3.3 upstream: https://github.com/libgd/libgd/blob/master/CHANGELOG.md#233---2021-09-12 Several tests for the gd extension utilize that format, and naturally fail when gd-2.3.3 from the system is used. This commit skips those tests when the version of gd is at least 2.3.3.
--SKIPIF-- | ||
<?php | ||
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.3.3', '>=')) { | ||
die("skip test requires GD 2.3.2 or older"); |
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.
die("skip test requires GD 2.3.2 or older"); | |
die("skip test requires a version of GD older than 2.3.3"); |
As the current wording is kinda weird IMHO
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 have a few pull requests open with this wording and the underlying issue (#11252) isn't quite done yet. Should I change them all now, or would it be easier to sed them afterwards?
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.
If it's easy for you to do now, that would be convenient.
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.
On second thought, it looks like I chose this wording to match the existing version-based "skip" messages. For example, https://github.com/php/php-src/blob/master/ext/gd/tests/bug43121.phpt#L8
That same phrase (with various version triplets) already appears 25 times in ext/gd/tests
. I'm still happy to change it though if this doesn't change anyone's mind.
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 see. IMO if it's already this way anyway, it can be kept. It's not that important after all.
If we end up disliking the wording I can simply amend it later.
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.
Right, if it's already liek this leave it then
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.
Not sure if we should backport the changes or not
The changelog says: "support for the legacy/testing gd image formats is disabled by default". It is perfectly possible to still build libgd 2.3.3 with support for these formats (otherwise that would have been a serious BC break). ext/gd/tests/bug41442.phpt, for instance, wouldn't even need to have been touched, since the test has already been skipped, if |
@cmb69 Okay, I can open a PR to change the check to check if imagegd2 is defined instead, sounds good? |
@nielsdos, I think checking for |
@cmb69 gd_info does not report gd2 file format support ( Lines 472 to 521 in 1b07772
|
Ah and checking for imagegd2 (or similar) won't suffice because it seems they are not surrounded by ifdefs... |
See #12019. I think we need to do that for gd/gd2, too. |
Sorry! I did this before #12019 and I didn't know of a better way to detect the supported formats at the time. It looks like now we just have to add them to the list of |
I've started PR #15006. |
Support for the legacy "gd" image format was removed from gd-2.3.3 upstream:
https://github.com/libgd/libgd/blob/master/CHANGELOG.md#233---2021-09-12
Several tests for the gd extension utilize that format, and naturally fail when gd-2.3.3 from the system is used. This commit skips those tests when the version of gd is at least 2.3.3.