Skip to content

ext/xml: Suppress libxml deprecation for _xmlParserCtxt.inState #19131

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

Merged
merged 1 commit into from
Jul 15, 2025

Conversation

TimWolla
Copy link
Member

The FreeBSD build fails due to the deprecation and -Werror:

2025-07-15T00:37:20.8390774Z /home/runner/work/php-src/php-src/ext/xml/compat.c:358:38: error: 'instate' is deprecated [-Werror,-Wdeprecated-declarations]
2025-07-15T00:37:20.8392577Z   358 |                 if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) {
2025-07-15T00:37:20.8393184Z       |                                                    ^
2025-07-15T00:37:20.8394006Z /usr/local/include/libxml2/libxml/parser.h:309:33: note: 'instate' has been explicitly marked deprecated here
2025-07-15T00:37:20.8394903Z   309 |     xmlParserInputState instate XML_DEPRECATED_MEMBER;
2025-07-15T00:37:20.8395413Z       |                                 ^
2025-07-15T00:37:20.8396166Z /usr/local/include/libxml2/libxml/xmlexports.h:74:50: note: expanded from macro 'XML_DEPRECATED_MEMBER'
2025-07-15T00:37:20.8397058Z    74 |     #define XML_DEPRECATED_MEMBER __attribute__((deprecated))
2025-07-15T00:37:20.8397581Z       |                                                  ^
2025-07-15T00:37:20.8425542Z 1 error generated.

The FreeBSD build fails due to the deprecation and -Werror:

    2025-07-15T00:37:20.8390774Z /home/runner/work/php-src/php-src/ext/xml/compat.c:358:38: error: 'instate' is deprecated [-Werror,-Wdeprecated-declarations]
    2025-07-15T00:37:20.8392577Z   358 |                 if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) {
    2025-07-15T00:37:20.8393184Z       |                                                    ^
    2025-07-15T00:37:20.8394006Z /usr/local/include/libxml2/libxml/parser.h:309:33: note: 'instate' has been explicitly marked deprecated here
    2025-07-15T00:37:20.8394903Z   309 |     xmlParserInputState instate XML_DEPRECATED_MEMBER;
    2025-07-15T00:37:20.8395413Z       |                                 ^
    2025-07-15T00:37:20.8396166Z /usr/local/include/libxml2/libxml/xmlexports.h:74:50: note: expanded from macro 'XML_DEPRECATED_MEMBER'
    2025-07-15T00:37:20.8397058Z    74 |     #define XML_DEPRECATED_MEMBER __attribute__((deprecated))
    2025-07-15T00:37:20.8397581Z       |                                                  ^
    2025-07-15T00:37:20.8425542Z 1 error generated.
@TimWolla TimWolla marked this pull request as ready for review July 15, 2025 11:32
@TimWolla TimWolla requested a review from nielsdos as a code owner July 15, 2025 11:32
@edorian edorian merged commit 2039664 into php:master Jul 15, 2025
9 checks passed
@TimWolla TimWolla deleted the suppress-libxml-deprecation branch July 15, 2025 11:37
@edorian
Copy link
Member

edorian commented Jul 15, 2025

Merging this now for the 8.5.0alpha2 release to be green.
@nielsdos mentioned that they've been looking at a more permanent solution for this, so pinging them just in case.

@iluuu1994
Copy link
Member

Can we backport this? Nightly for 8.4 also fails. https://github.com/php/php-src/actions/runs/16308227434/job/46058664411

@TimWolla
Copy link
Member Author

TimWolla commented Jul 16, 2025

I'll leave backporting / further handling up to Niels. The main goal was unblocking the CI for the Alpha 2 tag in the simplest possible way.

@nielsdos
Copy link
Member

I'll backport it to 8.1+ for the time being

nielsdos pushed a commit that referenced this pull request Jul 16, 2025
…9131)

The FreeBSD build fails due to the deprecation and -Werror:

    2025-07-15T00:37:20.8390774Z /home/runner/work/php-src/php-src/ext/xml/compat.c:358:38: error: 'instate' is deprecated [-Werror,-Wdeprecated-declarations]
    2025-07-15T00:37:20.8392577Z   358 |                 if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) {
    2025-07-15T00:37:20.8393184Z       |                                                    ^
    2025-07-15T00:37:20.8394006Z /usr/local/include/libxml2/libxml/parser.h:309:33: note: 'instate' has been explicitly marked deprecated here
    2025-07-15T00:37:20.8394903Z   309 |     xmlParserInputState instate XML_DEPRECATED_MEMBER;
    2025-07-15T00:37:20.8395413Z       |                                 ^
    2025-07-15T00:37:20.8396166Z /usr/local/include/libxml2/libxml/xmlexports.h:74:50: note: expanded from macro 'XML_DEPRECATED_MEMBER'
    2025-07-15T00:37:20.8397058Z    74 |     #define XML_DEPRECATED_MEMBER __attribute__((deprecated))
    2025-07-15T00:37:20.8397581Z       |                                                  ^
    2025-07-15T00:37:20.8425542Z 1 error generated.
nielsdos added a commit that referenced this pull request Jul 16, 2025
* PHP-8.1:
  ext/xml: Suppress libxml deprecation for `_xmlParserCtxt.inState` (#19131)
nielsdos added a commit that referenced this pull request Jul 16, 2025
* PHP-8.2:
  ext/xml: Suppress libxml deprecation for `_xmlParserCtxt.inState` (#19131)
nielsdos added a commit that referenced this pull request Jul 16, 2025
* PHP-8.3:
  ext/xml: Suppress libxml deprecation for `_xmlParserCtxt.inState` (#19131)
nielsdos added a commit that referenced this pull request Jul 16, 2025
* PHP-8.4:
  ext/xml: Suppress libxml deprecation for `_xmlParserCtxt.inState` (#19131)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants