Tencent / puerts

PUER(普洱) Typescript. Let's write your game in UE or Unity with TypeScript.
Other
5.05k stars 702 forks source link

[Unity] Bug: Linux CI - Libpuerts.so not found #1817

Closed raad-genies closed 2 months ago

raad-genies commented 2 months ago

前置阅读 | Pre-reading

Puer的版本 | Puer Version

Latest

Unity的版本 | Unity Version

2022.3

发生在哪个平台 | Platform

Other

错误信息 | Error Message

Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/puerts
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts.so
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts.so
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/puerts
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts.so
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts.so
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/puerts
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts.so
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts.so
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/puerts
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts.so
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts.so
Fallback handler could not load library /opt/unity/Editor/Data/MonoBleedingEdge/lib/libpuerts
[Puer001] DllNotFoundException detected. You can solve this problem following the FAQ.
UnityEngine.StackTraceUtility:ExtractStackTrace () (at /home/bokken/build/output/unity/unity/Runtime/Export/Scripting/StackTrace.cs:37)
UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
UnityEngine.Logger:Log (UnityEngine.LogType,object)
UnityEngine.Debug:LogError (object)
Puerts.PuertsDLL:GetApiLevel ()

Notes:

Checking dependencies for /runner/_work/xxxxx/Puerts/Plugins/x86_64/libpuerts.so
    linux-vdso.so.1 (0x00007f8dac51c000)
    libc++.so.1 => /lib/x86_64-linux-gnu/libc++.so.1 (0x00007f8dab34c000)
    libunwind.so.1 => /lib/x86_64-linux-gnu/libunwind.so.1 (0x00007f8dab341000)
    libc++abi.so.1 => /lib/x86_64-linux-gnu/libc++abi.so.1 (0x00007f8dab30b000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f8dab224000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f8dab204000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f8daafd9000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f8dac51e000)

问题重现 | Bug reproduce

1- Setup CI to generate bindings using Github actions ubuntu 2- Try to run workflow 3- See errors posted.

chexiongsheng commented 2 months ago

Has libpuerts.so been placed in the Plugins/x86_64 directory? Have you set the platform for libpuerts.so to Linux x64?

raad-genies commented 2 months ago

@chexiongsheng yes

raad-genies commented 2 months ago

Update: Downloaded ubuntu and setup project, this worked when I deleted libpuerts.so under Plugins/Android/libs/x86_64/libpuerts.so even though the import settings is set to Android only. My guess is its an issue with name collision in unity. Probably best to start naming libraries with unique names per platform.

Edit: On CI, the issue is with error: libc++.so.1: cannot open shared object file: No such file or directory even though I do install them before running unity, will keep debugging to see why that's happening. But can close for now. (The way I was able to force that log is by loading at startup (else unity silently doesn't load it)