Nothing Special   »   [go: up one dir, main page]

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

dev-python/pypy3-exe-7.3.0 no longer compiles #451

Open
ewildgoose opened this issue Sep 23, 2021 · 3 comments
Open

dev-python/pypy3-exe-7.3.0 no longer compiles #451

ewildgoose opened this issue Sep 23, 2021 · 3 comments

Comments

@ewildgoose
Copy link

Hi, pypy3-exe-7.3.0 now fails to find the download, so won't compile

Trivially grabbing latest upstream and re-applying the old musl patches gets the same failed result as using upstream gentoo pypy3-exe-7.3.5

  File "/var/tmp/portage/dev-python/pypy3-exe-7.3.5/work/pypy3.7-v7.3.5-src/rpython/rlib/clibffi.py", line 294, in <module>
    assert libc_name is not None, "Cannot find C library, ctypes.util.find_library('c') returned None"
AssertionError: Cannot find C library, ctypes.util.find_library('c') returned None

Adding the patch referenced in another issue here to python-2.7, allows things to get further (but it fails further along for me on arm/musl):
https://raw.githubusercontent.com/alpinelinux/aports/master/main/python3/musl-find_library.patch

@tgbugs
Copy link
tgbugs commented Jan 20, 2022

I see something similar with the gentoo repo dev-python/pypy3-exe-7.3.7. The alpine patch fixes the first issue, you then need pypy3-exe-7.3.0-musl-compat-fix-stdio-defs.patch and the patch listed below (instead of pypy3-exe-7.3.0-musl-compat-include-sys-time.patch which fails to apply for some reason) to get pypy3 to build. I didn't check on the gcc10 patch because I am on gcc11.

diff -r 9ef55f6fc369 pypy/module/cpyext/include/pytime.h
--- a/pypy/module/cpyext/include/pytime.h	Sun Oct 24 23:08:46 2021 +0300
+++ b/pypy/module/cpyext/include/pytime.h	Wed Jan 19 21:09:49 2022 -0500
@@ -2,6 +2,10 @@
 #ifndef Py_PYTIME_H
 #define Py_PYTIME_H
 
+#ifndef MS_WINDOWS
+#include <sys/time.h>
+#endif
+
 #include <pyconfig.h> /* include for defines */
 #include "object.h"
 

@LinuxUserGD
Copy link

After manually patching pypy3-exe-7.3.9.ebuild from main gentoo repo, it compiled fine on clang with libcxx and musl libc:

diff --git a/pypy/module/cpyext/include/pytime.h b/pypy/module/cpyext/include/pytime.h
index 6d553f5..3e29191 100644
--- a/pypy/module/cpyext/include/pytime.h
+++ b/pypy/module/cpyext/include/pytime.h
@@ -122,14 +122,14 @@ PyAPI_FUNC(PyObject *) _PyTime_AsNanosecondsObject(_PyTime_t t);
    tv_usec is always positive.
    Raise an exception and return -1 if the conversion overflowed,
    return 0 on success. */
-PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t,
-    struct timeval *tv,
-    _PyTime_round_t round);
+//PyAPI_FUNC(int) _PyTime_AsTimeval(_PyTime_t t,
+//    struct timeval *tv,
+//    _PyTime_round_t round);
 
 /* Similar to _PyTime_AsTimeval(), but don't raise an exception on error. */
-PyAPI_FUNC(int) _PyTime_AsTimeval_noraise(_PyTime_t t,
-    struct timeval *tv,
-    _PyTime_round_t round);
+//PyAPI_FUNC(int) _PyTime_AsTimeval_noraise(_PyTime_t t,
+//    struct timeval *tv,
+//    _PyTime_round_t round);
 
 /* Convert a timestamp to a number of seconds (secs) and microseconds (us).
    us is always positive. This function is similar to _PyTime_AsTimeval()
diff --git a/rpython/rlib/clibffi.py b/rpython/rlib/clibffi.py
index 7c668fb..893ca63 100644
--- a/rpython/rlib/clibffi.py
+++ b/rpython/rlib/clibffi.py
@@ -276,7 +276,7 @@ else:
 
 if not _WIN32:
     libc_name = ctypes.util.find_library('c')
-    assert libc_name is not None, "Cannot find C library, ctypes.util.find_library('c') returned None"
+    #assert libc_name is not None, "Cannot find C library, ctypes.util.find_library('c') returned None"
 
     def get_libc_name():
         return libc_name

@tgbugs
Copy link
tgbugs commented May 4, 2022

@LinuxUserGD you may run into issues if you just comment those lines out. See the links with discussion of the issue (that links back here as well) and a patchset that works against 7.3.9 https://github.com/tgbugs/dockerfiles/blob/f0a7ecbf8a02e1e4d6bc7677c801692d7256191f/source.org#patches

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

No branches or pull requests

3 participants