This is an archive of the discontinued LLVM Phabricator instance.

[bazel] Remove unused dependency on libxml2
ClosedPublic

Authored by aaronmondal on Feb 5 2023, 2:58 PM.

Details

Summary

The Bazel configs don't set LLVM_ENABLE_LIBXML2, so this was never usable to
begin with.

On systems without static libxml2.a this made lld runtime-dependent on an
unused, non-hermetic libxml2.so.

Diff Detail

Event Timeline

aaronmondal created this revision.Feb 5 2023, 2:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2023, 2:58 PM
aaronmondal requested review of this revision.Feb 5 2023, 2:58 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2023, 2:58 PM
MaskRay accepted this revision.Feb 5 2023, 5:34 PM
This revision is now accepted and ready to land.Feb 5 2023, 5:34 PM

Hmm I'm trying to remember this history on this one too. I think this was added after hitting a real bug on Windows... Again @chandlerc

aaronmondal added a comment.EditedFeb 6 2023, 2:34 PM

Hmm I'm trying to remember this history on this one too. I think this was added after hitting a real bug on Windows... Again @chandlerc

This shouldn't affect anyone using default Bazel configs. The functionality that depends on libxml is disabled (as in, disabled on the preprocessor level). Not having xml2 support disables symbols in llvm/lib/WindowsManifest/WindowsManifestMerger.cpp, but linking xml2 it here without setting LLVM_ENABLE_XML2 has no effect.

This functionality should currently only be usable if you manually patched the Bazel configs.

Ultimately I'd like to make this a configurable flag depending on/setting LLVM_ENABLE_XML2, but I think the CMake-to-Bazel scripts are't ready to support this yet. It's probably better to wait for https://reviews.llvm.org/D143295 to get through first and then add configurability separately.

GMNGeoffrey accepted this revision.Feb 6 2023, 3:26 PM

This shouldn't affect anyone using default Bazel configs. The functionality that depends on libxml is disabled (as in, disabled on the preprocessor level). Not having xml2 support disables symbols in llvm/lib/WindowsManifest/WindowsManifestMerger.cpp, but linking xml2 it here without setting LLVM_ENABLE_XML2 has no effect.

This functionality should currently only be usable if you manually patched the Bazel configs.

Ultimately I'd like to make this a configurable flag depending on/setting LLVM_ENABLE_XML2, but I think the CMake-to-Bazel scripts are't ready to support this yet. It's probably better to wait for https://reviews.llvm.org/D143295 to get through first and then add configurability separately.

Yeah that makes sense. I'm just pretty sure that at the time there was some reason that Chandler added it to begin with and I'm trying to make sure we understand why it was there before removing it (Chesterton's Fence 🙂). Maybe it was indeed in service of a downstream who was patching the config. I think at Google we turn this on, but we use a hermetic version so this doesn't affect us either. Anyways, I'm pretty sure the current state is nonsensical as you say, so I'm ok to go ahead.

This revision was automatically updated to reflect the committed changes.