Page MenuHomePhabricator

[lldb/test] Do a better job at setting (DY)LD_LIBRARY_PATH
ClosedPublic

Authored by labath on Jul 10 2020, 6:07 AM.

Details

Summary

registerSharedLibrariesWithTarget was setting the library path
environment variable to the process build directory, but the function is
also accepting libraries in other directories (in which case they won't
be found automatically).

This patch makes the function set the path variable correctly for these
libraries too. This enables us to remove the code for setting the path
variable in TestWeakSymbols.py, which was working only accidentally --
it was relying on the fact that

launch_info.SetEnvironmentEntries(..., append=True)

would not overwrite the path variable it has set, but that is going to
change with D83306.

Diff Detail

Event Timeline

labath created this revision.Jul 10 2020, 6:07 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 10 2020, 6:07 AM

Any thoughts on this? It should fix the failures from D83306...

friss added a subscriber: friss.Jul 20 2020, 9:25 AM

The lldbtest.py part LGTM, but I'm failing to see how this interacts with TestWeakSymbols.py? IIRC, registerSharedLibraryWithTarget is an API we call explicitly in the tests, but I don't see it called here.

The lldbtest.py part LGTM, but I'm failing to see how this interacts with TestWeakSymbols.py? IIRC, registerSharedLibraryWithTarget is an API we call explicitly in the tests, but I don't see it called here.

It gets called from run_to_source_breakpoint, keying off of the extra_images argument.

friss accepted this revision.Jul 21 2020, 8:09 AM

The lldbtest.py part LGTM, but I'm failing to see how this interacts with TestWeakSymbols.py? IIRC, registerSharedLibraryWithTarget is an API we call explicitly in the tests, but I don't see it called here.

It gets called from run_to_source_breakpoint, keying off of the extra_images argument.

Which I added... Thanks!

This revision is now accepted and ready to land.Jul 21 2020, 8:09 AM
This revision was automatically updated to reflect the committed changes.