Skip to content

bazel: use libxml2 from the BCR#30224

Merged
travisdowns merged 1 commit intoredpanda-data:devfrom
travisdowns:td-libxml2-bcr
Apr 21, 2026
Merged

bazel: use libxml2 from the BCR#30224
travisdowns merged 1 commit intoredpanda-data:devfrom
travisdowns:td-libxml2-bcr

Conversation

@travisdowns
Copy link
Copy Markdown
Member

@travisdowns travisdowns commented Apr 17, 2026

Cherry-pick of the libxml2 commit from #28975, updated to use 2.15.2
(matching the version on dev).

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v25.3.x
  • v25.2.x
  • v25.1.x

Release Notes

  • none

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the Bazel libxml2 dependency from a custom http_archive + wrapper BUILD/headers to a Bazel Central Registry (BCR) module dependency, simplifying third-party maintenance.

Changes:

  • Adds bazel_dep(name = "libxml2", version = "2.15.1") and removes the prior use_repo-based libxml2 wiring.
  • Replaces wrapper includes with direct libxml2 headers (<libxml/parser.h>, <libxml/xmlwriter.h>) and updates Bazel deps to @libxml2.
  • Removes the custom third-party BUILD file and wrapper headers for libxml2.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
MODULE.bazel Adds BCR libxml2 module dep; removes use_repo for the previous non-module libxml2 repo.
MODULE.bazel.lock Locks BCR module resolution for libxml2 (and associated dependency graph changes).
bazel/repositories.bzl Removes the manual http_archive fetch of libxml2.
bazel/thirdparty/libxml2.BUILD Deletes the custom foreign_cc build definition used by the prior http_archive.
src/v/cloud_storage_clients/xml_sax_parser.h Switches to direct <libxml/parser.h> include.
src/v/cloud_storage_clients/BUILD Replaces //src/v/thirdparty/libxml2 with @libxml2 in deps.
src/v/test_utils/boost_result_redirect.cc Switches to direct <libxml/xmlwriter.h> include.
src/v/test_utils/BUILD Replaces //src/v/thirdparty/libxml2 with @libxml2 in implementation deps.
src/v/thirdparty/libxml2/BUILD Removes the local wrapper cc_library target.
src/v/thirdparty/libxml2/parser.h Removes wrapper header.
src/v/thirdparty/libxml2/xmlwriter.h Removes wrapper header.

Comment thread MODULE.bazel Outdated
@travisdowns
Copy link
Copy Markdown
Member Author

Rebased on dev and regenerated MODULE.bazel.lock.

@travisdowns travisdowns marked this pull request as draft April 17, 2026 20:26
@travisdowns travisdowns marked this pull request as ready for review April 17, 2026 20:41
@travisdowns
Copy link
Copy Markdown
Member Author

Updated to use libxml2 2.15.2 (matching what dev already had) via archive_override from the upstream GNOME tarball, since BCR only publishes up to 2.15.1. A patch overlay adds the Bazel build files (BUILD.bazel, MODULE.bazel, config.h, xmlversion.h) derived from the BCR's 2.15.1.bcr.1 module. 2.15.2 was needed for several CVE fixes including CVE-2026-0990.

@travisdowns
Copy link
Copy Markdown
Member Author

Also pushed .2 upstream to BCR, we can switch to that if/when pulled.

Also updates to 2.15

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
@travisdowns
Copy link
Copy Markdown
Member Author

Simplified: libxml2 2.15.2 is now published on BCR (bazelbuild/bazel-central-registry#8453 merged), so we can use it directly via bazel_dep. Dropped the archive_override and overlay patch.

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

CI test results

test results on build#83394
test_status test_class test_method test_arguments test_kind job_url passed reason test_history
FAIL src/v/cloud_topics/level_zero/tests/l0_object_size_distribution_test src/v/cloud_topics/level_zero/tests/l0_object_size_distribution_test unit https://buildkite.com/redpanda/redpanda/builds/83394#019dab53-21a0-4b14-b880-472f31dd28f2 0/1

@travisdowns travisdowns merged commit 6a2fac5 into redpanda-data:dev Apr 21, 2026
20 checks passed
@travisdowns travisdowns deleted the td-libxml2-bcr branch April 22, 2026 19:37
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