user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* Re: [PATCH v2] Clarify Inline::C dependency (optional on Linux, required elsewhere)
  @ 2023-09-02 20:45  6%                     ` Štěpán Němec
  0 siblings, 0 replies; 5+ results
From: Štěpán Němec @ 2023-09-02 20:45 UTC (permalink / raw)
  To: Eric Wong; +Cc: meta

On Sat, 02 Sep 2023 19:44:07 +0000
Eric Wong wrote:

> Perhaps the per-module "optional, for .." statements should be
> "only for ...".

Well, if that's really true (i.e., they're not needed/useful for
anything else)...

I guess you see INSTALL as mainly for public-inbox without lei (and
indeed the first sentence is "This is for folks who want to set up their
own public-inbox instance."), so from that perspective saying "optional"
about something that is optional for public-inbox but required for lei
makes sense, but lei is then mentioned repeatedly in the dependencies
section, and it seems a safe bet there are much more people using lei
than there are people setting up public-inbox instances, so I'm not sure
maintaining that perspective in INSTALL is the best way to help those
users.

Then again, maybe it's just in my head and I might as well let such
users speak for themselves if they exist and ever wish to do so.

So here's just a reroll with your suggestions implemented:

-- 8< --
Subject: [PATCH v3] Clarify Inline::C dependency (optional on Linux, required
 elsewhere)

Link: https://public-inbox.org/meta/20230901110903.M876537@dcvr/
Link: https://public-inbox.org/meta/20230902194407.M464597@dcvr/
Fixes: 88c7c7c26b44 ("lei: wire up pure Perl sendmsg/recvmsg for Linux users")
Fixes: acefd91b302d ("syscall: implement sendmsg+recvmsg in pure Perl")
---
changes since v2:
- add another Link: to the parent of this message
- don't change "optional" to "other", focus is on public-inbox
- don't repeat "optional" in individual module items, say "only for"

 Documentation/lei-overview.pod | 12 +++++++-----
 INSTALL                        | 11 ++++++-----
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/Documentation/lei-overview.pod b/Documentation/lei-overview.pod
index 7095b504cdb8..e9a97d64fb56 100644
--- a/Documentation/lei-overview.pod
+++ b/Documentation/lei-overview.pod
@@ -119,11 +119,13 @@ code repository.
 
 =head1 PERFORMANCE NOTES
 
-L<Inline::C> is required, lei runs as a background daemon to reduce
-startup costs and can provide real-time L<kqueue(2)>/L<inotify(7)>
-Maildir monitoring.  L<IO::KQueue> (p5-IO-KQueue on FreeBSD) and
-L<Linux::Inotify2> (liblinux-inotify2-perl and perl-Linux-Inotify2 in
-.deb and .rpm-based distros, respectively) are recommended.
+L<Inline::C> is required on BSDs and can speed things up on Linux.
+
+lei runs as a background daemon to reduce startup costs and can
+provide real-time L<kqueue(2)>/L<inotify(7)> Maildir monitoring.
+L<IO::KQueue> (p5-IO-KQueue on FreeBSD) and L<Linux::Inotify2>
+(liblinux-inotify2-perl and perl-Linux-Inotify2 in .deb and .rpm-based
+distros, respectively) are recommended.
 
 L<Socket::MsgHdr> is optional (libsocket-msghdr-perl in Debian),
 and further improves startup performance.  Its effect is most felt
diff --git a/INSTALL b/INSTALL
index 5f080f2889ce..2e1c7ef7bb0a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -76,7 +76,8 @@ Numerous optional modules are likely to be useful as well:
 - Inline::C                        deb: libinline-c-perl
                                    pkg: p5-Inline-C
                                    rpm: perl-Inline (or perl-Inline-C)
-                                   (speeds up process spawning on Linux,
+                                   (required for lei on *BSD;
+                                    speeds up process spawning on Linux,
                                     see public-inbox-daemon(8))
 
 - Email::Address::XS               deb: libemail-address-xs-perl
@@ -88,17 +89,17 @@ Numerous optional modules are likely to be useful as well:
 - Parse::RecDescent                deb: libparse-recdescent-perl
                                    pkg: p5-Parse-RecDescent
                                    rpm: perl-ParseRecDescent
-                                   (optional, for public-inbox-imapd(1))
+                                   (only for public-inbox-imapd(1))
 
 - Mail::IMAPClient                 deb: libmail-imapclient-perl
                                    pkg: p5-Mail-IMAPClient
                                    rpm: perl-Mail-IMAPClient
-                                   (optional for lei and public-inbox-watch)
+                                   (only for lei and public-inbox-watch)
 
 - BSD::Resource                    deb: libbsd-resource-perl
                                    pkg: p5-BSD-Resource
                                    rpm: perl-BSD-Resource
-                                   (optional, for PSGI limiters
+                                   (only for PSGI limiters,
                                     see public-inbox-config(5))
 
 - Plack::Middleware::ReverseProxy  deb: libplack-middleware-reverseproxy-perl
@@ -113,7 +114,7 @@ Numerous optional modules are likely to be useful as well:
 * xapian-compact (tool)            deb: xapian-tools
                                    pkg: xapian-core
                                    rpm: xapian-core
-                                   (optional, for public-inbox-compact(1))
+                                   (only for public-inbox-compact(1))
 
 * curl (tool)                      deb, pkg, rpm: curl
                                    (for HTTP(S) externals with curl)

-- 
2.42.0

^ permalink raw reply related	[relevance 6%]

* [PATCH v2] Clarify Inline::C dependency (optional on Linux, required elsewhere)
  2023-09-02 10:54  6%           ` Štěpán Němec
@ 2023-09-02 11:07  6%             ` Štěpán Němec
    0 siblings, 1 reply; 5+ results
From: Štěpán Němec @ 2023-09-02 11:07 UTC (permalink / raw)
  To: Eric Wong; +Cc: meta


Link: https://public-inbox.org/meta/20230901110903.M876537@dcvr/
Fixes: 88c7c7c26b44 ("lei: wire up pure Perl sendmsg/recvmsg for Linux users")
Fixes: acefd91b302d ("syscall: implement sendmsg+recvmsg in pure Perl")
---
v2: expand tabs, sorry about that...

 Documentation/lei-overview.pod | 12 +++++++-----
 INSTALL                        |  7 ++++---
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/Documentation/lei-overview.pod b/Documentation/lei-overview.pod
index 7095b504cdb8..e9a97d64fb56 100644
--- a/Documentation/lei-overview.pod
+++ b/Documentation/lei-overview.pod
@@ -119,11 +119,13 @@ code repository.
 
 =head1 PERFORMANCE NOTES
 
-L<Inline::C> is required, lei runs as a background daemon to reduce
-startup costs and can provide real-time L<kqueue(2)>/L<inotify(7)>
-Maildir monitoring.  L<IO::KQueue> (p5-IO-KQueue on FreeBSD) and
-L<Linux::Inotify2> (liblinux-inotify2-perl and perl-Linux-Inotify2 in
-.deb and .rpm-based distros, respectively) are recommended.
+L<Inline::C> is required on BSDs and can speed things up on Linux.
+
+lei runs as a background daemon to reduce startup costs and can
+provide real-time L<kqueue(2)>/L<inotify(7)> Maildir monitoring.
+L<IO::KQueue> (p5-IO-KQueue on FreeBSD) and L<Linux::Inotify2>
+(liblinux-inotify2-perl and perl-Linux-Inotify2 in .deb and .rpm-based
+distros, respectively) are recommended.
 
 L<Socket::MsgHdr> is optional (libsocket-msghdr-perl in Debian),
 and further improves startup performance.  Its effect is most felt
diff --git a/INSTALL b/INSTALL
index 5f080f2889ce..8f08a11f7ee1 100644
--- a/INSTALL
+++ b/INSTALL
@@ -60,7 +60,7 @@ Where "deb" indicates package names for Debian-derived distributions,
 "pkg" is for the FreeBSD package (maybe other common BSDs, too), and
 "rpm" is for RPM-based distributions (only known to work on Fedora).
 
-Numerous optional modules are likely to be useful as well:
+Numerous other modules are likely to be useful as well:
 
 - DBD::SQLite                      deb: libdbd-sqlite3-perl
                                    pkg: p5-DBD-SQLite
@@ -76,8 +76,9 @@ Numerous optional modules are likely to be useful as well:
 - Inline::C                        deb: libinline-c-perl
                                    pkg: p5-Inline-C
                                    rpm: perl-Inline (or perl-Inline-C)
-                                   (speeds up process spawning on Linux,
-                                    see public-inbox-daemon(8))
+                                   (required for lei on *BSD; speeds up process
+                                    spawning on Linux, see
+                                    public-inbox-daemon(8))
 
 - Email::Address::XS               deb: libemail-address-xs-perl
                                    pkg: p5-Email-Address-XS

-- 
2.42.0


^ permalink raw reply related	[relevance 6%]

* Re: [PATCH 0/7] various build fixes + OpenBSD compat, [PATCH 7/7] xap_helper.h: fix double-free on OpenBSD hdestroy
  @ 2023-09-02 10:54  6%           ` Štěpán Němec
  2023-09-02 11:07  6%             ` [PATCH v2] Clarify Inline::C dependency (optional on Linux, required elsewhere) Štěpán Němec
  0 siblings, 1 reply; 5+ results
From: Štěpán Němec @ 2023-09-02 10:54 UTC (permalink / raw)
  To: Eric Wong; +Cc: meta

On Fri, 01 Sep 2023 11:09:03 +0000
Eric Wong wrote:

> Štěpán Němec <stepnem@smrk.net> wrote:
>> Ah, I see now that PERFORMANCE NOTES in lei-overview.pod says Inline::C
>> is required, so perhaps just some adjustments to the test
>> skipping/diagnostics and INSTALL instructions (which say Inline::C is
>> optional) would be helpful?
>
> Actually, Inline::C is only needed for lei on *BSDs nowadays.
> Common/available-on-cfarm Linux arches can rely on stable
> syscall numbers to do FD passing.

I see, thanks.  How about this then:

-- >8 --
Subject: [PATCH] Clarify Inline::C dependency (optional on Linux, required
 elsewhere)

Link: https://public-inbox.org/meta/20230901110903.M876537@dcvr/
Fixes: 88c7c7c26b44 ("lei: wire up pure Perl sendmsg/recvmsg for Linux users")
Fixes: acefd91b302d ("syscall: implement sendmsg+recvmsg in pure Perl")
---
 Documentation/lei-overview.pod | 12 +++++++-----
 INSTALL                        |  7 ++++---
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/Documentation/lei-overview.pod b/Documentation/lei-overview.pod
index 7095b504cdb8..e9a97d64fb56 100644
--- a/Documentation/lei-overview.pod
+++ b/Documentation/lei-overview.pod
@@ -119,11 +119,13 @@ code repository.
 
 =head1 PERFORMANCE NOTES
 
-L<Inline::C> is required, lei runs as a background daemon to reduce
-startup costs and can provide real-time L<kqueue(2)>/L<inotify(7)>
-Maildir monitoring.  L<IO::KQueue> (p5-IO-KQueue on FreeBSD) and
-L<Linux::Inotify2> (liblinux-inotify2-perl and perl-Linux-Inotify2 in
-.deb and .rpm-based distros, respectively) are recommended.
+L<Inline::C> is required on BSDs and can speed things up on Linux.
+
+lei runs as a background daemon to reduce startup costs and can
+provide real-time L<kqueue(2)>/L<inotify(7)> Maildir monitoring.
+L<IO::KQueue> (p5-IO-KQueue on FreeBSD) and L<Linux::Inotify2>
+(liblinux-inotify2-perl and perl-Linux-Inotify2 in .deb and .rpm-based
+distros, respectively) are recommended.
 
 L<Socket::MsgHdr> is optional (libsocket-msghdr-perl in Debian),
 and further improves startup performance.  Its effect is most felt
diff --git a/INSTALL b/INSTALL
index 5f080f2889ce..e8d686d8f21b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -60,7 +60,7 @@ Where "deb" indicates package names for Debian-derived distributions,
 "pkg" is for the FreeBSD package (maybe other common BSDs, too), and
 "rpm" is for RPM-based distributions (only known to work on Fedora).
 
-Numerous optional modules are likely to be useful as well:
+Numerous other modules are likely to be useful as well:
 
 - DBD::SQLite                      deb: libdbd-sqlite3-perl
                                    pkg: p5-DBD-SQLite
@@ -76,8 +76,9 @@ Numerous optional modules are likely to be useful as well:
 - Inline::C                        deb: libinline-c-perl
                                    pkg: p5-Inline-C
                                    rpm: perl-Inline (or perl-Inline-C)
-                                   (speeds up process spawning on Linux,
-                                    see public-inbox-daemon(8))
+                                   (required for lei on *BSD; speeds up process
+				    spawning on Linux, see
+				    public-inbox-daemon(8))
 
 - Email::Address::XS               deb: libemail-address-xs-perl
                                    pkg: p5-Email-Address-XS

-- 
2.42.0


^ permalink raw reply related	[relevance 6%]

* [PATCH 0/4] lei: finish wiring up pure-Perl stuff for Linux
@ 2022-04-18  9:50  7% Eric Wong
  2022-04-18  9:50  6% ` [PATCH 3/4] lei: wire up pure Perl sendmsg/recvmsg for Linux users Eric Wong
  0 siblings, 1 reply; 5+ results
From: Eric Wong @ 2022-04-18  9:50 UTC (permalink / raw)
  To: meta

Some cleanups here, too; but this hopefully makes lei more
accessible to users who don't have space/bandwidth to use
Inline::C.

I thought I sent these out weeks ago, but Real-Life, power outages
and other lei problems got in the way, I guess :x

Eric Wong (4):
  lei: clobber recvmsg buffer on errors
  syscall: more idiomatic cmsghdr space allocation
  lei: wire up pure Perl sendmsg/recvmsg for Linux users
  syscall: golf + more idiomatic buffer initialization

 lib/PublicInbox/IPC.pm           |  4 ++++
 lib/PublicInbox/LEI.pm           |  4 ++++
 lib/PublicInbox/LeiSelfSocket.pm |  1 +
 lib/PublicInbox/Syscall.pm       | 13 ++++++-------
 lib/PublicInbox/TestCommon.pm    | 16 ++++++++++++----
 t/lei-daemon.t                   |  6 +++++-
 t/lei-externals.t                |  1 +
 7 files changed, 33 insertions(+), 12 deletions(-)

^ permalink raw reply	[relevance 7%]

* [PATCH 3/4] lei: wire up pure Perl sendmsg/recvmsg for Linux users
  2022-04-18  9:50  7% [PATCH 0/4] lei: finish wiring up pure-Perl stuff for Linux Eric Wong
