pypa / auditwheel

Auditing and relabeling cross-distribution Linux wheels.
Other
432 stars 142 forks source link

fix: `--exclude libfoo.so` shall ignore dependencies of `libfoo.so` #474

Closed mayeut closed 8 months ago

mayeut commented 8 months ago

When using --exclude libfoo.so, dependencies of libfoo.so are still being analyzed & grafted. This commit moves the exclusion analysis to lddtree and filters libfoo.so DT_NEEDED entries thus excluding its dependencies from the tree.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (45a8c00) 92.17% compared to head (0368c2d) 92.17%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #474 +/- ## ======================================= Coverage 92.17% 92.17% ======================================= Files 20 20 Lines 1252 1253 +1 Branches 304 304 ======================================= + Hits 1154 1155 +1 Misses 56 56 Partials 42 42 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mayeut commented 8 months ago

The one thing I would add is that you may want to make the exclude argument optional in get_wheel_elfdata and analyze_wheel_abi as it isn't always necessary and otherwise they require an empty set to be passed in (i.e. in tests).

This reminded me to update one of the tests. I'd rather have this parameter mandatory. In the end, it shall be added to the show & lddtree commands. I nevertheless kept it optional in lddtree because that's one file that came from an external source and I tried not to change the semantics too much on that one (even though it should be considered private in Auditwheel context).