* Re: [RFT] syscall: set default constants for Inline::C platforms
2024-04-08 12:12 7% ` Gaelan Steele
@ 2024-04-08 20:11 13% ` Eric Wong
0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2024-04-08 20:11 UTC (permalink / raw)
To: Gaelan Steele; +Cc: meta
Gaelan Steele <gbs@canishe.com> wrote:
>
> > On Apr 8, 2024, at 10:48 AM, Eric Wong <e@80x24.org> wrote:
> >
> >> I’m not enough of a Perl person to fully untangle this. As
> >> best I can tell, the intent is that non-Linux/BSD OSes should
> >> still work with Inline::C, but this doesn’t work in practice
> >> due to a bug?
> >
> > Right. Patch below should fix it, test feedback appreciated.
>
> From a quick test, it seems to work: public-inbox-httpd starts
> and is happy to serve up an archive.
>
> Thanks for the quick fix!
No problem, thanks for the report and test.
> Ah, that’s the wrong email address. (My fault! My mail client
> has an unfortunate default I haven’t figured out how to change,
> and I forgot to set it before sending this time.) Would it be
> possible to use this one (gbs@canishe.com <mailto:gbs@canishe.com>) instead?
Sure, pushed as commit 832556492d3b94f9cadf9a4d249b519f30bae64d
with updated commit message:
syscall: set default constants for Inline::C platforms
This fixes compile errors on platforms we can't explicitly
support from pure Perl due to the lack of syscall stability
guarantees by the OS developers.
Reported-by: Gaelan Steele <gbs@canishe.com>
Tested-by: Gaelan Steele <gbs@canishe.com>
^ permalink raw reply [relevance 13%]
* Re: [RFT] syscall: set default constants for Inline::C platforms
2024-04-08 9:48 14% ` [RFT] syscall: set default constants for Inline::C platforms Eric Wong
@ 2024-04-08 12:12 7% ` Gaelan Steele
2024-04-08 20:11 13% ` Eric Wong
0 siblings, 1 reply; 3+ results
From: Gaelan Steele @ 2024-04-08 12:12 UTC (permalink / raw)
To: Eric Wong; +Cc: meta
> On Apr 8, 2024, at 10:48 AM, Eric Wong <e@80x24.org> wrote:
>
>> I’m not enough of a Perl person to fully untangle this. As
>> best I can tell, the intent is that non-Linux/BSD OSes should
>> still work with Inline::C, but this doesn’t work in practice
>> due to a bug?
>
> Right. Patch below should fix it, test feedback appreciated.
From a quick test, it seems to work: public-inbox-httpd starts
and is happy to serve up an archive.
Thanks for the quick fix!
>> It may also be possible to use the BSD approach on Darwin -
>> Darwin ascribes to the BSD school of thought where libc is the
>> only Officially Stable interface, but if you can get away with
>> it on the real BSDs maybe you can get away with it on fake BSD
>> too.
>
> NetBSD and FreeBSD both document the underlying syscall numbers
> remain stable (but not the name => number mapping). OpenBSD has
> no stable numbering, but goes as far as to patch Perl to route
> the `syscall' perlop through their libc to avoid breaking Perl
> scripts.
>
> I have no idea if Darwin maintains any stability guarantees at
> all like the above OSes, so Inline::C may be safer, here.
Indeed, Apple explicitly doesn’t make such a guarantee:
https://developer.apple.com/forums/thread/706419
So Inline::C is definitely the move.
> -------8<-------
> Subject: [PATCH] syscall: set default constants for Inline::C platforms
>
> This ought to fix compile errors on platforms we don't
> explicitly support.
>
> Reported-by: Gaelan Steele <gaelans@icloud.com>
Ah, that’s the wrong email address. (My fault! My mail client
has an unfortunate default I haven’t figured out how to change,
and I forgot to set it before sending this time.) Would it be
possible to use this one (gbs@canishe.com <mailto:gbs@canishe.com>) instead?
Best wishes,
Gaelan
^ permalink raw reply [relevance 7%]
* [RFT] syscall: set default constants for Inline::C platforms
@ 2024-04-08 9:48 14% ` Eric Wong
2024-04-08 12:12 7% ` Gaelan Steele
0 siblings, 1 reply; 3+ results
From: Eric Wong @ 2024-04-08 9:48 UTC (permalink / raw)
To: Gaelan Steele; +Cc: meta
Gaelan Steele <gaelans@icloud.com> wrote:
> Unfortunately this patch broke public-inbox on Darwin:
>
> Bareword "SIZEOF_cmsghdr" not allowed while "strict subs" in use at /tmp/public-inbox/lib/PublicInbox/Syscall.pm line 456.
> BEGIN not safe after errors--compilation aborted at /tmp/public-inbox/lib/PublicInbox/Syscall.pm line 460.
> Compilation failed in require at /tmp/public-inbox/lib/PublicInbox/DS.pm line 31.
> BEGIN failed--compilation aborted at /tmp/public-inbox/lib/PublicInbox/DS.pm line 32.
> Compilation failed in require at /tmp/public-inbox/lib/PublicInbox/Daemon.pm line 17.
> BEGIN failed--compilation aborted at /tmp/public-inbox/lib/PublicInbox/Daemon.pm line 17.
> Compilation failed in require at /tmp/public-inbox/script/public-inbox-httpd line 7.
> BEGIN failed--compilation aborted at /tmp/public-inbox/script/public-inbox-httpd line 7.
>
> I’m not enough of a Perl person to fully untangle this. As
> best I can tell, the intent is that non-Linux/BSD OSes should
> still work with Inline::C, but this doesn’t work in practice
> due to a bug?
Right. Patch below should fix it, test feedback appreciated.
> It may also be possible to use the BSD approach on Darwin -
> Darwin ascribes to the BSD school of thought where libc is the
> only Officially Stable interface, but if you can get away with
> it on the real BSDs maybe you can get away with it on fake BSD
> too.
NetBSD and FreeBSD both document the underlying syscall numbers
remain stable (but not the name => number mapping). OpenBSD has
no stable numbering, but goes as far as to patch Perl to route
the `syscall' perlop through their libc to avoid breaking Perl
scripts.
I have no idea if Darwin maintains any stability guarantees at
all like the above OSes, so Inline::C may be safer, here.
-------8<-------
Subject: [PATCH] syscall: set default constants for Inline::C platforms
This ought to fix compile errors on platforms we don't
explicitly support.
Reported-by: Gaelan Steele <gaelans@icloud.com>
---
lib/PublicInbox/Syscall.pm | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/PublicInbox/Syscall.pm b/lib/PublicInbox/Syscall.pm
index 829cfa3c..99af5bf5 100644
--- a/lib/PublicInbox/Syscall.pm
+++ b/lib/PublicInbox/Syscall.pm
@@ -317,6 +317,10 @@ BEGIN {
)
}
$PACK{CMSG_ALIGN_size} = SIZEOF_size_t;
+ $PACK{SIZEOF_cmsghdr} //= 0;
+ $PACK{TMPL_cmsg_len} //= undef;
+ $PACK{CMSG_DATA_off} //= undef;
+ $PACK{TMPL_msghdr} //= undef;
}
# SFD_CLOEXEC is arch-dependent, so IN_CLOEXEC may be, too
^ permalink raw reply related [relevance 14%]
Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2024-01-29 21:23 [PATCH 0/2] pure Perl sendmsg/recvmsg on *BSD Eric Wong
2024-01-29 21:23 ` [PATCH 2/2] syscall: use " Eric Wong
2024-04-06 0:43 ` Gaelan Steele
2024-04-08 9:48 14% ` [RFT] syscall: set default constants for Inline::C platforms Eric Wong
2024-04-08 12:12 7% ` Gaelan Steele
2024-04-08 20:11 13% ` Eric Wong
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).