@ 2022-04-18  9:50  6% ` Eric Wong
  0 siblings, 0 replies; 5+ results
From: Eric Wong @ 2022-04-18  9:50 UTC (permalink / raw)
  To: meta

This enables lei-daemon to work without Inline::C nor
Socket::MsgHdr installed.  Prior to this, only the `lei' client
was using the pure Perl implementation.  Either C implementation
is still marginally faster, however.
---
 lib/PublicInbox/IPC.pm        |  4 ++++
 lib/PublicInbox/LEI.pm        |  3 +++
 lib/PublicInbox/TestCommon.pm | 16 ++++++++++++----
 t/lei-daemon.t                |  6 +++++-
 t/lei-externals.t             |  1 +
 5 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/IPC.pm b/lib/PublicInbox/IPC.pm
index 8376275e..67e86a43 100644
--- a/lib/PublicInbox/IPC.pm
+++ b/lib/PublicInbox/IPC.pm
@@ -47,6 +47,10 @@ my $send_cmd = PublicInbox::Spawn->can('send_cmd4') // do {
 	require PublicInbox::CmdIPC4;
 	$recv_cmd //= PublicInbox::CmdIPC4->can('recv_cmd4');
 	PublicInbox::CmdIPC4->can('send_cmd4');
+} // do {
+	require PublicInbox::Syscall;
+	$recv_cmd //= PublicInbox::Syscall->can('recv_cmd4');
+	PublicInbox::Syscall->can('send_cmd4');
 };
 
 sub _get_rec ($) {
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 9ab91714..4bd9183e 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -1277,6 +1277,9 @@ sub lazy_start {
 			require PublicInbox::CmdIPC4;
 			$send_cmd = PublicInbox::CmdIPC4->can('send_cmd4');
 			PublicInbox::CmdIPC4->can('recv_cmd4');
+		} // do {
+			$send_cmd = PublicInbox::Syscall->can('send_cmd4');
+			PublicInbox::Syscall->can('recv_cmd4');
 		};
 	}
 	$recv_cmd or die <<"";
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index ca732811..943dd2fa 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # internal APIs used only for tests
@@ -19,7 +19,8 @@ BEGIN {
 		run_script start_script key2sub xsys xsys_e xqx eml_load tick
 		have_xapian_compact json_utf8 setup_public_inboxes create_inbox
 		tcp_host_port test_lei lei lei_ok $lei_out $lei_err $lei_opt
-		test_httpd xbail require_cmd is_xdeeply tail_f);
+		test_httpd xbail require_cmd is_xdeeply tail_f
+		ignore_inline_c_missing);
 	require Test::More;
 	my @methods = grep(!/\W/, @Test::More::EXPORT);
 	eval(join('', map { "*$_=\\&Test::More::$_;" } @methods));
@@ -547,6 +548,11 @@ sub is_xdeeply ($$$) {
 	$ok;
 }
 
+sub ignore_inline_c_missing {
+	$_[0] = join('', grep(/\S/, grep(!/compilation aborted/,
+		grep(!/\bInline\b/, split(/^/m, $_[0])))));
+}
+
 sub test_lei {
 SKIP: {
 	my ($cb) = pop @_;
@@ -571,8 +577,10 @@ SKIP: {
 	$ENV{LANG} = $ENV{LC_ALL} = 'C';
 	my (undef, $fn, $lineno) = caller(0);
 	my $t = "$fn:$lineno";
-	state $lei_daemon = PublicInbox::Spawn->can('send_cmd4') ||
-				eval { require Socket::MsgHdr; 1 };
+	state $lei_daemon = PublicInbox::Spawn->can('send_cmd4') || do {
+			require PublicInbox::Syscall;
+			PublicInbox::Syscall->can('send_cmd4');
+		} || eval { require Socket::MsgHdr; 1 };
 	unless ($lei_daemon) {
 		skip('Inline::C unconfigured/missing '.
 '(mkdir -p ~/.cache/public-inbox/inline-c) OR Socket::MsgHdr missing',
diff --git a/t/lei-daemon.t b/t/lei-daemon.t
index b60c7ce6..e11105bc 100644
--- a/t/lei-daemon.t
+++ b/t/lei-daemon.t
@@ -1,5 +1,5 @@
 #!perl -w
-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict; use v5.10.1; use PublicInbox::TestCommon;
 use Socket qw(AF_UNIX SOCK_SEQPACKET MSG_EOR pack_sockaddr_un);
@@ -8,12 +8,16 @@ test_lei({ daemon_only => 1 }, sub {
 	my $send_cmd = PublicInbox::Spawn->can('send_cmd4') // do {
 		require PublicInbox::CmdIPC4;
 		PublicInbox::CmdIPC4->can('send_cmd4');
+	} // do {
+		require PublicInbox::Syscall;
+		PublicInbox::Syscall->can('send_cmd4');
 	};
 	$send_cmd or BAIL_OUT 'started testing lei-daemon w/o send_cmd4!';
 
 	my $sock = "$ENV{XDG_RUNTIME_DIR}/lei/5.seq.sock";
 	my $err_log = "$ENV{XDG_RUNTIME_DIR}/lei/errors.log";
 	lei_ok('daemon-pid');
+	ignore_inline_c_missing($lei_err);
 	is($lei_err, '', 'no error from daemon-pid');
 	like($lei_out, qr/\A[0-9]+\n\z/s, 'pid returned') or BAIL_OUT;
 	chomp(my $pid = $lei_out);
diff --git a/t/lei-externals.t b/t/lei-externals.t
index fed57789..284be1b9 100644
--- a/t/lei-externals.t
+++ b/t/lei-externals.t
@@ -76,6 +76,7 @@ test_lei(sub {
 	my $config_file = "$home/.config/lei/config";
 	my $store_dir = "$home/.local/share/lei";
 	lei_ok 'ls-external', \'ls-external on fresh install';
+	ignore_inline_c_missing($lei_err);
 	is($lei_out.$lei_err, '', 'ls-external no output, yet');
 	ok(!-e $config_file && !-e $store_dir,
 		'nothing created by ls-external');

^ permalink raw reply related	[relevance 6%]

Results 1-5 of 5 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-04-18  9:50  7% [PATCH 0/4] lei: finish wiring up pure-Perl stuff for Linux Eric Wong
2022-04-18  9:50  6% ` [PATCH 3/4] lei: wire up pure Perl sendmsg/recvmsg for Linux users Eric Wong
2023-08-30  5:10     [PATCH 0/7] various build fixes + OpenBSD compat Eric Wong
2023-08-30 12:34     ` [PATCH 0/7] various build fixes + OpenBSD compat, [PATCH 7/7] xap_helper.h: fix double-free on OpenBSD hdestroy Štěpán Němec
2023-08-30 21:18       ` Eric Wong
2023-08-31  9:11         ` Štěpán Němec
2023-08-31 17:26           ` Štěpán Němec
2023-09-01 11:09             ` Eric Wong
2023-09-02 10:54  6%           ` Štěpán Němec
2023-09-02 11:07  6%             ` [PATCH v2] Clarify Inline::C dependency (optional on Linux, required elsewhere) Štěpán Němec
2023-09-02 18:50                   ` Eric Wong
2023-09-02 19:08                     ` Štěpán Němec
2023-09-02 19:44                       ` Eric Wong
2023-09-02 20:45  6%                     ` Štěpán Němec

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).