Repository navigation
Conversation
…mbol renames Two linker failures on Linux (libxml2 2.15.4 / Arch): 1. crates/php-types/build.rs emitted `-L /opt/homebrew/opt/gd/lib` and `-L /opt/homebrew/opt/tidy-html5/lib` unconditionally. These paths don't exist on Linux; on Linux libgd and libtidy are in the default system library path. Wrapped both `rustc-link-search` lines in `cfg!(target_os = "macos")` guards. 2. libxml2 2.x (shipped on Arch / modern Linux) renamed the XPath value-stack functions: `valuePop` → `xmlXPathValuePop` and `valuePush` → `xmlXPathValuePush`. The macOS system libxml2 (~2.9.x) still exports the old names. Added `#[cfg_attr(not(target_os = "macos"), link_name = "...")]` on the two FFI declarations in xsltio.rs so the correct symbol is resolved on each platform without touching any call sites. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…installed version, not by target OS (emend of PR #3) PR #3 switched `valuePop`/`valuePush` to `xmlXPathValuePop`/`xmlXPathValuePush` on every non-macOS target. The rename is a libxml2 >= 2.12 change (the old names are gone by 2.15, the author's Arch), but Debian/Ubuntu still ship libxml2 2.9.x, which only exports the old names: the PR would have broken those Linux builds while fixing Arch. build.rs now probes the installed version (`pkg-config --modversion libxml-2.0`, then `xml2-config --version`; `PHPR_LIBXML_NEW_XPATH=1|0` overrides) and emits `cfg(libxml_xpath_new_names)` from 2.12 on; xsltio.rs keys the two `link_name` attributes on that cfg. macOS never probes (system libxml2 2.9.13, verified in the SDK: `libxml2.tbd` exports `_valuePop`/ `_valuePush`), so the Mac binary links exactly as before. The Homebrew `-L` guards of the PR are kept unchanged. Linux is not verifiable on this machine; re-test requested on the PR. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks — merged into
Why the follow-up: the I cannot build on Linux here. Could you re-run Closing this PR since the commits are on |
… into s186-firma — REGOLE §5 frozen corpus 1407, §3.36 trait __CLASS__/__METHOD__ catalogued, NEXT scoreboard/pre-flight/openings, session verbal Gates on the triage tree (dev-release): build rc=0, loc_dente rc=0 with no cap raised, battery 1755/0 (+3 new dente), corpus-gate rc=0 (names == frozen 1407 x2 modes, content == golden 1404, off/on zero diffs), oracle diff IDENTICAL on the filter_var and enum fixtures. Route B stays dead (S-186 bis rc=4). S-188 order unchanged: O(1) cure v2 -> pin s184 -> t26/t28 pair -> merge on user signature. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
I've built current main on my Arch - no issues, a few warnings on dead code. I've asked my colleague to build on Debian, will share the results. |
Two linker failures on Linux (libxml2 2.15.4 / Arch):
crates/php-types/build.rs emitted
-L /opt/homebrew/opt/gd/liband-L /opt/homebrew/opt/tidy-html5/libunconditionally. These paths don't exist on Linux; on Linux libgd and libtidy are in the default system library path. Wrapped bothrustc-link-searchlines incfg!(target_os = "macos")guards.libxml2 2.x (shipped on Arch / modern Linux) renamed the XPath value-stack functions:
valuePop→xmlXPathValuePopandvaluePush→xmlXPathValuePush. The macOS system libxml2 (~2.9.x) still exports the old names. Added#[cfg_attr(not(target_os = "macos"), link_name = "...")]on the two FFI declarations in xsltio.rs so the correct symbol is resolved on each platform without touching any call sites.Summary
crates/php-types/build.rs: Wrapped-L /opt/homebrew/opt/{gd,tidy-html5}/libincfg!(target_os = \"macos\")guards. These paths don't exist on Linux; libgd and libtidy are found via the default system library path there.crates/php-types/src/xsltio.rs: Added#[cfg_attr(not(target_os = \"macos\"), link_name = \"xmlXPathValuePop/Push\")]on the two FFI declarations. libxml2 2.x (Arch/Linux) renamedvaluePop→xmlXPathValuePopandvaluePush→xmlXPathValuePush; macOS system libxml2 (~2.9.x) still uses the old names.Test plan
cargo build --profile dev-releasesucceeds on Linux (Arch, libxml2 2.15.4)valuePop/valuePushsymbols via thecfg_attrguard🤖 Generated with Claude Code