-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
_uuidmodule.c cannot build on AIX - different typedefs of uuid_t, etc.. #76580
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
Comments
I was hoping for something simple - as in:
However, it dies - instantly.
"/data/prj/python/git/python3-3.7.0.a3/Modules/_uuidmodule.c", line 23.48: 1506-117 (S) Operand must be a scalar type. On a linux system I see: typedef unsigned char uuid_t[16]; while on AIX the typedef is: /*
* Universal Unique Identifier (UUID) types.
*/
typedef struct _uuid_t
{
unsigned32 time_low;
unsigned16 time_mid;
unsigned16 time_hi_and_version;
unsigned8 clock_seq_hi_and_reserved;
unsigned8 clock_seq_low;
byte node[6];
} uuid_t, *uuid_p_t; So, mentioning this for now - as I do not yet know the module. If someone with intimate knowledge of the current implementation is willing to help me - I'll dabble and learn - and see if we can make it work on AIX as well. p.s. - guessing on the "Extension Modules" label. If not the right choice, please update. |
So - KISS principle: This diff shows what can compile: diff --git a/Modules/_uuidmodule.c b/Modules/_uuidmodule.c
index d4bc3c7..5550705 100644
--- a/Modules/_uuidmodule.c
+++ b/Modules/_uuidmodule.c
@@ -1,7 +1,11 @@
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+#ifndef _AIX
#include <uuid/uuid.h>
+#else
+#include <uuid.h>
+#endif static PyObject *
@@ -16,7 +20,11 @@ py_uuid_generate_time_safe(void)
#else
uuid_t out;
uuid_generate_time(out);
+#ifndef _AIX
return Py_BuildValue("y#O", (const char *) out, sizeof(out), Py_None);
+#else
+ return Py_BuildValue("y#O", (const char *) &out, sizeof(out), Py_None);
+#endif
#endif
} However, no uuid_generate_time(). So, ends with: |
Keep in mind _uuid is an optional C extension that is used to accelerate the uuid module when available. It doesn't bring any additional functionality by itself. |
Understood. What I have learned. Although the types are quite different, they are both 16 bytes. Starting with AIX 6.1, libc includes uuid_create(&uuid, &status) Further reading of the documentation within """ and """ in Lib/uuid.py helps me realize that the AIX approach aligns with the UUID fields description:
So - with this: there is also more than can be done for AIX re: https://bugs.python.org/issue28009 More to come... |
As the 'basics' seem to be 'accepted', going to work on the PR so that configure.ac can prepare the right choices, rather than rely on a hard-coded _AIX determined macro. |
Does this approach allow test_uuid to pass for you? |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: