Python 3.10 and termux

2,929 views
Skip to first unread message

vladko 312

unread,
Mar 4, 2022, 3:47:11 AM3/4/22
to modwsgi
I used mod_wsgi 4.8 with python 3.9 in termux, but i switched to python 3.10 and it is no longer possible to compile it, as python removed some header files that are required. I tried to compile mod_wsgi 4.9 and a development version, but both failed with the same error:
/data/data/com.termux/files/usr/share/apr-1/build/libtool --silent --mode=link aarch64-linux-android-clang -L/data/data/com.termux/files/usr/lib -Wl,-rpath=/data/data/com.termux/files/usr/lib -fopenmp -static-openmp -Wl,--enable-new-dtags -Wl,--as-needed -Wl,-z,relro,-z,now -Wl,--no-as-needed,-landroid-support,--as-needed -lapr-1 -laprutil-1 -L/home/builder/.termux-build/apache2/src/libdummy -Wl,--as-needed,-ldummy-mod_cache,-ldummy-mod_dav,-ldummy-mod_proxy,-ldummy-mod_session,-ldummy-mod_watchdog -Wl,-rpath=/data/data/com.termux/files/usr/libexec/apache2   -o src/server/mod_wsgi.la  -rpath /data/data/com.termux/files/usr/libexec/apache2 -module -avoid-version    src/server/wsgi_validate.lo src/server/wsgi_thread.lo src/server/wsgi_stream.lo src/server/wsgi_server.lo src/server/wsgi_restrict.lo src/server/wsgi_metrics.lo src/server/wsgi_memory.lo src/server/wsgi_logger.lo src/server/wsgi_interp.lo src/server/wsgi_daemon.lo src/server/wsgi_convert.lo src/server/wsgi_buckets.lo src/server/wsgi_apache.lo src/server/mod_wsgi.lo -L/data/data/com.termux/files/usr/lib -L/data/data/com.termux/files/usr/lib/python3.10/config -lpython3.10 -lcrypt -ldl -lm -lm
ld.lld: error: unable to find library -ldummy-mod_cache
ld.lld: error: unable to find library -ldummy-mod_dav
ld.lld: error: unable to find library -ldummy-mod_proxy
ld.lld: error: unable to find library -ldummy-mod_session
ld.lld: error: unable to find library -ldummy-mod_watchdog
clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
apxs:Error: Command failed with rc=65536

How to fix it? I use apache 1:2.4.52-2 and termux 0.101

Graham Dumpleton

unread,
Mar 4, 2022, 3:51:08 AM3/4/22
to mod...@googlegroups.com
Looks more like there is something wrong with your Apache installation.

Instead of using configure/make/make install method of building mod_wsgi, try using the pip install method.

See:


This may not help if is apxs from Apache which is generating bogus output.

What Apache bistro are you using? A system provided package, or some third party one?

Graham

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/6cb36c8d-4cd3-43d5-a392-b39bef80f367n%40googlegroups.com.

vladko 312

unread,
Mar 4, 2022, 4:01:19 AM3/4/22
to modwsgi
I use apache from termux repos. Previously, everything worked (before i upgraded all packets). I tried using python-provided mod_wsgi but it never worked. Now it gives me this error:
CANNOT LINK EXECUTABLE "/data/data/com.termux/files/usr/bin/httpd": cannot locate symbol "apr_procattr_limit_set" referenced by "/data/data/com.termux/files/usr/bin/httpd"...
Aborted

Seems like it is unrelated to mod_wsgi, but i can't fix it either
пятница, 4 марта 2022 г. в 11:51:08 UTC+3, Graham Dumpleton:

Graham Dumpleton

unread,
Mar 4, 2022, 4:04:04 AM3/4/22
to mod...@googlegroups.com
Another indication that it seems the Apache installation seems to be broken. Does Apache even start by itself without mod_wsgi being configured?

vladko 312

unread,
Mar 4, 2022, 4:15:38 AM3/4/22
to modwsgi
My bad, it was an old apr package. After update to 1.7.0-6 (apr-util 1.6.1-5 was already newest) the problem is gone. Now it is a mod_wsgi problem:
httpd: Syntax error on line 206 of /data/data/com.termux/files/usr/etc/apache2/httpd.conf: Cannot load /data/data/com.termux/files/usr/lib/python3.10/site-packages/mod_wsgi-4.9.1.dev1-py3.10-linux-aarch64.egg/mod_wsgi/server/mod_wsgi-py310.cpython-310.so into server: dlopen failed: cannot locate symbol "apr_pool_cleanup_null" referenced by "/data/data/com.termux/files/usr/lib/python3.10/site-packages/mod_wsgi-4.9.1.dev1-py3.10-linux-aarch64.egg/mod_wsgi/server/mod_wsgi-py310.cpython-310.so"...
Without mod_wsgi it loads base  config successfully and fails on my flask config. Without flask config  everything works.

