Skip to content

[RFC] Add a way to opt-in ext/dom spec compliance #13031

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 218 commits into from
Mar 9, 2024

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Dec 26, 2023

RFC: https://wiki.php.net/rfc/opt_in_dom_spec_compliance

In short: this PR aims to fix all the spec bugs in ext/dom. It does so in a backwards compatible way. This means that existing PHP code will keep working and not notice any changes. When the developer uses the new DOM\XMLDocument and DOM\HTMLDocument classes that I introduced in https://wiki.php.net/rfc/domdocument_html5_parser then the DOM extension switches to a "spec compliant" mode.

This gets rid of many issues that have been plaguing the DOM extension since forever and fixes many bugs that are otherwise unfixable.

What's missing in the current implementation is fixes to the property/method types. For example, the fact that DOM\Node::$prefix returns the empty string instead of NULL when no prefix is set (and more of course, this is just an example).

@medabkari

This comment was marked as resolved.

@nielsdos

This comment was marked as resolved.

@medabkari

This comment was marked as resolved.

@nielsdos nielsdos force-pushed the dom-spec-compliance-pub branch 2 times, most recently from ad5cb06 to 495c80b Compare February 10, 2024 16:28
@nielsdos nielsdos force-pushed the dom-spec-compliance-pub branch 6 times, most recently from 1e0de69 to 371a6c7 Compare February 17, 2024 15:56
@nielsdos nielsdos force-pushed the dom-spec-compliance-pub branch from 371a6c7 to 2bab732 Compare February 19, 2024 18:56
@nielsdos nielsdos force-pushed the dom-spec-compliance-pub branch from 2bab732 to 6dd522a Compare February 23, 2024 21:02
if (mode == DOM_LOAD_FILE) {
zend_throw_exception_ex(NULL, 0, "Cannot open file '%s'", source);
if (lxml_doc == DOM_DOCUMENT_MALFORMED) {
zend_throw_exception_ex(NULL, 0, "XML document is malformed");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this throw a DOM/XML specific Exception?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will already have been warnings from libxml; and I don't think any of the DOMException types fit here (see domexception.h/c).

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are nearly there

Comment on lines 853 to 854
bool should_free_result;
const xmlChar *result = dom_get_attribute_ns(intern, elemp, uri, uri_len, name, &should_free_result);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah seems this hasn't been done yet

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I think this as good as a review that I'll be able to do.

Thanks for the work!

@nielsdos nielsdos merged commit 14b6c98 into php:master Mar 9, 2024
@drupol
Copy link
Contributor

drupol commented Mar 14, 2024

Hey hi !

I think this PR breaks master branch, here's the compilation log:

error: builder for '/nix/store/8igfr14c7bcbypdsr0pfp4hh3d84gp1c-php-xsl-8.4.999-c2d20f4.drv' failed with exit code 2;
       last 25 log lines:
       >    26 | #include "ext/dom/php_dom.h"
       >       |          ^~~~~~~~~~~~~~~~~~~
       > compilation terminated.
       > make: *** [Makefile:212: xsltprocessor.lo] Error 1
       > make: *** Waiting for unfinished jobs....
       > In file included from /build/source/ext/xsl/php_xsl.c:24:
       > /build/source/ext/xsl/php_xsl.h:61:9: error: unknown type name 'php_dom_xpath_callbacks'
       >    61 |         php_dom_xpath_callbacks xpath_callbacks;
       >       |         ^~~~~~~~~~~~~~~~~~~~~~~
       > /build/source/ext/xsl/php_xsl.c: In function 'xsl_objects_get_gc':
       > /build/source/ext/xsl/php_xsl.c:59:16: warning: implicit declaration of function 'php_dom_xpath_callbacks_get_gc_for_whole_object' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
       >    59 |         return php_dom_xpath_callbacks_get_gc_for_whole_object(&intern->xpath_callbacks, object, table, n);
       >       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > /build/source/ext/xsl/php_xsl.c:59:16: warning: returning 'int' from a function with return type 'HashTable *' {aka 'struct _zend_array *'} makes pointer from integer without a cast [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wint-conversion-Wint-conversion8;;]
       >    59 |         return php_dom_xpath_callbacks_get_gc_for_whole_object(&intern->xpath_callbacks, object, table, n);
       >       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > /build/source/ext/xsl/php_xsl.c: In function 'xsl_objects_free_storage':
       > /build/source/ext/xsl/php_xsl.c:89:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_dtor' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
       >    89 |         php_dom_xpath_callbacks_dtor(&intern->xpath_callbacks);
       >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > /build/source/ext/xsl/php_xsl.c: In function 'xsl_objects_new':
       > /build/source/ext/xsl/php_xsl.c:119:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_ctor' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
       >   119 |         php_dom_xpath_callbacks_ctor(&intern->xpath_callbacks);
       >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > make: *** [Makefile:209: php_xsl.lo] Error 1
       For full logs, run 'nix log /nix/store/8igfr14c7bcbypdsr0pfp4hh3d84gp1c-php-xsl-8.4.999-c2d20f4.drv'.

@nielsdos
Copy link
Member Author

@drupol ext/xsl has a dependency on DOM, for some reason it can't find the ext/dom/php_dom.h file. I don't know how the Nix build system works, but here it works fine.

The only thing I spot, but this is also true for older branches, is that I don't see an explicit dependency added in the config.m4, which the following patch should resolve:

diff --git a/ext/xsl/config.m4 b/ext/xsl/config.m4
index 14af536fa7..8d45e8eacb 100644
--- a/ext/xsl/config.m4
+++ b/ext/xsl/config.m4
@@ -29,4 +29,5 @@ if test "$PHP_XSL" != "no"; then
   PHP_NEW_EXTENSION(xsl, php_xsl.c xsltprocessor.c, $ext_shared)
   PHP_SUBST(XSL_SHARED_LIBADD)
   PHP_ADD_EXTENSION_DEP(xsl, libxml)
+  PHP_ADD_EXTENSION_DEP(xsl, dom)
 fi

but given that this has been wrong for years, it probably does not explain your build problem.

@drupol
Copy link
Contributor

drupol commented Mar 14, 2024

Thanks Niels,

I applied your patch and rebuild, with the very last commit:

php-xsl>  gcc -I. -I/build/source/ext/xsl -I/build/source/ext/xsl/main -I/build/source/ext/xsl -I/nix/store/rjpf1ac2sph9pifgk94bsdz8h9bgigx4-php-8.4.999-586153b-dev/include/php -I/nix/store/rjpf1ac2sph9pifgk94bsdz8h9bgigx4-php-8.4.999-586153b-dev/include/php/main -I/nix/store/rjpf1ac2sph9pifgk94bsdz8h9bgigx4-php-8.4.999-586153b-dev/include/php/TSRM -I/nix/store/rjpf1ac2sph9pifgk94bsdz8h9bgigx4-php-8.4.999-586153b-dev/include/php/Zend -I/nix/store/rjpf1ac2sph9pifgk94bsdz8h9bgigx4-php-8.4.999-586153b-dev/include/php/ext -I/nix/store/rjpf1ac2sph9pifgk94bsdz8h9bgigx4-php-8.4.999-586153b-dev/include/php/ext/date/lib -I/nix/store/b84k136qa0q00r0wipazh99v4j4nhr27-libxslt-1.1.39-dev/include -I/nix/store/pn27sbss40whpcvkzcb36g5nzj71d64s-libxml2-2.12.5-dev/include/libxml2 -DHAVE_CONFIG_H -g -O2 -D_GNU_SOURCE -DZEND_COMPILE_DL_EXT=1 -c /build/source/ext/xsl/php_xsl.c -MMD -MF php_xsl.dep -MT php_xsl.lo  -fPIC -DPIC -o .libs/php_xsl.o
php-xsl> In file included from /build/source/ext/xsl/xsltprocessor.c:23:
php-xsl> /build/source/ext/xsl/php_xsl.h:61:9: error: unknown type name 'php_dom_xpath_callbacks'
php-xsl>    61 |         php_dom_xpath_callbacks xpath_callbacks;
php-xsl>       |         ^~~~~~~~~~~~~~~~~~~~~~~
php-xsl> In file included from /build/source/ext/xsl/php_xsl.c:24:
php-xsl> /build/source/ext/xsl/php_xsl.h:61:9: error: unknown type name 'php_dom_xpath_callbacks'
php-xsl>    61 |         php_dom_xpath_callbacks xpath_callbacks;
php-xsl>       |         ^~~~~~~~~~~~~~~~~~~~~~~
php-xsl> In file included from /build/source/ext/xsl/xsltprocessor.c:26:
php-xsl> /build/source/ext/xsl/ext/dom/php_dom.h:68:9: error: unknown type name 'php_dom_xpath_callbacks'
php-xsl>    68 |         php_dom_xpath_callbacks xpath_callbacks;
php-xsl>       |         ^~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c:94:76: error: unknown type name 'php_dom_xpath_nodeset_evaluation_mode'
php-xsl>    94 | static void xsl_ext_function_php(xmlXPathParserContextPtr ctxt, int nargs, php_dom_xpath_nodeset_evaluation_mode evaluation_mode) /* {{{ */
php-xsl>       |                                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/php_xsl.c: In function 'xsl_objects_get_gc':
php-xsl> /build/source/ext/xsl/php_xsl.c:59:16: warning: implicit declaration of function 'php_dom_xpath_callbacks_get_gc_for_whole_object' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
php-xsl>    59 |         return php_dom_xpath_callbacks_get_gc_for_whole_object(&intern->xpath_callbacks, object, table, n);
php-xsl>       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/php_xsl.c:59:16: warning: returning 'int' from a function with return type 'HashTable *' {aka 'struct _zend_array *'} makes pointer from integer without a cast [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wint-conversion-Wint-conversion8;;]
php-xsl>    59 |         return php_dom_xpath_callbacks_get_gc_for_whole_object(&intern->xpath_callbacks, object, table, n);
php-xsl>       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c: In function 'xsl_ext_function_string_php':
php-xsl> /build/source/ext/xsl/xsltprocessor.c:107:9: warning: implicit declaration of function 'xsl_ext_function_php'; did you mean 'xsl_ext_function_object_php'? [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
php-xsl>   107 |         xsl_ext_function_php(ctxt, nargs, PHP_DOM_XPATH_EVALUATE_NODESET_TO_STRING);
php-xsl>       |         ^~~~~~~~~~~~~~~~~~~~
php-xsl>       |         xsl_ext_function_object_php
php-xsl> /build/source/ext/xsl/php_xsl.c: In function 'xsl_objects_free_storage':
php-xsl> /build/source/ext/xsl/php_xsl.c:89:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_dtor' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
php-xsl>    89 |         php_dom_xpath_callbacks_dtor(&intern->xpath_callbacks);
php-xsl>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/php_xsl.c: In function 'xsl_objects_new':
php-xsl> /build/source/ext/xsl/php_xsl.c:119:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_ctor' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
php-xsl>   119 |         php_dom_xpath_callbacks_ctor(&intern->xpath_callbacks);
php-xsl>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c:107:43: error: 'PHP_DOM_XPATH_EVALUATE_NODESET_TO_STRING' undeclared (first use in this function)
php-xsl>   107 |         xsl_ext_function_php(ctxt, nargs, PHP_DOM_XPATH_EVALUATE_NODESET_TO_STRING);
php-xsl>       |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c:107:43: note: each undeclared identifier is reported only once for each function it appears in
php-xsl> make: *** [Makefile:209: php_xsl.lo] Error 1
php-xsl> make: *** Waiting for unfinished jobs....
php-xsl> /build/source/ext/xsl/xsltprocessor.c: In function 'xsl_ext_function_object_php':
php-xsl> /build/source/ext/xsl/xsltprocessor.c:113:43: error: 'PHP_DOM_XPATH_EVALUATE_NODESET_TO_NODESET' undeclared (first use in this function)
php-xsl>   113 |         xsl_ext_function_php(ctxt, nargs, PHP_DOM_XPATH_EVALUATE_NODESET_TO_NODESET);
php-xsl>       |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c: In function 'xsl_ext_function_trampoline':
php-xsl> /build/source/ext/xsl/xsltprocessor.c:121:17: warning: implicit declaration of function 'php_dom_xpath_callbacks_clean_argument_stack' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
php-xsl>   121 |                 php_dom_xpath_callbacks_clean_argument_stack(ctxt, nargs);
php-xsl>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c:123:17: warning: implicit declaration of function 'php_dom_xpath_callbacks_call_custom_ns' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
php-xsl>   123 |                 php_dom_xpath_callbacks_call_custom_ns(&intern->xpath_callbacks, ctxt, nargs, PHP_DOM_XPATH_EVALUATE_NODESET_TO_NODESET, (dom_object *) intern->doc, xsl_proxy_factory);
php-xsl>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c:123:95: error: 'PHP_DOM_XPATH_EVALUATE_NODESET_TO_NODESET' undeclared (first use in this function)
php-xsl>   123 |                 php_dom_xpath_callbacks_call_custom_ns(&intern->xpath_callbacks, ctxt, nargs, PHP_DOM_XPATH_EVALUATE_NODESET_TO_NODESET, (dom_object *) intern->doc, xsl_proxy_factory);
php-xsl>       |                                                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c: In function 'php_xsl_apply_stylesheet':
php-xsl> /build/source/ext/xsl/xsltprocessor.c:399:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_delayed_lib_registration' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
php-xsl>   399 |         php_dom_xpath_callbacks_delayed_lib_registration(&intern->xpath_callbacks, ctxt, php_xsl_delayed_lib_registration);
php-xsl>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c:417:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_clean_node_list' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
php-xsl>   417 |         php_dom_xpath_callbacks_clean_node_list(&intern->xpath_callbacks);
php-xsl>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c: In function 'zim_XSLTProcessor_registerPHPFunctions':
php-xsl> /build/source/ext/xsl/xsltprocessor.c:682:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_update_method_handler' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
php-xsl>   682 |         php_dom_xpath_callbacks_update_method_handler(
php-xsl>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c:688:17: error: 'PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NULLS' undeclared (first use in this function)
php-xsl>   688 |                 PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NULLS,
php-xsl>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c: In function 'zim_XSLTProcessor_registerPHPFunctionNS':
php-xsl> /build/source/ext/xsl/xsltprocessor.c:713:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_update_single_method_handler' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wimplicit-function-declaration-Wimplicit-function-declaration8;;]
php-xsl>   713 |         php_dom_xpath_callbacks_update_single_method_handler(
php-xsl>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> /build/source/ext/xsl/xsltprocessor.c:719:17: error: 'PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NCNAME' undeclared (first use in this function)
php-xsl>   719 |                 PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NCNAME,
php-xsl>       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
php-xsl> make: *** [Makefile:212: xsltprocessor.lo] Error 1
error: builder for '/nix/store/g159zzyjy5naw6k2n1376k7spk5r2cng-php-xsl-8.4.999-586153b.drv' failed with exit code 2;
       last 25 log lines:
       > /build/source/ext/xsl/xsltprocessor.c:123:95: error: 'PHP_DOM_XPATH_EVALUATE_NODESET_TO_NODESET' undeclared (first use in this function)
       >   123 |                 php_dom_xpath_callbacks_call_custom_ns(&intern->xpath_callbacks, ctxt, nargs, PHP_DOM_XPATH_EVALUATE_NODESET_TO_NODESET, (dom_object *) intern->doc, xsl_proxy_factory);
       >       |                                                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > /build/source/ext/xsl/xsltprocessor.c: In function 'php_xsl_apply_stylesheet':
       > /build/source/ext/xsl/xsltprocessor.c:399:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_delayed_lib_registration' [-Wimplicit-function-declaration]
       >   399 |         php_dom_xpath_callbacks_delayed_lib_registration(&intern->xpath_callbacks, ctxt, php_xsl_delayed_lib_registration);
       >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > /build/source/ext/xsl/xsltprocessor.c:417:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_clean_node_list' [-Wimplicit-function-declaration]
       >   417 |         php_dom_xpath_callbacks_clean_node_list(&intern->xpath_callbacks);
       >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > /build/source/ext/xsl/xsltprocessor.c: In function 'zim_XSLTProcessor_registerPHPFunctions':
       > /build/source/ext/xsl/xsltprocessor.c:682:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_update_method_handler' [-Wimplicit-function-declaration]
       >   682 |         php_dom_xpath_callbacks_update_method_handler(
       >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > /build/source/ext/xsl/xsltprocessor.c:688:17: error: 'PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NULLS' undeclared (first use in this function)
       >   688 |                 PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NULLS,
       >       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > /build/source/ext/xsl/xsltprocessor.c: In function 'zim_XSLTProcessor_registerPHPFunctionNS':
       > /build/source/ext/xsl/xsltprocessor.c:713:9: warning: implicit declaration of function 'php_dom_xpath_callbacks_update_single_method_handler' [-Wimplicit-function-declaration]
       >   713 |         php_dom_xpath_callbacks_update_single_method_handler(
       >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > /build/source/ext/xsl/xsltprocessor.c:719:17: error: 'PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NCNAME' undeclared (first use in this function)
       >   719 |                 PHP_DOM_XPATH_CALLBACK_NAME_VALIDATE_NCNAME,
       >       |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > make: *** [Makefile:212: xsltprocessor.lo] Error 1
       For full logs, run 'nix log /nix/store/g159zzyjy5naw6k2n1376k7spk5r2cng-php-xsl-8.4.999-586153b.drv'.

@nielsdos
Copy link
Member Author

@drupol I don't understand the Nix build system, but I think that for some reason HAVE_DOM is not defined.

@drupol
Copy link
Contributor

drupol commented Mar 14, 2024

Indeed, setting the var HAVE_DOM fixes it! Submitting a PR for the upcoming PHP version.

@drupol
Copy link
Contributor

drupol commented Mar 14, 2024

@drupol I don't understand the Nix build system, but I think that for some reason HAVE_DOM is not defined.

I'll be glad to tell you more in a visio at your best convenience!

@mvorisek
Copy link
Contributor

I think this PR breaks master branch, here's the compilation log:

I have the same issue, reported as #13764.

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.

5 participants