Skip to content

[ML] Stop linking and shipping libxml2 - #3244

Merged
valeriy42 merged 5 commits into
elastic:mainfrom
valeriy42:feature/drop-libxml2
Oct 28, 2026
Merged

valeriy42 merged 5 commits into
elastic:mainfrom
valeriy42:feature/drop-libxml2

Conversation

@valeriy42

Copy link
Copy Markdown
Contributor

Summary

  • Nothing in lib/, bin/ or include/ calls libxml2 or includes its headers any more; only the link lines and the packaging step were left over.
  • Checked the 9.2.0 Linux x86_64 ML platform libs: only libMlCore.so lists libxml2.so.2 as NEEDED, and none of the ML libraries or binaries import an xml* symbol.
  • Removes LIBXML2_LIBRARIES from the nine CMake link lists, the include paths, the install_libs call and the license files, so the bundled libxml2 2.10.4 (the source of most dependency scanner alerts) no longer ships.
  • The Dockerfiles and build docs still build libxml2; that cleanup needs new image tags and will follow separately.
  • Not built locally (no Boost in this environment); relies on CI for all platforms.

No ml-cpp code calls libxml2 any more; the XML parsing code was removed
earlier. Drop it from the link lines and the packaged third-party libraries.
@elasticsearchmachine

Copy link
Copy Markdown

Pinging @elastic/ml-core (Team:ML)

libMlCore calls dladdr() in CCrashHandler_Linux.cc but only got libdl
transitively through libxml2. Without libxml2, linking controller failed
with an undefined reference to dladdr.

@edsavage edsavage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

I notice that there's some dead CXml* classes lying around still. lib/core still has CXmlNode, CXmlNodeWithChildren, CXmlNodeWithChildrenPool and CXmlParserIntf, with CXmlParser*.xml test fixtures. They have no libxml2 dependency now. Maybe deal with these in a follow-up PR?

@valeriy42
valeriy42 merged commit f317152 into elastic:main Oct 28, 2026
26 checks passed
@valeriy42
valeriy42 deleted the feature/drop-libxml2 branch October 28, 2026 09:21
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.

3 participants