You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Declare sethostname in socketmodule.c for SOLARIS #78469
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2018-07-31.07:32:32.085>labels= ['build', '3.7']
title='Declare sethostname in socketmodule.c for SOLARIS'updated_at=<Date2019-05-15.15:53:46.806>user='https://github.com/r-bit-rry'
This error only appears in 3.7 since a new CFLAG was turned on -Werror=no-implicit-declaration. and during build time it fails on sethostname function, not build _socket.
On Solaris 10 i386 I successfully built _socket on 3.7.3 by patching *in* a Solaris test (by cloning the test for the INET_ADDRSTRLEN definition currently on line 268) rather than by patching away the _AIX ifdef
$ diff -u ../socketmodule.c Modules/socketmodule.c
--- ../socketmodule.c Wed May 15 16:36:32 2019
+++ Modules/socketmodule.c Wed May 15 15:34:50 2019
@@ -5212,6 +5212,10 @@
extern int sethostname(const char *, size_t);#endif
Hi, since this is reported in Solaris 10 (which is before Solaris was first opened, so only Sun/Oracle is affected here), I had to dive into history a little bit.
gethostname is available in Solaris 10 header files (at least in reasonably recent one), so no problem there.
sethostname is indeed missing from Solaris 10 headers (and wasn't even available in Solaris 11 since the beginning illumos/illumos-gate@eec1faa - though that was fixed 17 years ago so we don't have to worry about that...)
I don't think it's a secret that we don't plan to release any new official Python 3.x package for Solaris 10 (which is in the extended support stage intended for critical fixes only), so this is not relevant to us. But that also means that those still using it might want to build newer Python for it themselves.
What's unfortunate is that simply adding the definition would cause at least redefinition warnings on current Solaris.
Activity
r-bit-rry commentedon Jul 31, 2018
This error only appears in 3.7 since a new CFLAG was turned on -Werror=no-implicit-declaration. and during build time it fails on sethostname function, not build _socket.
johngh commentedon May 15, 2019
On Solaris 10 i386 I successfully built _socket on 3.7.3 by patching *in* a Solaris test (by cloning the test for the INET_ADDRSTRLEN definition currently on line 268) rather than by patching away the _AIX ifdef
vstinner commentedon Sep 7, 2023
@kulikjak: In PR #108817 we did the opposite, remove
gethostname()prototype. Is this issue aboutsethostname()still relevant in 2023 on Solaris?kulikjak commentedon Sep 14, 2023
Hi, since this is reported in Solaris 10 (which is before Solaris was first opened, so only Sun/Oracle is affected here), I had to dive into history a little bit.
gethostnameis available in Solaris 10 header files (at least in reasonably recent one), so no problem there.sethostnameis indeed missing from Solaris 10 headers (and wasn't even available in Solaris 11 since the beginning illumos/illumos-gate@eec1faa - though that was fixed 17 years ago so we don't have to worry about that...)I don't think it's a secret that we don't plan to release any new official Python 3.x package for Solaris 10 (which is in the extended support stage intended for critical fixes only), so this is not relevant to us. But that also means that those still using it might want to build newer Python for it themselves.
What's unfortunate is that simply adding the definition would cause at least redefinition warnings on current Solaris.
vstinner commentedon Sep 14, 2023
Can't you test the Solaris version in the preprocessor (#ifdef)? Feel free to propose a PR.
kulikjak commentedon Sep 14, 2023
Developer Studio compiler provides handy macros like
__SunOS_5_10, but sadly, GCC doesn't.I guess I can define something like that via configure with
uname -r, though. Then it would be simple a#ifdef.vstinner commentedon Sep 14, 2023
Yeah, that should be good enough.
kulikjak commentedon Sep 15, 2023
I looked into it and prepared #109447 - I was worried that more would be necessary, but I think it worked out pretty well.
gh-78469: Declare missing sethostname for Solaris 10 (#109447)
pythongh-78469: Declare missing sethostname for Solaris 10 (pythonGH-…
pythongh-78469: Declare missing sethostname for Solaris 10 (pythonGH-…
erlend-aasland commentedon Oct 10, 2023
Thanks for the report, @r-bit-rry, and thanks for the fix, @kulikjak, and thanks for the review, @vstinner.
Marking this as resolved; the backports are approved and queued for merging.
[3.12] gh-78469: Declare missing sethostname for Solaris 10 (GH-109447)…
[3.11] gh-78469: Declare missing sethostname for Solaris 10 (GH-109447)…
pythongh-78469: Declare missing sethostname for Solaris 10 (python#10…