You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multiple test failures when building with --with-expat #13517
Compiling latest php with expat support (./configure --with-expat; make; make test) leads to multiple test failures in xml-related tests.
I'll attach the test output.
I'm unsure about the support status of expat in php. This doc https://www.php.net/manual/en/xml.requirements.php implies that with that option, it would use expat as its xml backend. But when building, it links against both libxml2 and expat, and I'm unsure what the implications are. Those docs also link to a very old expat webpage, and the notes about building expat are probably obsolete. I think it would be good to update and clarify those docs.
This is I believe the relevant part from the test log:
FAILED TEST SUMMARY
---------------------------------------------------------------------
ReflectionExtension::getDependencies() [ext/reflection/tests/016.phpt]
Test setlocale() function : usage variations - setting system locale = 0 [ext/standard/tests/strings/setlocale_variation3.phpt]
Test setlocale() function : usage variations - setting system locale as null [ext/standard/tests/strings/setlocale_variation4.phpt]
Test setlocale() function : usage variations - Setting system locale as empty string [ext/standard/tests/strings/setlocale_variation5.phpt]
Bug #26614 (CDATA sections skipped on line count) [ext/xml/tests/bug26614_libxml_gte2_11.phpt]
Bug #46699: (xml_parse crash when parser is namespace aware) [ext/xml/tests/bug46699.phpt]
Bug #81351 (xml_parse may fail, but has no error code) [ext/xml/tests/bug81351.phpt]
xml_error_string() - Basic test on 5 error codes [ext/xml/tests/xml_error_string_basic.phpt]
Test xml_set_start_namespace_decl_handler function: basic [ext/xml/tests/xml_set_start_namespace_decl_handler_basic.phpt]
(The setlocale failures seem unrelated to expat/xml, they also appear when building with default options) php_test_results_20240226_1616.txt
Thanks for the report. The failures come from both the evolution of the expat library, and because some tests assume libxml2 behaviour with respect to error handling. There are small differences in how errors are handled and reported which cause visible differences in the tests. The differences are not bugs. The solution I went with was to split the tests.
I'm unsure about the support status of expat in php.
Still works, just not tested on a regular basis.
But when building, it links against both libxml2 and expat, and I'm unsure what the implications are.
The XML extension links against expat, but since you still have other XML extension enabled (e.g. the DOM extension), they link against libxml2. This has no negative impact.
Those docs also link to a very old expat webpage, and the notes about building expat are probably obsolete. I think it would be good to update and clarify those docs.
I've made a PR to update the expat library URLs too: php/doc-base#117
(The setlocale failures seem unrelated to expat/xml, they also appear when building with default options)
@nielsdos is there a chance that the CI could be made to also cover compilation and test execution with --with-expat so that it's impossible to break without noticing in the future?
We could add it to the nightly workflow.
Either as a small seperate task or by compiling the xml extension shared twice and loading each of them once to test. Probably the first option is the most easy one. Cc @iluuu1994 what do you think?
Activity
ndossche commentedon Feb 26, 2024
Thanks for the report. The failures come from both the evolution of the expat library, and because some tests assume libxml2 behaviour with respect to error handling. There are small differences in how errors are handled and reported which cause visible differences in the tests. The differences are not bugs. The solution I went with was to split the tests.
Still works, just not tested on a regular basis.
The XML extension links against expat, but since you still have other XML extension enabled (e.g. the DOM extension), they link against libxml2. This has no negative impact.
I've made a PR to update the expat library URLs too: php/doc-base#117
Seems harmless, it's configuration related.
Fix phpGH-13517: Multiple test failures when building with --with-expat
hartwork commentedon Feb 26, 2024
@nielsdos is there a chance that the CI could be made to also cover compilation and test execution with
--with-expatso that it's impossible to break without noticing in the future?ndossche commentedon Feb 27, 2024
We could add it to the nightly workflow.
Either as a small seperate task or by compiling the xml extension shared twice and loading each of them once to test. Probably the first option is the most easy one. Cc @iluuu1994 what do you think?
iluuu1994 commentedon Feb 27, 2024
@nielsdos That makes sense to me.
Fix GH-13517: Multiple test failures when building with --with-expat
Merge branch 'PHP-8.2' into PHP-8.3
Merge branch 'PHP-8.3'