Skip to content

[RFC] Tests: set DYLD_LIBRARY_PATH on Darwin #14430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

lb90
Copy link
Contributor

@lb90 lb90 commented Apr 1, 2025

From what I can tell, DYLD_LIBRARY_PATH has precedence over rpath, just like LD_LIBRARY_PATH has on other Unices.

Enhance #11119 to work on Darwin.

@lb90 lb90 requested a review from jpakkane as a code owner April 1, 2025 14:06
Copy link
Member

@dcbaker dcbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the man page from darwin, it looks like this is correct, although I don't have a mac handy to test with, and I'm not sure if we have any tests that get run on Mac for this feature? It would be nice to verify that this is, in fact, working as we expect

Comment on lines +1298 to +1301
if machine.is_darwin():
t_env.prepend('DYLD_LIBRARY_PATH', list(ld_lib_path), ':')
else:
t_env.prepend('LD_LIBRARY_PATH', list(ld_lib_path), ':')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have a slight preference for something like:

var = 'DYLD_LIBRARY_PATH' if machine.is_darwin() else 'LD_LIBRARY_PATH'
t_env.prepend(var, ...)

since everything else is the same between the two paths.

@dcbaker dcbaker added the OS:macos Issues specific to Apple Operating Systems like MacOS and iOS label Apr 1, 2025
@eli-schwartz eli-schwartz requested a review from thesamesam April 2, 2025 16:44
@lb90
Copy link
Contributor Author

lb90 commented May 28, 2025

Hi @dcbaker! Turns out this not only enhances #11119 for Darwin, but also makes depends and targets in args work.

As such I'm going to include this commit (with your suggestions applied) in another PR: #14649

@thesamesam
Copy link
Member

Sorry, I'd missed this before. I'll look at the other PR.

@lb90 lb90 closed this May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS:macos Issues specific to Apple Operating Systems like MacOS and iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants