matthew-brett / delocate

Find and copy needed dynamic libraries into python wheels
BSD 2-Clause "Simplified" License
266 stars 58 forks source link

Rename `get_install_names` to `get_dependency_names` #114

Closed isuruf closed 3 years ago

isuruf commented 3 years ago

The name get_install_names is confusing as it's giving the install names of the dependencies and not the install name of the library.

matthew-brett commented 3 years ago

I think the thing you are thinking of is the install name ID"; macOS does use "install names to mean the things that the library depends on - see https://matthew-brett.github.io/docosx/mac_runtime_link.html#the-install-name

isuruf commented 3 years ago

Manpage for install_name_tool mentions

Changes the dependent shared library install name old to new in the specified Mach-O binary.

which is more descriptive. It also says

Install_name_tool changes the dynamic shared library install names and or adds, changes or deletes the rpaths recorded in a Mach-O binary.

which matches with your comment.

Something like get_dependency_install_names might make it better.

HexDecimal commented 3 years ago

I'd be okay with changing the name to something more specific, but the current name seems clear when you understand the terminology used on Mac.

get_dependency_names would imply that the real paths to a libraries dependencies would be returned. These are not the same as the install names, which usually have to be resolved to get the real path of a library.

get_dependency_install_names might imply that the install names would be returned from the libraries that another library depends on.

get_install_names is plural and the function takes only one library. You shouldn't mistake this for the install name ID, and you shouldn't mistake this for returning the real paths to the dependencies. This returns the literal install names of a single library.

get_install_id exists which returns the ID, this could probably be changed to get_install_name_id which would show that it's install name related and that this function returns the ID while the other returns multiple install names (which can't be the ID.)

Any further complaints should be made to Apple for not using a better naming convention when they had the chance.