Skip to content

Multiple test failures when building with --with-expat #13517

Closed

Description

@hannob

Description

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

PHP Version

PHP 8.3.3

Operating System

No response

Activity

  1. ndossche commented on Feb 26, 2024

    @ndossche
    Member

    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)

    Seems harmless, it's configuration related.

  2. added a commit that references this issue on Feb 26, 2024
    a73cc2b
  3. hartwork commented on Feb 26, 2024

    @hartwork

    @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?

  4. ndossche commented on Feb 27, 2024

    @ndossche
    Member

    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?

  5. iluuu1994 commented on Feb 27, 2024

    @iluuu1994
    Member

    @nielsdos That makes sense to me.

  6. added 2 commits that reference this issue on Feb 27, 2024
    552ea62
    8bb2a15
  7. added a commit that references this issue on Feb 27, 2024
    4799321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions