Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#940960: ITP: linenoise -- Minimal replacement for readline

20 views
Skip to first unread message

Jeremy Sowden

unread,
Sep 22, 2019, 11:50:03 AM9/22/19
to
Package: wnpp
Severity: wishlist
Owner: Jeremy Sowden <jer...@azazel.net>

* Package name : linenoise
Version : 1.0+git20180718.4a961c010872
Upstream Author : Salvatore Sanfilippo <ant...@gmail.com>
* URL : https://github.com/antirez/linenoise
* License : BSD-2-Clause
Programming Lang: C
Description : Minimal replacement for readline

A minimal, zero-config, BSD licensed, readline replacement used in Redis,
MongoDB, and Android.

* Single and multi line editing mode with the usual key bindings implemented.
* History handling.
* Completion.
* Hints (suggestions at the right of the prompt as you type).
* About 1,100 lines of BSD license source code.
* Only uses a subset of VT100 escapes (ANSI.SYS compatible).

Blair Noctis

unread,
Apr 30, 2023, 4:20:05 PM4/30/23
to
Hi Jeremy,

It's been a few years since this ITP was filed. Do you still plan to package it?
I'm packaging osquery which depends on this. Happy to help ;)

--
Sdrager,
Blair Noctis
OpenPGP_signature

Jeremy Sowden

unread,
May 8, 2023, 5:10:04 PM5/8/23
to
On 2023-05-01, at 04:09:16 +0800, Blair Noctis wrote:
> It's been a few years since this ITP was filed. Do you still plan to
> package it? I'm packaging osquery which depends on this. Happy to
> help ;)

Thanks for the offer. :) I've cloned the osquery repo and it appears to
use the C++ Linenoise NG fork:

https://github.com/arangodb/linenoise-ng

not the C original:

https://github.com/antirez/linenoise

which is what I started packaging. The reason that I stopped work on it
was that linenoise is intended to be used by adding the sources to the
code-base of the application that wants the functionality. I created a
PR to add support for building it as a shared library:

https://github.com/antirez/linenoise/pull/174

and there has been no response (mind you, there are a lot of open PR's
going back years), so I wasn't sure whether it was worth adding to
Debian.

I've had a quick look at the linenoise-ng repo and it appears to be
API-compatible with the original and has a [c]make file, so it may be a
better candidate for packaging -- particularly now that you have
provided a use-case for it. I'll take a closer look and see how much of
my work can be salvaged.

J.
signature.asc

Blair Noctis

unread,
May 9, 2023, 4:40:04 AM5/9/23
to
On 2023/5/9 04:20, Jeremy Sowden wrote:
> Thanks for the offer. :) I've cloned the osquery repo and it appears to
> use the C++ Linenoise NG fork:

No problem ;) It uses the -ng fork, but the fork's repo was archived in 2017,
which leads me back to the original. And

> which is what I started packaging. The reason that I stopped work on it
> was that linenoise is intended to be used by adding the sources to the
> code-base of the application that wants the functionality. I created a
> PR to add support for building it as a shared library:

is "solved" by adding a make target that builds a .so ("solved" only in my
opinion, of course). But…

> and there has been no response (mind you, there are a lot of open PR's
> going back years), so I wasn't sure whether it was worth adding to
> Debian.

This is indeed a problem, which I overlooked at first. A second check shows 59
open issues vs 24 closed, and as you said 73 open PRs vs 54 closed, an obvious
sign of abandonment, overlooked largely due to its recent commits.

> I've had a quick look at the linenoise-ng repo and it appears to be
> API-compatible with the original and has a [c]make file, so it may be a
> better candidate for packaging -- particularly now that you have
> provided a use-case for it. I'll take a closer look and see how much of
> my work can be salvaged.
Speaking of API-compatible — I asked in #debian-mentors and someone expressed
strong concern over the lack of versioning of the original, while -ng at least
has a macro that defines its version.

In the compatibility sense I'm now more on the -ng side. Personally I don't like
cmake… but it's fine on this level.

The use case is a big headache, vendoring everything with its various own
compilation tweaks baked in cmake files. linenoise is hardly a problem compared
to that… Still, happy to help ;)

--
Sdrager,
Blair Noctis

OpenPGP_signature

Jeremy Sowden

unread,
May 13, 2023, 3:30:05 PM5/13/23
to
I came across linenoise because of a request to support it in nftables.
The request came from someone who wanted to install nftables in a
resource-constrained environment where the existing libreadline support
was too heavyweight. In the case of osquery, would it possible to go
the other way? Do you think that upstream would be open to adding
support for libreadline if we offered patches?

J.
signature.asc

Blair Noctis

unread,
May 14, 2023, 3:10:05 AM5/14/23
to
Feasible on the resource level I think, it links to many libraries anyway. But
for using readline… they actually switched away from it in 2016:
https://github.com/osquery/osquery/pull/2613

Considering their rather radical approach of vendoring everything, I don't have
too much hope for that.

--
Sdrager,
Blair Noctis

OpenPGP_signature

Jeremy Sowden

unread,
May 17, 2023, 1:50:05 PM5/17/23
to
On 2023-05-14, at 15:00:06 +0800, Blair Noctis wrote:
> On 2023/5/14 03:24, Jeremy Sowden wrote:
> > I came across linenoise because of a request to support it in nftables.
> > The request came from someone who wanted to install nftables in a
> > resource-constrained environment where the existing libreadline support
> > was too heavyweight. In the case of osquery, would it possible to go
> > the other way? Do you think that upstream would be open to adding
> > support for libreadline if we offered patches?
>
> Feasible on the resource level I think, it links to many libraries anyway. But
> for using readline… they actually switched away from it in 2016:
> https://github.com/osquery/osquery/pull/2613
>
> Considering their rather radical approach of vendoring everything, I don't have
> too much hope for that.

Ah, right. So much for that idea!

It occurs to me that it might make more sense for you to take the lead
in packaging linenoise since you have an interest in getting it into
Debian. Would you like me to transfer ownership of the ITP bug to you?
Happy to lend a hand if you need one.

J.
signature.asc

Blair Noctis

unread,
May 21, 2023, 6:11:36 AM5/21/23
to
On Wed, 17 May 2023 18:40:26 +0100 Jeremy Sowden <jer...@azazel.net> wrote:
> It occurs to me that it might make more sense for you to take the lead
> in packaging linenoise since you have an interest in getting it into
> Debian. Would you like me to transfer ownership of the ITP bug to you?
> Happy to lend a hand if you need one.
>
> J.

Hmm, can I ask for a review while I upload to mentors.d.n? Wanna make sure I did
it right.

--
Sdrager,
Blair Noctis
OpenPGP_signature

Jeremy Sowden

unread,
Jun 11, 2023, 6:00:35 PM6/11/23
to
On 2023-05-21, at 18:00:45 +0800, Blair Noctis wrote:
> On Wed, 17 May 2023 18:40:26 +0100 Jeremy Sowden <jer...@azazel.net> wrote:
> > It occurs to me that it might make more sense for you to take the lead
> > in packaging linenoise since you have an interest in getting it into
> > Debian. Would you like me to transfer ownership of the ITP bug to you?
> > Happy to lend a hand if you need one.
>
> Hmm, can I ask for a review while I upload to mentors.d.n? Wanna make
> sure I did it right.

Yes, absolutely. Apologies for taking three weeks to reply.

J.
signature.asc

Blair Noctis

unread,
Jun 14, 2023, 8:00:05 AM6/14/23
to
And I took two days ;)

Here it goes: https://mentors.debian.net/package/linenoise/

--
Sdrager,
Blair Noctis

OpenPGP_signature

Blair Noctis

unread,
Jun 14, 2023, 8:00:05 AM6/14/23
to
On 2023-06-12 05:55, Jeremy Sowden wrote:
OpenPGP_signature

Jeremy Sowden

unread,
Jun 18, 2023, 5:41:33 AM6/18/23
to
On 2023-06-14, at 19:55:01 +0800, Blair Noctis wrote:
> On 2023-06-12 05:55, Jeremy Sowden wrote:
> > On 2023-05-21, at 18:00:45 +0800, Blair Noctis wrote:
> >> On Wed, 17 May 2023 18:40:26 +0100 Jeremy Sowden wrote:
> >>> It occurs to me that it might make more sense for you to take the lead
> >>> in packaging linenoise since you have an interest in getting it into
> >>> Debian. Would you like me to transfer ownership of the ITP bug to you?
> >>> Happy to lend a hand if you need one.
> >>
> >> Hmm, can I ask for a review while I upload to mentors.d.n? Wanna make
> >> sure I did it right.
> >
> > Yes, absolutely. Apologies for taking three weeks to reply.
> >
> > J.
>
> And I took two days ;)
>
> Here it goes: https://mentors.debian.net/package/linenoise/

You've gone a for a less elaborate build process for the shared library
than I did:

https://github.com/antirez/linenoise/pull/174/commits/ab860406520ad7fc5e7e8e91fcf60cdc43a786f0

but that's probably fine. I do have one observation, however. The
shared library should be liblinenoise.so.0.0.0 and there should be two
sym-links: liblinenoise.so.0, which is needed by the library's
dependencies at run-time, and liblinenoise.so which is needed by its
dependencies at build-time.

I've attached a patch-series with some suggested changes.

J.
0001-d-p-build-in-makefile.patch-get-rid-of-phony-shlib-t.patch
0002-d-p-build-in-makefile.patch-use-full-version-number-.patch
0003-d-p-build-in-makefile.patch-put-FLAGS-variables-last.patch
0004-d-p-build-in-makefile.patch-don-t-clean-.so-cause-we.patch
0005-d-.links-install-shlib-sym-links.patch
signature.asc

Blair Noctis

unread,
Jun 28, 2023, 6:00:06 PM6/28/23
to
On 2023-06-18 05:10, Jeremy Sowden wrote:
>>> Yes, absolutely. Apologies for taking three weeks to reply.
>>>
>>> J.
>>
>> And I took two days ;)

This time took literally two weeks, haha. Dragged away by $work.

> You've gone a for a less elaborate build process for the shared library
> than I did:
>
> https://github.com/antirez/linenoise/pull/174/commits/ab860406520ad7fc5e7e8e91fcf60cdc43a786f0
>
> but that's probably fine. I do have one observation, however. The
> shared library should be liblinenoise.so.0.0.0 and there should be two
> sym-links: liblinenoise.so.0, which is needed by the library's
> dependencies at run-time, and liblinenoise.so which is needed by its
> dependencies at build-time.
>
> I've attached a patch-series with some suggested changes.
>
> J.

I've applied the patches after reading them. It's great to learn from code.

OTOH I saw your salsa repo. Since you've done that much I think it's probably
better to let you finish it?

--
Sdrager,
Blair Noctis

OpenPGP_signature
0 new messages