You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug delocate-wheel picks a non-deterministic directory for bundled .dylibs.
To Reproduce
This is reproducible by building the macOS wheels of Drake. I'm not sure what would be required for a simpler test case.
Expected behavior
Bundled .dylibs should always be in the same directory.
Platform (please complete the following information):
OS version: [e.g. macOS 12, macOS 10.15]
Delocate version: [e.g. 0.10.0]
Additional context
This behavior is caused by wheels for which tools.find_package_dirs returns multiple entries of the form {'a', 'ba'}, where a is the package name. For example, when delocating the Drake wheel, the package directories are .../drake and .../pydrake. Because _decide_dylib_bundle_directory uses directory.endswith(package_name) to select a result, and because the order of the items in the set is non-deterministic (at least with respect to their final component), the result of _decide_dylib_bundle_directory is non-deterministic.
A correct implementation is to split the final path component from directory and compare it to package_name, e.g. directory.rsplit('/', 1)[-1] == package_name.
The text was updated successfully, but these errors were encountered:
Describe the bug
delocate-wheel
picks a non-deterministic directory for bundled.dylib
s.To Reproduce
This is reproducible by building the macOS wheels of Drake. I'm not sure what would be required for a simpler test case.
Expected behavior
Bundled
.dylib
s should always be in the same directory.Platform (please complete the following information):
Additional context
This behavior is caused by wheels for which
tools.find_package_dirs
returns multiple entries of the form{'a', 'ba'}
, wherea
is the package name. For example, when delocating the Drake wheel, the package directories are.../drake
and.../pydrake
. Because_decide_dylib_bundle_directory
usesdirectory.endswith(package_name)
to select a result, and because the order of the items in theset
is non-deterministic (at least with respect to their final component), the result of_decide_dylib_bundle_directory
is non-deterministic.A correct implementation is to split the final path component from
directory
and compare it topackage_name
, e.g.directory.rsplit('/', 1)[-1] == package_name
.The text was updated successfully, but these errors were encountered: