* [PATCH 0/4] various CentOS 7.x related fixes
@ 2023-09-24 21:08 Eric Wong
2023-09-24 21:08 ` [PATCH 1/4] test_common: force IPv4 with pre-IPv6 Net::POP3 Eric Wong
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Eric Wong @ 2023-09-24 21:08 UTC (permalink / raw)
To: meta
Still not sure how to best handle 3rd-party repos from
install/deps...
Eric Wong (4):
test_common: force IPv4 with pre-IPv6 Net::POP3
install/deps: fix RPM installation of some packages
lei: use scalar %SIG assignment
xap_helper.h: add missing headers and avoid reallocarray
install/deps.perl | 8 ++++++--
lib/PublicInbox/LEI.pm | 6 +++---
lib/PublicInbox/TestCommon.pm | 1 +
lib/PublicInbox/xap_helper.h | 7 +++++--
t/pop3d-limit.t | 2 +-
5 files changed, 16 insertions(+), 8 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/4] test_common: force IPv4 with pre-IPv6 Net::POP3
2023-09-24 21:08 [PATCH 0/4] various CentOS 7.x related fixes Eric Wong
@ 2023-09-24 21:08 ` Eric Wong
2023-09-24 21:08 ` [PATCH 2/4] install/deps: fix RPM installation of some packages Eric Wong
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2023-09-24 21:08 UTC (permalink / raw)
To: meta
This fixes t/pop3d-limit.t with the Net::POP3 shipped with Perl v5.16.3
on CentOS 7.x
---
lib/PublicInbox/TestCommon.pm | 1 +
t/pop3d-limit.t | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index 28edee9f..1fdb5ebd 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -129,6 +129,7 @@ my %IPv6_VERSION = (
'Net::NNTP' => 3.00,
'Mail::IMAPClient' => 3.40,
'HTTP::Tiny' => 0.042,
+ 'Net::POP3' => 2.32,
);
sub require_mods {
diff --git a/t/pop3d-limit.t b/t/pop3d-limit.t
index 39d2f918..00da477d 100644
--- a/t/pop3d-limit.t
+++ b/t/pop3d-limit.t
@@ -75,7 +75,7 @@ my $login_d = ('d'x32)."\@$group?limit=100000";
my $login_d0 = ('d'x32)."\@$group.0?limit=100000";
for my $login ($login_a, $login_a0) {
- my $np3 = Net::POP3->new(@np3args);
+ my $np3 = Net::POP3->new(@np3args) or xbail "Net::POP3 $!";
$np3->login($login, 'anonymous') or xbail "login $login ($!)";
my @msg = $fetch_delete->($np3);
$np3->quit;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/4] install/deps: fix RPM installation of some packages
2023-09-24 21:08 [PATCH 0/4] various CentOS 7.x related fixes Eric Wong
2023-09-24 21:08 ` [PATCH 1/4] test_common: force IPv4 with pre-IPv6 Net::POP3 Eric Wong
@ 2023-09-24 21:08 ` Eric Wong
2023-09-24 21:08 ` [PATCH 3/4] lei: use scalar %SIG assignment Eric Wong
2023-09-24 21:08 ` [PATCH 4/4] xap_helper.h: add missing headers and avoid reallocarray Eric Wong
3 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2023-09-24 21:08 UTC (permalink / raw)
To: meta
Not including 3rd-party repo-sourced packages, yet (e.g. git242
and xapian14-* stuff).
---
install/deps.perl | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/install/deps.perl b/install/deps.perl
index 65547f9d..3fed4f10 100755
--- a/install/deps.perl
+++ b/install/deps.perl
@@ -1,6 +1,7 @@
# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# Helper script for mass installing/uninstalling with the OS package manager
+# TODO: figure out how to handle 3rd-party repo packages for CentOS 7.x
eval 'exec perl -S $0 ${1+"$@"}' # no shebang
if 0; # running under some shell
use v5.12;
@@ -122,7 +123,7 @@ $profiles->{'watch-maildir'} = [ @{$profiles->{v2essential}} ];
# package names which can't be mapped automatically and explicit
# dependencies to prevent essential package removal:
-my $non_auto = { # git and perl are essential
+my $non_auto = { # git and perl (+autodie) are essential
git => {
pkg => [ qw(curl p5-TimeDate git) ],
rpm => [ qw(curl git) ],
@@ -153,7 +154,7 @@ my $non_auto = { # git and perl are essential
deb => 'libsearch-xapian-perl',
pkg => 'p5-Xapian',
pkg_add => 'xapian-bindings-perl',
- rpm => 'Search::Xapian', # 3rd-party repo
+ rpm => [], # xapian14-bindings-perl in 3rd-party repo
},
'highlight.pm' => {
deb => 'libhighlight-perl',
@@ -219,11 +220,14 @@ for (qw(autodie Digest::SHA ExtUtils::MakeMaker IO::Compress Sys::Syslog
# qw(constant Encode Getopt::Long Exporter Storable Time::HiRes)
# don't need to be here since it's impossible to have `perl'
# on CentOS 7.x without them.
+ my $rpm = $_;
+ $rpm =~ s/::/-/g;
$non_auto->{$_} = {
deb => 'perl', # libperl5.XX, but the XX varies
pkg => 'perl5',
pkg_add => [], # perl is in the OpenBSD base system
pkgin => 'perl',
+ rpm => "perl-$rpm",
};
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/4] lei: use scalar %SIG assignment
2023-09-24 21:08 [PATCH 0/4] various CentOS 7.x related fixes Eric Wong
2023-09-24 21:08 ` [PATCH 1/4] test_common: force IPv4 with pre-IPv6 Net::POP3 Eric Wong
2023-09-24 21:08 ` [PATCH 2/4] install/deps: fix RPM installation of some packages Eric Wong
@ 2023-09-24 21:08 ` Eric Wong
2023-09-24 21:08 ` [PATCH 4/4] xap_helper.h: add missing headers and avoid reallocarray Eric Wong
3 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2023-09-24 21:08 UTC (permalink / raw)
To: meta
Perl v5.16.3 (and possibly some later versions) complain about
this, but newer (v5.32.1) are fine with it.
Fixes: e281363ba937 ("lei: ensure we run DESTROY|END at daemon exit w/ kqueue")
---
lib/PublicInbox/LEI.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 1ead9bf6..be77fa90 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -1381,9 +1381,9 @@ sub lazy_start {
PublicInbox::DS::sig_setmask($oldset) if @kq_ign;
# exit() may trigger waitpid via various DESTROY, ensure interruptible
- local @SIG{TERM} = sub { exit(POSIX::SIGTERM + 128) };
- local @SIG{INT} = sub { exit(POSIX::SIGINT + 128) };
- local @SIG{QUIT} = sub { exit(POSIX::SIGQUIT + 128) };
+ local $SIG{TERM} = sub { exit(POSIX::SIGTERM + 128) };
+ local $SIG{INT} = sub { exit(POSIX::SIGINT + 128) };
+ local $SIG{QUIT} = sub { exit(POSIX::SIGQUIT + 128) };
PublicInbox::DS::sig_setmask($oldset) if !@kq_ign;
dump_and_clear_log();
exit($exit_code // 0);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 4/4] xap_helper.h: add missing headers and avoid reallocarray
2023-09-24 21:08 [PATCH 0/4] various CentOS 7.x related fixes Eric Wong
` (2 preceding siblings ...)
2023-09-24 21:08 ` [PATCH 3/4] lei: use scalar %SIG assignment Eric Wong
@ 2023-09-24 21:08 ` Eric Wong
3 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2023-09-24 21:08 UTC (permalink / raw)
To: meta
These changes are necessary with glibc 2.17 and g++ 4.8.5
on CentOS 7.x. We don't have to worry about overflow with
realloc(3) here since WORKER_MAX is only USHRT_MAX and
sizeof(pid_t) is 4 bytes on every platform I've encountered.
---
lib/PublicInbox/xap_helper.h | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/xap_helper.h b/lib/PublicInbox/xap_helper.h
index 377ff45a..5f04316c 100644
--- a/lib/PublicInbox/xap_helper.h
+++ b/lib/PublicInbox/xap_helper.h
@@ -35,7 +35,10 @@
#include <limits.h>
#include <search.h>
#include <signal.h>
+#include <stddef.h>
+#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <sysexits.h>
#include <unistd.h>
@@ -1084,9 +1087,9 @@ static void do_sigttin(void)
warnx("workers cannot exceed %zu", (size_t)WORKER_MAX);
return;
}
- void *p = reallocarray(worker_pids, nworker + 1, sizeof(pid_t));
+ void *p = realloc(worker_pids, (nworker + 1) * sizeof(pid_t));
if (!p) {
- warn("reallocarray");
+ warn("realloc worker_pids");
} else {
worker_pids = (pid_t *)p;
worker_pids[nworker++] = 0;
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-09-24 21:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-24 21:08 [PATCH 0/4] various CentOS 7.x related fixes Eric Wong
2023-09-24 21:08 ` [PATCH 1/4] test_common: force IPv4 with pre-IPv6 Net::POP3 Eric Wong
2023-09-24 21:08 ` [PATCH 2/4] install/deps: fix RPM installation of some packages Eric Wong
2023-09-24 21:08 ` [PATCH 3/4] lei: use scalar %SIG assignment Eric Wong
2023-09-24 21:08 ` [PATCH 4/4] xap_helper.h: add missing headers and avoid reallocarray Eric Wong
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).