This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Print an actionable error message when sphinx_automodapi is not installed
ClosedPublic

Authored by JDevlieghere on Aug 15 2023, 2:08 PM.

Details

Summary

Print an error message with instructions on how to install sphinx_automodapi.

Diff Detail

Event Timeline

JDevlieghere created this revision.Aug 15 2023, 2:08 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2023, 2:08 PM
JDevlieghere requested review of this revision.Aug 15 2023, 2:08 PM
mib added a subscriber: mib.Aug 15 2023, 4:31 PM

We should really add a requirements.txt file with all the dependencies.

We should really add a requirements.txt file with all the dependencies.

I've long wanted to make this all automated, and have CMake install all the necessary dependencies. But that seems a bit intrusive without using something like a virtual environment, which would have to be project-wide and more work than I'm willing to put in. Regardless, that wouldn't actually help here, at least not on macOS if you installed sphinx with homebrew, because it packages its own version of Python (/opt/homebrew/Cellar/sphinx-doc/7.1.2/libexec/bin/python) and you have to install the sphinx_automodapi module with that. That's why I print sys.executable and really the motivation behind this patch.

bulbazord accepted this revision.Aug 15 2023, 5:34 PM
bulbazord added a subscriber: bulbazord.

From the discussion this sounds like a reasonable thing to do.

This revision is now accepted and ready to land.Aug 15 2023, 5:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 16 2023, 9:15 AM

I was in this exact situation yesterday but luckily I had already used a virtualenv to fix some other Python problems so I knew how to fix it. Had it not been for that, seeing the exact Python path would have been very useful here, thanks for adding this message.