-
Notifications
You must be signed in to change notification settings - Fork 150
Add pythemis_uninstall target to Makefile. Fixes #948 #949
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
sashimanu-san
wants to merge
1
commit into
cossacklabs:master
Choose a base branch
from
sashimanu-san:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 think will be safer to uninstall it with
pip3 uninstall pythemis
Plus, we should test that it works. Can you add uninstall steps for our tests in github actions - https://github.com/cossacklabs/themis/blob/master/.github/workflows/test-python.yaml#L47? After finishing tests we can call
pythemis_uninstall
to be sure that this command worksThere 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.
additionally, will be great to delete
files3.txt
too. Due to this file generated by our Makefile, we should clean it too.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.
but we install it manually here
cd src/wrappers/themis/python/ && python3 setup.py install --record files3.txt
, should we uninstall via pip3?https://github.com/cossacklabs/themis/pull/949/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R605
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.
Yes, I revised one more time and your are right. System may haven't pip but be able to install packets with only python binary. So yes, probably we should delete with
rm
. But also we should deletefiles3.txt
too. To return system to same state as it was before installation.Uh oh!
There was an error while loading. Please reload this page.
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.
Despite a rather common approach: to record created / to remove created, there are couple of thoughts:
-r
flag forrm
? as far as I can see there only files are expected, correct me please if I miss somethingxargs rm -rf < files3.txt
looks a bit dangerous for me; due to a mistake or even execution/write fault, we might get shorter path in thefiles3.txt
than expected, which may lead torm -rf /
instead ofrm -rf /usr/local/...
; if we'd remove-r
flag, as suggested above, I think it would be safely enough; if we cannot do that and expect deep directory structures, I'd add filter to prevent removing unexpected paths (for example, we may expect, that prefix would be always/usr/local/lib/python
)Uh oh!
There was an error while loading. Please reload this page.
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.
Given that
setup.py
does not really have an uninstaller other that removing files recorded with--record
, I think this will be an acceptable improvement. Better than having to remove files manually.Normally, this installs an egg – just one file with an archive. However, I agree with @shadinua's concerns about removing stuff enumerated in some file.
I'd suggest to improve the call by doingxargs -n 1 unlink
. This should be portable between various UNIX-like systems and it shorter than, say, checking with shell that we remove files.Another way would be to throw in--preserve-root
, but that's a GNU-specific option. Since we expect only files to be removed,unlink
fits the job well (removes one file, cannot remove directories). Still,xargs
does not work for paths with spaces and newlines. But who uses those, right?Ignore me. Simply not setting
-r
should be enough to remove only files.I tend to think that
python_uninstall
should not removefiles3.txt
since that's just a part of the build, which should probably be removed by someclean
instead. However, I wouldn't mindpython_uninstall
cleaning up the directory. Keep in mind though thatpython_install
writes a bunch of other things as well besidesfiles3.txt
.