Page MenuHomeFreeBSD

net-p2p/c-lightning: hook dependencies for the clnrest plugin
ClosedPublic

Authored by vd on Feb 13 2024, 11:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 7, 10:45 PM
Unknown Object (File)
Sun, Oct 6, 10:31 AM
Unknown Object (File)
Fri, Oct 4, 3:51 PM
Unknown Object (File)
Wed, Oct 2, 9:57 PM
Unknown Object (File)
Wed, Oct 2, 4:31 AM
Unknown Object (File)
Tue, Oct 1, 3:53 PM
Unknown Object (File)
Tue, Oct 1, 3:53 PM
Unknown Object (File)
Sun, Sep 29, 9:12 AM
Subscribers

Details

Summary

The clnrest plugin is already installed but it depends on a bunch of
Python packages. Add an option to net-p2p/c-lightning to install and
depend on those packages.

Further, 3 of those packages were not in the FreeBSD ports. Add them:

  • net-p2p/pyln-bolt7 Lightning Network BOLT7 implementation
  • net-p2p/pyln-client Python client library for lightningd (net-p2p/c-lightning)
  • net-p2p/pyln-proto Lightning Network protocol implementation

To enable the plugin, add
clnrest-port=
clnrest-protocol=
clnrest-host=
to /usr/local/etc/lightningd-bitcoin.conf, see
https://docs.corelightning.org/docs/rest

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

vd requested review of this revision.Feb 13 2024, 11:11 AM
vd created this revision.
danfe added inline comments.
net-p2p/c-lightning/Makefile
67

This should probably be spelled as USE_PYTHON+=cryptography as there are two possible providers, see /usr/ports/Mk/Uses/python.mk around line 607.

112

That's quite a lot of dependencies there, did you consider moving plugins/clnrest/clnrest.py itself under an option, perhaps off by default? Generally I'm not a big fan of forcing RUN_DEPENDS, esp. when they come in large numbers, unless the software is really not usable without them being installed. If that's the case here then I guess it makes sense, if not (e.g. some/most of them are optional), I'd rather let the user decide and install only those one she needs, i.e. list them not in RUN_DEPENDS but in the pkg-message or as part of the documentation.

Make the new option CLNRESTDEPS off by default. Use USE_PYTHON+=cryptography.

vd marked an inline comment as done.Feb 14 2024, 6:37 PM
vd added inline comments.
net-p2p/c-lightning/Makefile
67

Done like this:

.if ${PORT_OPTIONS:MCLNRESTDEPS}
USE_PYTHON+=   cryptography
.endif

Thanks!

112

The plugin is installed by default and it has been like this. I think it is ok/harmless. Only if one tries to use it/enable it then it will not start because of missing py dependencies.

Indeed that plugin is not critical to the running of the software. I set the new option to OFF by default. However I left the dependencies in RUN_DEPENDS because that is the most convenient way - the user clicks the option to ON, meaning "I will use the clnrest plugin, thus I need those dependencies" and then everything needed gets installed.

If the dependencies are only listed in pkg-message, then the user has to bother manually installing them if they will use the clnrest plugin and then there is a chance that some of them gets deinstalled later by accident. With RUN_DEPENDS attempt to deinstall some of them will show that c-lightning depends on it.

Thank you!

vd marked an inline comment as done.Feb 14 2024, 6:38 PM
@vd wrote:

Indeed that plugin is not critical to the running of the software. I set the new option to OFF by default.

Fair enough, that's a good compromise. I don't think I have anything else to complain at this point. :-)

This revision is now accepted and ready to land.Feb 16 2024, 4:10 AM

Thank you for looking into this!