All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Jeremy Sowden <jeremy@azazel.net>
Cc: Netfilter Devel <netfilter-devel@vger.kernel.org>,
	Sebastian Priebe <sebastian.priebe@de.sii.group>
Subject: Re: [PATCH RFC nftables 0/4] Add Linenoise support to the CLI.
Date: Fri, 20 Sep 2019 12:15:20 +0200	[thread overview]
Message-ID: <20190920101520.kwwns3v7nma646bv@salvia> (raw)
In-Reply-To: <20190916124203.31380-1-jeremy@azazel.net>

On Mon, Sep 16, 2019 at 01:41:59PM +0100, Jeremy Sowden wrote:
> Sebastian Priebe [0] requested Linenoise support for the CLI as an
> alternative to Readline, so I thought I'd have a go at providing it.
> Linenoise is a minimal, zero-config, BSD licensed, Readline replacement
> used in Redis, MongoDB, and Android [1].
> 
>  0 - https://lore.kernel.org/netfilter-devel/4df20614cd10434b9f91080d0862dd0c@de.sii.group/
>  1 - https://github.com/antirez/linenoise/
> 
> The upstream repo doesn't contain the infrastructure for building or
> installing libraries.  I've taken a look at how Redis and MongoDB handle
> this, and they both include the upstream sources in their trees (MongoDB
> actually uses a C++ fork, Linenoise NG [2]), so I've done the same.
> 
>  2 - https://github.com/arangodb/linenoise-ng
> 
> Initially, I added the Linenoise header to include/ and the source to
> src/, but the compiler warning flags used by upstream differ from those
> used by nftables, which meant that the compiler emitted warnings when
> compiling the Linenoise source and I had to edit it to fix them.

Could you silent these warnings via CFLAGS just like we do with
mini-gmp.{c,h}? We already cache a copy of mini-gmp.c in the tree,
this would follow the same approach, just the source under src/ and
the header in include/.

> Since they were benign and editing the source would make it more
> complicated to update from upstream in the future, I have, instead,
> chosen to put everything in a separate linenoise/ directory with its
> own Makefile.am and the same warning flags as upstream.
> 
> By default, the CLI continues to be build using Readline, but passing
> `with-cli=linenoise` instead causes Linenoise to be used instead.

Probably good if you can also update 'nft -v' to display that nft is
compiled with/without mini-gmp and also with either
libreadline/linenoise.

> The first two patches do a bit of tidying; the third patch adds the
> Linenoise sources; the last adds Linenoise support to the CLI.

No objections, please update tests/build/ to check for this new
./configure option.

Thanks.

  parent reply	other threads:[~2019-09-20 10:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26  6:55 Feature request: Add support for linenoise as alternative to readline Priebe, Sebastian
2019-09-16 12:41 ` [PATCH RFC nftables 0/4] Add Linenoise support to the CLI Jeremy Sowden
2019-09-16 12:42   ` [PATCH RFC nftables 1/4] configure: remove unused AC_SUBST macros Jeremy Sowden
2019-09-20 10:15     ` Pablo Neira Ayuso
2019-09-16 12:42   ` [PATCH RFC nftables 2/4] cli: remove unused declaration Jeremy Sowden
2019-09-20 10:15     ` Pablo Neira Ayuso
2019-09-16 12:42   ` [PATCH RFC nftables 3/4] cli: add upstream linenoise source Jeremy Sowden
2019-09-16 12:42   ` [PATCH RFC nftables 4/4] cli: add linenoise CLI implementation Jeremy Sowden
2019-09-20 10:19     ` Pablo Neira Ayuso
2019-09-21 11:11       ` Jeremy Sowden
2019-09-20 10:15   ` Pablo Neira Ayuso [this message]
2019-09-21 11:07     ` [PATCH RFC nftables 0/4] Add Linenoise support to the CLI Jeremy Sowden

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190920101520.kwwns3v7nma646bv@salvia \
    --to=pablo@netfilter.org \
    --cc=jeremy@azazel.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=sebastian.priebe@de.sii.group \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.