Create separate lexbor extension#18538
Conversation
c2b1e8d to
6a309fe
Compare
c228b4a to
accf126
Compare
|
@cmb69 for Windows maybe? |
|
I haven't actually checked that (can do later if necessary), but I think we need to install the actual lexbor headers; cf. Line 12 in 4122daa I think that also needs to be done for POSIX systems, so phpize builds can work. |
|
Definitely. Also, you need to keep the selectors-adapted directory in ext/dom. Due to technical reasons this is a port of the upstream sources adapted to libxml2, so it has a dependency on libxml. |
I tried to follow what ext/dom did when it used to have the lexbor sources: https://github.com/php/php-src/blob/master/ext/dom/config.w32#L19 it didn't install the lexbor headers, other than putting them on the include path. Nevertheless, I'm trying out the suggestion.
Did I move it accidentally? 🤔 I tried to keep it in place, because I noticed that it was a PHP specific adaptation :) |
1f92120 to
054161b
Compare
ext/lexbor/config.w32
Outdated
| AC_DEFINE("HAVE_LEXBOR", 1, "Define to 1 if the PHP extension 'lexbor' is available."); | ||
|
|
||
| PHP_INSTALL_HEADERS("ext/lexbor", "php_lexbor.h"); | ||
| PHP_INSTALL_HEADERS("ext/lexbor", "php_lexbor.h /"); |
There was a problem hiding this comment.
Windows is still broken, based on the pcre one that cmb linked, perhaps it must be this?
PHP_INSTALL_HEADERS("ext/lexbor", "php_lexbor.h lexbor/");
There was a problem hiding this comment.
First, I tried to use exactly lexbor/, and then I force pushed the current attempt, but they both had the same failures.
Ah sorry I saw it was moved but didn't properly check it is indeed still in dom, thanks! |
c938572 to
78d185b
Compare
6d631e1 to
a5072e2
Compare
|
| static PHP_MINFO_FUNCTION(lexbor) | ||
| { | ||
| php_info_print_table_start(); | ||
| php_info_print_table_row(2, "Lexbor support", "active"); |
There was a problem hiding this comment.
Would it make sense / would it be possible to print the Lexbor version here?
There was a problem hiding this comment.
I was considering this, but Lexbor has a main version (2.5.0 is the one currently in development), and seperate versions for each component, so I wasn't sure what we want. @nielsdos Do you have any preference for exposing the version information for Lexbor?
There was a problem hiding this comment.
No real preference. Exposing the main lexbor version is fine by me.
There was a problem hiding this comment.
I implemented a quick and dirty solution to expose the information, since it changes only ~ once per year, so my assumption is that it's not going to be difficult to maintain the version number in the makefiles.
There was a problem hiding this comment.
We could also list all of them. PHPInfo is for human rather than programmatic consumption.
There was a problem hiding this comment.
As I see the question, it doesn't really matter if the granular version information is also exposed. At least I'm totally fine with the current phpinfo content.
In preparation of php#14461 (https://wiki.php.net/rfc/url_parsing_api)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
I think that should be fine. The vote is very likely to be accepted and this is effectively an internal-only change (except for the fact that users will see an additional extension). In the worst case we revert if the vote fails. |
ndossche
left a comment
There was a problem hiding this comment.
I found the following remaining issues:
- codecov.yml needs updates because of the move of lexbor sources
- README.REDIST.BINS needs updates because of the move of lexbor sources (the path in the list needs updates)
- Compiling Lexbor as shared extension but DOM as static fails linking:
./configure --enable-debug --disable-all --enable-lexbor=shared --with-libxml --enable-dom. This makes sense, this configuration should not be allowed - The inverse (
./configure --enable-debug --disable-all --enable-lexbor --with-libxml --enable-dom=shared) also fails but should be able to work. It fails on loading the DOM extension. I thinkLXB_APIshould be set in such a way that the symbols become public
Since ext/uri will become a mandatory extension, ext/lexbor must as well. So this case should not even be possible. |
Yes, you are right: I realized that lexbor must have been required when I was rebasing the other PR on this one. So that one already has the fix. |
933665a to
08739ce
Compare
ndossche
left a comment
There was a problem hiding this comment.
Dynamically linking against Lexbor still fails, to get that to work you need to drop -DLEXBOR_STATIC from the config
4a8f9bd to
ca304ab
Compare
It turned out that I had to keep it for Windows, because there were some " inconsistent dll linkage" errors when I removed it. Unfortunately, I don't know the reason why it's different than on Unix systems, but hopefully the PR is correct now. |
Sus, because then you'll get the same issue on Windows. I'll take a look |
…lexbor if dom is built statically
|
It should all work now. See the commits. |
Thank you for all the help! |
|
Dropped the duplicated test in c7db07e |
In preparation of #14461 (https://wiki.php.net/rfc/url_parsing_api)
Windows support is pretty much TBD, as I have no way to test it.