Skip to content
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

add uninstall support #1604

Merged
merged 1 commit into from
Nov 7, 2023
Merged

add uninstall support #1604

merged 1 commit into from
Nov 7, 2023

Conversation

baentsch
Copy link
Member

@baentsch baentsch commented Nov 6, 2023

This closes for good the question how to uninstall liboqs.

  • [no] Does this PR change the input/output behaviour of a cryptographic algorithm (i.e., does it change known answer test values)? (If so, a version bump will be required from x.y.z to x.(y+1).0.)
  • [no] Does this PR change the list of algorithms available -- either adding, removing, or renaming? Does this PR otherwise change an API? (If so, PRs in fully supported downstream projects dependent on these, i.e., oqs-provider and OQS-OpenSSH will also need to be ready for review and merge by the time this is merged.)

@SWilson4
Copy link
Member

SWilson4 commented Nov 6, 2023

Thanks for setting up this feature, Michael! Not having clear uninstallation instructions has often annoyed me when I've tinkered around with open-source code in the past, so I'm glad that this is moving forward.

It looks like there are empty directories left around after running ninja uninstall. On my machine:

$ tree <install location>
<install location>
├── include
│   └── oqs
└── lib
    ├── cmake
    │   └── liboqs
    └── pkgconfig

6 directories, 0 files

Is this expected?

@baentsch
Copy link
Member Author

baentsch commented Nov 6, 2023

Is this expected?

Yes: The cmake logic clearly only removes the files it installed, not directories "indirectly" also created. Room for improvement, agreed -- but worth it?

@SWilson4
Copy link
Member

SWilson4 commented Nov 6, 2023

Is this expected?

Yes: The cmake logic clearly only removes the files it installed, not directories "indirectly" also created. Room for improvement, agreed -- but worth it?

Yes, definitely worth it. And I suppose that automatically removing directories is tricky and risky. Perhaps it's worth adding a note to the README suggesting that a fastidious user might want to clean up these empty directories.

@baentsch
Copy link
Member Author

baentsch commented Nov 6, 2023

Perhaps it's worth adding a note to the README suggesting that a fastidious user might want to clean up these empty directories.

No: Fastidious users regularly scour their hard disks for things that are out of place. I don't want to rob them of that pleasure :->>

Copy link
Member

@dstebila dstebila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to understand how this would work. If you run cmake --install and then keep that build directory around, then you can run cmake --uninstall afterward. Would this also create uninstall targets for ninja? And also, if you wipe out the build directory, you can't run uninstall without doing a second install (hopefully over top of the existing install, so that the paths are the same)?

@baentsch
Copy link
Member Author

baentsch commented Nov 7, 2023

Just to understand how this would work. If you run cmake --install and then keep that build directory around, then you can run cmake --uninstall afterward. Would this also create uninstall targets for ninja?

That's exactly what it does. As well as for any other code generator supported by cmake.

And also, if you wipe out the build directory, you can't run uninstall without doing a second install (hopefully over top of the existing install, so that the paths are the same)?

Correct. This simply iterates cmake -E remove over the install_manifest.txt generated when executing {cmake|make|ninja|...} install. It will delete the last install. If the user changed CMAKE_INSTALL_PREFIX in the same build directory without uninstalling before then tough luck: Same state as without this PR (no uninstall information around).

@dstebila
Copy link
Member

dstebila commented Nov 7, 2023

Thanks for the explanation! Merging.

@dstebila dstebila merged commit 78e65bf into main Nov 7, 2023
39 checks passed
@dstebila dstebila deleted the mb-add-uninstaller branch November 7, 2023 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants