-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-78469: Declare missing sethostname for Solaris 10 #109447
Conversation
Modules/socketmodule.c
Outdated
@@ -5652,8 +5652,9 @@ socket_sethostname(PyObject *self, PyObject *args) | |||
Py_buffer buf; | |||
int res, flag = 0; | |||
|
|||
#ifdef _AIX | |||
/* issue #18259, not declared in any useful header file */ | |||
#if defined(_AIX) || (defined(__sun) && defined(__SVR4) && SUNOS_VERSION == 510) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, that's very spefic. It was available before and after, but not at version 510? :-)
# in most compilers, so we define one here. | ||
SUNOS_VERSION=`echo $ac_sys_release | tr -d '.'` | ||
AC_DEFINE_UNQUOTED([SUNOS_VERSION], [$SUNOS_VERSION], | ||
[The version of SunOS/Solaris as reported by `uname -r' without the dot.]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you distinguish Solaris 5.10 and Solaris 51.0?
Maybe multiply the major version by 100 or 1000? or use a shift of 8 bits? The usage would be:
major = VERSION >> 8
minor = VERSION & 255
The disavantage is the need to write versions in hexadecimal :-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erlend-aasland: Should we prefix new pyconfig.h constants by Py_ ? see: capi-workgroup/problems#46
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should follow the PEP-7 recommendations: https://peps.python.org/pep-0007/#naming-conventions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you distinguish Solaris 5.10 and Solaris 51.0?
I see what you mean, but that's not happening. The leading 5 was dropped from the name 25 years ago and while e.g. uname
and compilation targets still use it, nobody today calls it Solaris/SunOS 5.10; only Solaris 10. If we ever release Solaris 51, uname -r
should report it as 5.51.
That said, I am not strongly against changing it if you still prefer your suggestion.
I think we should follow the PEP-7 recommendations: https://peps.python.org/pep-0007/#naming-conventions
Thanks, I missed that. It's fixed now.
When was Solaris 10 release? Is it still supported? Does this change better to forks of Solaris? |
Sorry for such a long delay. As mentioned in the issue, Solaris 10, while in the "extended support stage" intended mostly for critical fixes, is still supported (ATM at least until January 2025). There are still people using it and possibly installing newer Python onto it. As for the Solaris forks, this doesn't affect those because the first open version was Solaris 11. |
Co-authored-by: Victor Stinner <[email protected]>
Is this a bug-fix? If so, we should backport it and add a NEWS entry. |
Do you use "make regen-configure"? See: https://docs.python.org/dev/using/configure.html#generated-files @kulikjak: Anyway, I push directly into your branch to fix the configure script (regenerate it). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@kulikjak: I also replaced |
Sigh, sorry. Normally, I do, but this time I thought that I could quickly edit it myself, ... and I was wrong. Thanks for fixing it.
I guess it is (fixing a build on Solaris <= 10). I can add a NEWS entry, although now there is a Other than that, the build failure doesn't seem to be related, so that's good. |
…109447) Add OS version specific macro for Solaris: Py_SUNOS_VERSION. (cherry picked from commit 3b1580a) Co-authored-by: Jakub Kulík <[email protected]>
GH-110580 is a backport of this pull request to the 3.12 branch. |
GH-110581 is a backport of this pull request to the 3.11 branch. |
…109447) Add OS version specific macro for Solaris: Py_SUNOS_VERSION. (cherry picked from commit 3b1580a) Co-authored-by: Jakub Kulík <[email protected]>
|
… (#110580) Add OS version specific macro for Solaris: Py_SUNOS_VERSION. (cherry picked from commit 3b1580a) Co-authored-by: Jakub Kulík <[email protected]>
… (#110581) Add OS version specific macro for Solaris: Py_SUNOS_VERSION. (cherry picked from commit 3b1580a) Co-authored-by: Jakub Kulík <[email protected]>
…9447) Add OS version specific macro for Solaris: Py_SUNOS_VERSION.
As discussed in the issue,
sethostname
is missing from Solaris 10 headers but is available on Solaris 11.And because there isn't an OS version specific macro for Solaris, I had to "create" one.