Skip to content
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

Merged
merged 8 commits into from
Dec 30, 2017

Conversation

aixtools
Copy link
Contributor

@aixtools aixtools commented Dec 22, 2017

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

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.
Copy link
Member

@pitrou pitrou left a 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
Copy link
Member

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)
Copy link
Member

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?

return Py_BuildValue("y#i", (const char *) uuid, sizeof(uuid), res);
#elif HAVE_UUID_CREATE
unsigned32 status;
uuid_create(&uuid, &status);
Copy link
Member

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?

@bedevere-bot
Copy link

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@aixtools
Copy link
Contributor Author

aixtools commented Dec 30, 2017 via email

@pitrou
Copy link
Member

pitrou commented Dec 30, 2017

If there is an error, you should probably return PyErr_SetFromErrno(PyExc_OSError). You can find examples of this in other modules in the Modules directory.

@aixtools
Copy link
Contributor Author

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@pitrou: please review the changes made to this pull request.

Copy link
Member

@pitrou pitrou left a 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'
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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
Copy link
Member

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "starting".

@bedevere-bot
Copy link

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@aixtools
Copy link
Contributor Author

aixtools commented Dec 30, 2017 via email

@pitrou
Copy link
Member

pitrou commented Dec 30, 2017

I was think the comment about AIX was relevant for the source, less so for the generated file.

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.

@aixtools
Copy link
Contributor Author

aixtools commented Dec 30, 2017 via email

@aixtools
Copy link
Contributor Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@pitrou: please review the changes made to this pull request.

Copy link
Member

@pitrou pitrou left a 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.

@pitrou
Copy link
Member

pitrou commented Dec 30, 2017

Thank you @aixtools !

@aixtools aixtools deleted the bpo-32399 branch January 8, 2018 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants