Skip to content

Unable to compiling pyjnius with qt bootstrap #3220

@XcantloadX

Description

@XcantloadX
hon-311/jnius/src/org/jnius
copying jnius/src/org/jnius/NativeInvocationHandler.java -> build/lib.linux-x86_64-cpython-311/jnius/src/org/jnius
copying jnius/src/org/jnius/NativeInvocationHandler.class -> build/lib.linux-x86_64-cpython-311/jnius/src/org/jnius
running build_ext
Compiling jnius/jnius.pyx because it changed.
[1/1] Cythonizing jnius/jnius.pyx
warning: jnius/jnius.pyx:102:0: The 'IF' statement is deprecated and will be removed in a future Cython version. Consider using runtime conditions or C macros instead. See https://github.com/cython/cython/issues/4310
building 'jnius' extension
creating build/temp.linux-x86_64-cpython-311
creating build/temp.linux-x86_64-cpython-311/jnius
/usr/bin/ccache /workspaces/baas_for_android/.pyside6_android_deploy/android-ndk/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android24 -fomit-frame-pointer -march=armv8-a -fPIC -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -target aarch64-linux-android24 -fomit-frame-pointer -march=armv8-a -fPIC -I/workspaces/baas_for_android/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/Include -DANDROID -I/workspaces/baas_for_android/.pyside6_android_deploy/android-ndk/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/workspaces/baas_for_android/.buildozer/android/platform/build-arm64-v8a/build/python-installs/boa/arm64-v8a/include/python3.1 -fPIC -I/tmp/build-env-wbc24o8z/include -I/usr/local/include/python3.11 -c jnius/jnius.c -o build/temp.linux-x86_64-cpython-311/jnius/jnius.o
jnius/jnius.c:19398:75: warning: incompatible pointer types passing 'void **' to parameter of type 'JNIEnv **' (aka 'const struct JNINativeInterface ***') [-Wincompatible-pointer-types]
  (void)((__pyx_v_5jnius_jvm[0])->AttachCurrentThread(__pyx_v_5jnius_jvm, (&__pyx_v_env), NULL));
                                                                          ^~~~~~~~~~~~~~
jnius/jnius.c:27800:19: warning: assigning to 'jchar *' (aka 'unsigned short *') from 'const jchar *' (aka 'const unsigned short *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
  __pyx_v_j_chars = (__pyx_v_j_env[0])->GetStringChars(__pyx_v_j_env, __pyx_v_j_string, NULL);
                  ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
/usr/bin/ccache /workspaces/baas_for_android/.pyside6_android_deploy/android-ndk/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android24 -fomit-frame-pointer -march=armv8-a -fPIC -shared -L/workspaces/baas_for_android/.buildozer/android/platform/build-arm64-v8a/build/libs_collections/boa/arm64-v8a -L/workspaces/baas_for_android/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/android-build -lpython3.11 -L/workspaces/baas_for_android/.buildozer/android/platform/build-arm64-v8a/build/libs_collections/boa/arm64-v8a -L/workspaces/baas_for_android/.buildozer/android/platform/build-arm64-v8a/build/libs_collections/boa -L/workspaces/baas_for_android/.buildozer/android/platform/build-arm64-v8a/build/bootstrap_builds/qt/obj/local/arm64-v8a -target aarch64-linux-android24 -fomit-frame-pointer -march=armv8-a -fPIC -I/workspaces/baas_for_android/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/Include -DANDROID -I/workspaces/baas_for_android/.pyside6_android_deploy/android-ndk/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/workspaces/baas_for_android/.buildozer/android/platform/build-arm64-v8a/build/python-installs/boa/arm64-v8a/include/python3.1 build/temp.linux-x86_64-cpython-311/jnius/jnius.o -lmain -llog -o build/lib.linux-x86_64-cpython-311/jnius/jnius.cpython-311-x86_64-linux-gnu.so
ld.lld: error: unable to find library -lmain
clang-17: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/ccache' failed with exit code 1

ERROR Backend subprocess exited when trying to invoke build_wheel

I looked into the source code and found that the main module in qt bootstrap is named main_$(PREFERRED_ABI) instead of plain main. Also function WebView_AndroidGetJNIEnv is missing in qt bootstrap.

You can check my fix here XcantloadX@ed26a24 . Some changes are hard-coded because I don't know the correct way to implement it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions