-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
bpo-32399: Starting with AIX6.1 there is support in libc.a for uuid (RFC4122) #4974
Conversation
This patch provides the changes needed for this integration with the OS. On AIX the base function is uuid_create() rather than uuid_generate_time() The AIX uuid_t typedef is more aligned to the UUID field based definition while the Linux typedef that is more aligned with UUID bytes (or perhaps UUID bytes_le) definitions.
and appropriate include macro for uuid.h are used.
…ines in _uuidmodules.c are missed. As _uuid module may fail, the tests say PASS - but actually, they failed.
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.
Thanks for the PR. A couple comments below.
return Py_BuildValue("y#i", (const char *) out, sizeof(out), res); | ||
res = uuid_generate_time_safe(uuid); | ||
return Py_BuildValue("y#i", (const char *) uuid, sizeof(uuid), res); | ||
#elif HAVE_UUID_CREATE |
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.
Could you add a comment that this is AIX-specific?
configure.ac
Outdated
@@ -2692,6 +2695,17 @@ void *x = uuid_generate_time_safe | |||
[AC_MSG_RESULT(no)] | |||
) | |||
|
|||
AC_MSG_CHECKING(for uuid_create) |
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.
Could you add a comment that this is AIX-specific?
Modules/_uuidmodule.c
Outdated
return Py_BuildValue("y#i", (const char *) uuid, sizeof(uuid), res); | ||
#elif HAVE_UUID_CREATE | ||
unsigned32 status; | ||
uuid_create(&uuid, &status); |
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.
You should check the return value of uuid_create
, no?
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Regarding the return value checking.
I could check that status != 0, but what should be done then.
Could the argument ‘y#i’ and status included as an argument be used? I admit that I didn’t look for documentation on PyBuildValue()
…Sent from my iPhone
On 29 Dec 2017, at 22:10, Antoine Pitrou ***@***.***> wrote:
@pitrou requested changes on this pull request.
Thanks for the PR. A couple comments below.
In Modules/_uuidmodule.c:
> int res;
- res = uuid_generate_time_safe(out);
- return Py_BuildValue("y#i", (const char *) out, sizeof(out), res);
+ res = uuid_generate_time_safe(uuid);
+ return Py_BuildValue("y#i", (const char *) uuid, sizeof(uuid), res);
+#elif HAVE_UUID_CREATE
Could you add a comment that this is AIX-specific?
In configure.ac:
> @@ -2692,6 +2695,17 @@ void *x = uuid_generate_time_safe
[AC_MSG_RESULT(no)]
)
+AC_MSG_CHECKING(for uuid_create)
Could you add a comment that this is AIX-specific?
In Modules/_uuidmodule.c:
> int res;
- res = uuid_generate_time_safe(out);
- return Py_BuildValue("y#i", (const char *) out, sizeof(out), res);
+ res = uuid_generate_time_safe(uuid);
+ return Py_BuildValue("y#i", (const char *) uuid, sizeof(uuid), res);
+#elif HAVE_UUID_CREATE
+ unsigned32 status;
+ uuid_create(&uuid, &status);
You should check the return value of uuid_create, no?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
If there is an error, you should probably return |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @pitrou: please review the changes made to this pull request. |
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.
Thank you. Just a few more comments.
@@ -9125,7 +9125,7 @@ then | |||
LDCXXSHARED='$(CXX) -shared' | |||
else | |||
LDSHARED='$(CC) -b' | |||
LDCXXSHARED='$(CXX) -shared' | |||
LDCXXSHARED='$(CXX) -b' |
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.
This doesn't look related.
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.
Note those lines originate from #2519. Perhaps @datalogics-robb can comment on why LDCXXSHARED='$(CXX) -b'
in configure.ac
becomes LDCXXSHARED='$(CXX) -shared'
in configure
.
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 looked at #2519 and it looks like the changes in configure were editted manually, rather than generated from configure.ac (my two cents).
If the line is suppossed to be with -shared, then configure.ac needs to be fixed. I do not know HPUX, so cannot help.
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.
Sorry I've been AFK for a week, but yes this change looks good. -shared is a gcc/g++ flag and should definitely not be in a non-gcc clause.
configure.ac
Outdated
@@ -2681,6 +2681,10 @@ AC_CHECK_LIB(sendfile, sendfile) | |||
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV | |||
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX | |||
|
|||
# checks for uuid.h location | |||
dnl # AIX is at /usr/include/uuid.h |
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.
"dnl" isn't useful here, no?
configure.ac
Outdated
@@ -2692,6 +2696,18 @@ void *x = uuid_generate_time_safe | |||
[AC_MSG_RESULT(no)] | |||
) | |||
|
|||
# AIX provides support for RFC4122 (uuid) in libc.a starring with AIX 6.1 (anno 2007) |
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.
Typo: "starting".
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
On 30-Dec-17 13:21, Antoine Pitrou wrote:
***@***.**** requested changes on this pull request.
Thank you. Just a few more comments.
------------------------------------------------------------------------
In configure
<#4974 (comment)>:
> @@ -9125,7 +9125,7 @@ then
LDCXXSHARED='$(CXX) -shared'
else
LDSHARED='$(CC) -b'
- LDCXXSHARED='$(CXX) -shared'
+ LDCXXSHARED='$(CXX) -b'
This is, I think, a side effect of the different aclocal.m4 that my
autoreconf generates. I'll have to read the docs, I think they are
equivalent. But I'll check.
This doesn't look related.
------------------------------------------------------------------------
In configure.ac
<#4974 (comment)>:
> @@ -2681,6 +2681,10 @@ AC_CHECK_LIB(sendfile, sendfile)
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
+# checks for uuid.h location
+dnl # AIX is at /usr/include/uuid.h
"dnl" isn't useful here, no?
I was think the comment about AIX was relevant for the source, less so
for the generated file.
I'll delete it as I reference AIX elsewhere.
------------------------------------------------------------------------
In configure.ac
<#4974 (comment)>:
> @@ -2692,6 +2696,18 @@ void *x = uuid_generate_time_safe
[AC_MSG_RESULT(no)]
)
+# AIX provides support for RFC4122 (uuid) in libc.a starring with AIX 6.1 (anno 2007)
Typo: "starting".
fixed.
…
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4974 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKWY9dpCNcDY6XqbmliH2X6dpkbiCMhrks5tFiqsgaJpZM4RK36h>.
|
I was tallking about the "dnl" at the beginning of the comment. I don't know much about m4, but it doesn't seem necessary, given how other comments are formatted. |
On 30-Dec-17 13:21, Antoine Pitrou wrote:
***@***.**** requested changes on this pull request.
Thank you. Just a few more comments.
------------------------------------------------------------------------
In configure
<#4974 (comment)>:
> @@ -9125,7 +9125,7 @@ then
LDCXXSHARED='$(CXX) -shared'
else
LDSHARED='$(CC) -b'
- LDCXXSHARED='$(CXX) -shared'
+ LDCXXSHARED='$(CXX) -b'
This doesn't look related.
imho - there is a commit error for configure, as configure.ac says:
hp*|HP*)
if test "$GCC" = "yes" ; then
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared'
else
LDSHARED='$(CC) -b'
LDCXXSHARED='$(CXX) -b'
fi ;;
Darwin/1.3*)
LDSHARED='$(CC) -bundle'
so my output is, as far as I can determine, correct.
… ------------------------------------------------------------------------
In configure.ac
<#4974 (comment)>:
> @@ -2681,6 +2681,10 @@ AC_CHECK_LIB(sendfile, sendfile)
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
+# checks for uuid.h location
+dnl # AIX is at /usr/include/uuid.h
"dnl" isn't useful here, no?
------------------------------------------------------------------------
In configure.ac
<#4974 (comment)>:
> @@ -2692,6 +2696,18 @@ void *x = uuid_generate_time_safe
[AC_MSG_RESULT(no)]
)
+# AIX provides support for RFC4122 (uuid) in libc.a starring with AIX 6.1 (anno 2007)
Typo: "starting".
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4974 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AKWY9dpCNcDY6XqbmliH2X6dpkbiCMhrks5tFiqsgaJpZM4RK36h>.
|
I have made the requested changes; please review again |
Thanks for making the requested changes! @pitrou: please review the changes made to this pull request. |
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.
Ok, this looks good to me. I'm gonna merge once the CI is happy.
Thank you @aixtools ! |
This patch provides the changes needed for this integration with the OS.
On AIX the base function is uuid_create() rather than uuid_generate_time()
The AIX uuid_t typedef is more aligned to the UUID field based definition
while the Linux typedef that is more aligned with UUID bytes
(or perhaps UUID bytes_le) definitions.
https://bugs.python.org/issue32399