пятница, 4 марта 2022 г. в 12:04:04 UTC+3, Graham Dumpleton:

Graham Dumpleton

unread,
Mar 4, 2022, 4:18:35 AM3/4/22
to mod...@googlegroups.com
Ensure you use:

    pip install --no-cache-dir mod_wsgi

so it doesn't use any prior build outputs.

If still have issue, ensure that the apache-dev package is the same version as main apache binary package. The error can indicate they are for different versions and headers files don't match apache libraries.

Graham

Graham Dumpleton

unread,
Mar 4, 2022, 4:36:08 AM3/4/22
to mod...@googlegroups.com
Forgot to say, also ensure use -U option.

pip install --no-cache-dir -U mod_wsgi

That or uninstall the package first, then install again using --no-cache-dir.

vladko 312

unread,
Mar 4, 2022, 4:42:06 AM3/4/22
to modwsgi
I reinstalled mod_wsgi with your command, but the error remains.  Seems like termux has no apache2-dev and uses apache-2 instead.

пятница, 4 марта 2022 г. в 12:18:35 UTC+3, Graham Dumpleton:

Graham Dumpleton

unread,
Mar 4, 2022, 4:46:57 AM3/4/22
to mod...@googlegroups.com
Did you force update or uninstall the installed mod_wsgi version first as clarified in followup email?

vladko 312

unread,
Mar 4, 2022, 4:56:48 AM3/4/22
to modwsgi
I uninstalled first.

пятница, 4 марта 2022 г. в 12:46:57 UTC+3, Graham Dumpleton:

Graham Dumpleton

unread,
Mar 4, 2022, 4:57:45 AM3/4/22
to mod...@googlegroups.com
Then the apr version may not match what Apache was compiled for.

vladko 312

unread,
Mar 4, 2022, 5:02:54 AM3/4/22
to modwsgi
They both are the newest in termux repo. Apache starts without mod_wsgi. Is there a way to fix the initial problem with compiling mod_wsgi 4.9 or 4.8 with CMMI?


пятница, 4 марта 2022 г. в 12:57:45 UTC+3, Graham Dumpleton:

Graham Dumpleton

unread,
Mar 4, 2022, 5:11:16 AM3/4/22
to mod...@googlegroups.com
Since you updated APR. For configure/make/make install, make sure you did a make distclean before running configure again and re-compiling. If you do that, what is the output and error if still have one.

vladko 312

unread,
Mar 4, 2022, 5:15:19 AM3/4/22
to modwsgi
used 'make distclean'. The error remains.

пятница, 4 марта 2022 г. в 13:11:16 UTC+3, Graham Dumpleton:

Graham Dumpleton

unread,
Mar 4, 2022, 5:16:48 AM3/4/22
to mod...@googlegroups.com
All you can do then is after running configure, edit the Makefile and remove all the -ldummy-xxx options, as they should not exist. Then do the build.

vladko 312

unread,
Mar 4, 2022, 6:47:24 AM3/4/22
to modwsgi
I can't find where they are coming from. I searched in all files after ./configure


пятница, 4 марта 2022 г. в 13:16:48 UTC+3, Graham Dumpleton:

vladko 312

unread,
Mar 4, 2022, 7:34:38 AM3/4/22
to modwsgi

Found them in usr/share/apache
Will try to comment them and try again
пятница, 4 марта 2022 г. в 14:47:24 UTC+3, vladko 312:

vladko 312

unread,
Mar 4, 2022, 8:43:06 AM3/4/22
to modwsgi
It worked! I removed all -ldummy-xxx from both usr/share/apache2/build/config* and it allowed me to compile the module! The module works and I was able to use my Flask app again! Thank you for your help!

пятница, 4 марта 2022 г. в 15:34:38 UTC+3, vladko 312:

Graham Dumpleton

unread,
Mar 4, 2022, 1:37:56 PM3/4/22
to mod...@googlegroups.com
What was in the Makefile left in the mod_wsgi source directory after running configure?

vladko 312

unread,
Mar 4, 2022, 2:56:36 PM3/4/22
to mod...@googlegroups.com
I wasn't changing the makefile, as there was nothing related to those libs in it

пт, 4 мар. 2022 г. в 21:37, Graham Dumpleton <graham.d...@gmail.com>:
You received this message because you are subscribed to a topic in the Google Groups "modwsgi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/modwsgi/MTT7XPCc7gw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/4038BBB3-4E4D-4D59-B87D-4A49F1141717%40gmail.com.

Graham Dumpleton

unread,
Mar 4, 2022, 3:02:53 PM3/4/22
to mod...@googlegroups.com
If the options were added internally by apxs when it was run to compile/link the module, again reinforces that the Apache system packages for that platform are broken then. Anyway, at least you got it working.

Reply all
Reply to author
Forward
0 new messages