Page MenuHomePhabricator

[python] [tests] Support overriding library path via environment
ClosedPublic

Authored by mgorny on Oct 2 2018, 3:25 PM.

Details

Summary

Support a new CLANG_LIBRARY_PATH environment variable for the Python
binding tests. This variable can be used to force the bindings to load
libclang.* from a specific directory.

I plan to use this when integrating Python binding tests with the CMake
build system. Currently, those tests load libclang.so from default
search paths, so I would have to rely on platform-specific mechanics
such as LD_LIBRARY_PATH. Instead of copying the whole logic necessary
to handle platform differences into yet another place, it's easier to
just add a dedicated variable for this purpose.

Diff Detail

Repository
rL LLVM

Event Timeline

mgorny updated this revision to Diff 168042.Oct 2 2018, 3:25 PM
mgorny created this revision.

(also included README update)

mgorny updated this revision to Diff 168079.Oct 3 2018, 1:23 AM

To avoid consumers of the bindings, I've changed the patch to set the path only through tests. As a result, the binding API is unchanged.

mgorny retitled this revision from [python] Support overriding library path via environment to [python] [tests] Support overriding library path via environment.Oct 11 2018, 2:23 AM
mgorny edited the summary of this revision. (Show Details)
steveire accepted this revision.Oct 11 2018, 2:33 AM
This revision is now accepted and ready to land.Oct 11 2018, 2:33 AM
This revision was automatically updated to reflect the committed changes.