This is an archive of the discontinued LLVM Phabricator instance.

[llvm] [Debuginfod] Disable CURL by default.
ClosedPublic

Authored by noajshu on Dec 10 2021, 2:20 AM.

Details

Summary

Sets LLVM_ENABLE_CURL to OFF by default to avoid accidental inclusion of libcurl in builds which do not override the default.

Diff Detail

Event Timeline

noajshu created this revision.Dec 10 2021, 2:20 AM
noajshu requested review of this revision.Dec 10 2021, 2:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2021, 2:20 AM

Thanks for doing this patch. There was some additional feedback from users that this might not be sufficient: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5732

Would it be better to just not include this library in libLLVM.so ?

Thanks for doing this patch. There was some additional feedback from users that this might not be sufficient: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5732

Would it be better to just not include this library in libLLVM.so ?

Thanks very much for sharing this link!
I like your idea to not include Debuginfod in libLLVM.so. Debuginfod is used by DebugInfo/Symbolize, so wouldn't we have to remove Symbolize from libLLVM.so as well? I imagine distros will want Symbolize if they ship with llvm's standard tools (including llvm-symbolizer).
I am curious about loading libcurl lazily via dlopen as Simon McVittie suggested on the mesa issue. Allowing this to happen with some build configuration would seem to meet the needs of a distro libLLVM.so, since it will still work fine for lldb, llvm-symbolizer etc. but mesa shouldn't pull in the conflicting curl (unless it uses debuginfod things).
I didn't completely understand the example of the failure case mentioned with Steam and libcurl 3 vs. 4. If curl is linked statically linked, I'm not sure why a particular version would be needed in the library search path in the first place, so Steam could have its favorite version there instead. Sorry if I'm misunderstanding something.

Anyways if it does address the problems I would lean towards adding a build option to pull in libcurl as a shared lib. Do you think this should be a follow-up diff?

thakis accepted this revision.Dec 13 2021, 8:21 AM

This seems fine to me, but as mentioned at https://reviews.llvm.org/D113717#3189211 I don't think it helps you much with what you want to do.

This revision is now accepted and ready to land.Dec 13 2021, 8:21 AM
This revision was automatically updated to reflect the committed changes.

Thanks for the review @thakis !
I will follow up on the mesa forum directly to ask my question re: libcurl3 vs. libcurl4 because I am curious what the issue is there.