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

plugins/clnrest: simple wrapper to handle missing python3. #7211

Merged

Conversation

rustyrussell
Copy link
Contributor

Apparently NixOS didn't have Python (sometimes!) so let's not assume. By reusing the JSON "parsing" code from cowsay, we can self-disable to handle this case.

Reported-by: Shahana Farooqui shahana.farooqui@gmail.com

Changelog-Fixed: Plugins: clnrest now correctly self-disables if Python not present at all.

Apparently NixOS didn't have Python (sometimes!) so let's not assume.
By reusing the JSON "parsing" code from cowsay, we can self-disable
to handle this case.

Reported-by: Shahana Farooqui <shahana.farooqui@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: Plugins: `clnrest` now correctly self-disables if Python not present at all.
@rustyrussell rustyrussell added this to the v24.05 milestone Apr 12, 2024
Comment on lines +1 to +5
#! /bin/sh
# clrest.py neatly exits if we don't have dependencies, but what if we don't
# have Python itself?

if ! type python3 > /dev/null 2>&1; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

imho this should be standard of every plugin :)

Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

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

ACK c76bd6c

Apparently NixOS didn't have Python

if someone is using nix in the correct way this should be always true due that the dependencies should be declared inside the binary, and not at the OS level (well this is how I use it, idk if this is the standard way, but I like to believe it 😸 )

@vincenzopalazzo vincenzopalazzo merged commit c4edec8 into ElementsProject:master Apr 12, 2024
35 checks passed
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.

2 participants