Skip to content

Auditor: Avoid setting macOS rpaths for /workspace #1376

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

eschnett
Copy link
Contributor

This addresses the first half of #1375, namely pruning /workspace from rpaths.

@giordano
Copy link
Member

giordano commented Apr 11, 2025

Please add a test. Which probably means removing broken=Sys.isapple(platform) at

# Currently we don't filter out absolute rpaths for macOS libraries, no good.
@test length(libfoo_rpaths) == 1 broken=Sys.isapple(platform)

@giordano
Copy link
Member

The fact that tests are passing suggests this isn't doing much.

@giordano
Copy link
Member

My understanding of the issue is that the rpath isn't added by the auditor but it's already there at the end of the build, so skipping install_name_tool here is not doing anything at all.

@giordano
Copy link
Member

Probably this is also why this wasn't done before: unlike ELF files, we currently don't "update" the rpath list for Mach-O files, only add them if necessary. Which isn't the case here, there's nothing to add in the first place.

@eschnett
Copy link
Contributor Author

Does the function _rpaths work for macOS? (I don't quite understand your comment – are you saying that we "don't update the rpath list", in the sense that _rpaths doesn't return the rpath list?)

@giordano
Copy link
Member

The function you're modifying is adding new directories to rpath. The problem is that ${libdir} is already there. We want to remove that.

@eschnett
Copy link
Contributor Author

That bit I understood. Let me ask my question differently: How do I get the current list of rpaths in the library? Is there infrastructure for this, or would I be writing a bash script calling install_name_tool?

@giordano
Copy link
Member

ObjectFile.jl (which is used in this package extensively) should be able to give you that. I don't remember on top of my head if there's any wrapper function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants