-
Notifications
You must be signed in to change notification settings - Fork 60
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
Fix deleting duplicated rpaths #208
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #208 +/- ##
==========================================
- Coverage 96.80% 96.80% -0.01%
==========================================
Files 15 15
Lines 1285 1283 -2
==========================================
- Hits 1244 1242 -2
Misses 41 41 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are performance implications to calling replace_signature
multiple times. It is already called too many times for the same file in the current code.
Let delete_rpath
take multiple paths. Counter can be useful to track when a parameter must be given multiple times. Actually just iterating over the paths one at a time is fine as long as replace_signature
is called only once.
If a new function must be added then make it private: def _delete_rpath
Mind editing the docs for get_rpaths
to clarify that duplicate rpaths may be returned?
Sorry, didn't see your edit. Shall I revert the Counter changes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think _delete_rpath
should take an iterable of paths to remove (paths: Iterable[str]
). replace_signature
and logging would be moved into _delete_rpath
.
Then _remove_absolute_rpaths
would be simplified to this:
_delete_rpath(
filename,
(rpath for rpath in get_rpaths(filename) if not _is_rpath_sanitary(rpath)),
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Close to finishing. This should also be mentioned as a fix in the changelog.
delocate/tools.py
Outdated
|
||
if ad_hoc_sign: | ||
replace_signature(filename, "-") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant since _delete_rpaths
handles signing.
if ad_hoc_sign: | |
replace_signature(filename, "-") |
Changelog.md
Outdated
- Fixes deleting duplicated rpaths when sanitize-rpaths option is turned on. | ||
[#208](https://github.com/matthew-brett/delocate/pull/208) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Less vague changelog item.
- Fixes deleting duplicated rpaths when sanitize-rpaths option is turned on. | |
[#208](https://github.com/matthew-brett/delocate/pull/208) | |
- `--sanitize-rpaths` was not removing duplicate rpaths. | |
[#208](https://github.com/matthew-brett/delocate/pull/208) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to '--sanitize-rpaths
was failing with duplicate rpaths.' as it was failing with an exception from subprocess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest commit mentioned but did not touch the redundant replace_signature
call.
At this point I can handle the rest if you're finished.
Thanks @HexDecimal for the reviews. |
@HexDecimal is there a release planned for delocate? |
I'm slightly hesitant with the recent changes and the changes I've been considering, but nothing is actually preventing a release it in its current state. I'll do a release now. I probably should've done one earlier. |
No description provided.