chatgui: verify FFmpeg DLL deployment + fix dependency resolution order
This commit is contained in:
1 parent
9d4538935d
commit
01987a75d0
5 files changed
+52
-14
No files matched your search
@@ -36,7 +36,7 @@ extern "C" {
|
||||
#define CHAT_EVT_SERVICE_STOPPED 13 /* data: none */
|
||||
#define CHAT_EVT_ATTACHMENT_DOWNLOADED 14 /* [ch_id_len:1][ch_id:var][msg_id:8] */
|
||||
#define CHAT_EVT_DOWNLOAD_PROGRESS 15 /* [ch_id_len:1][ch_id:var][msg_id:8][blocks_done:4][num_blocks:4] */
|
||||
#define CHAT_EVT_NODEINFO_UPDATED 16 /* [node_id:8][conn_presence:1][conn_up:1][best_rtt:2] */
|
||||
#define CHAT_EVT_NODEINFO_UPDATED 16 /* [node_id:8][conn_presence:1][conn_up:1][best_rtt:2][bgp_rtt:2][bgp_nodes:2] */
|
||||
#define CHAT_EVT_LINK_STATUS_CHANGED 17 /* [peer_id:8][link_id:1][state:1][status:1][links_up:1][initialized:1] */
|
||||
#define CHAT_EVT_INVITE_RECEIVED 18 /* [ch_id_len:1][ch_id][name_len:1][name][inviter_node_id:8][inviter_name_len:1][inviter_name] */
|
||||
#define CHAT_EVT_LOCAL_SOCKETS 19 /* JSON: [{"si":id,"nm":"...","ad":"...","po":port,"pt":"TCP|UDP","st":0|1|2,"lk":n},...] */
|
||||
|
||||
+2
-2
@@ -392,12 +392,12 @@ private fun MemberDetailCard(
|
||||
fontSize = 13.sp, color = Color.DarkGray)
|
||||
}
|
||||
}
|
||||
if (detail.bgpPresence) {
|
||||
if (detail.bgpPresence && detail.bgpNodes > 0) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Box(Modifier.size(8.dp).clip(CircleShape).background(Color(0xFF4CAF50)))
|
||||
Spacer(Modifier.width(6.dp))
|
||||
Text("BGP: ${detail.bgpNodes} nodes" +
|
||||
(if (detail.bestRtt > 0) " ${detail.bestRtt}ms" else ""),
|
||||
(if (detail.bestRtt > 0) " ${detail.bestRtt / 10}ms" else ""),
|
||||
fontSize = 13.sp, color = Color.DarkGray)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ class ChatViewModel : ViewModel() {
|
||||
4 -> { if (repo != null) { LogManager.addLog("INFO", "VM", "CHANNEL_UPDATED — refreshChannels"); refreshChannels() } else { LogManager.addLog("WARN", "VM", "CHANNEL_UPDATED skipped — repo is NULL") } }
|
||||
12 -> LogManager.addLog("INFO", "VM", "service started")
|
||||
13 -> LogManager.addLog("INFO", "VM", "service stopped")
|
||||
16 -> { /* NODEINFO_UPDATED: [node_id:8][presence:1][up:1][best_rtt:2] */
|
||||
16 -> { /* NODEINFO_UPDATED: [node_id:8][presence:1][up:1][best_rtt:2][bgp_rtt:2][bgp_nodes:2] */
|
||||
if (data == null || data.size < 12) return
|
||||
val ns = parseNodeStatus(data) ?: return
|
||||
_nodeStatuses.value = _nodeStatuses.value + (ns.nodeId to ns)
|
||||
|
||||
@@ -168,14 +168,19 @@ static void nodeinfo_event_cb(struct TOPO_GROUP* group, struct TOPO_GROUP_NODE*
|
||||
(void)group; (void)arg;
|
||||
if (!nq || !g_event_handler) return;
|
||||
uint16_t best_rtt = topo_get_chain_rtt(nq);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "nodeinfo_cb: nid=%016llx pres=%02x up=%02x rtt=%u(0x%04X) paths=%zu",
|
||||
uint8_t hc = 0;
|
||||
topo_node_best_hop_list(nq, &hc, NULL);
|
||||
uint16_t bgp_nodes = (hc > 0) ? (uint16_t)(hc - 1) : 0;
|
||||
DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "nodeinfo_cb: nid=%016llx pres=%02x up=%02x rtt=%u(0x%04X) hc=%u bgp_nodes=%u paths=%zu",
|
||||
(unsigned long long)nq->node_id, nq->conn_presence, nq->conn_up,
|
||||
best_rtt, best_rtt, nq->paths ? queue_entry_count(nq->paths) : 0);
|
||||
uint8_t data[12];
|
||||
best_rtt, best_rtt, hc, bgp_nodes, nq->paths ? queue_entry_count(nq->paths) : 0);
|
||||
uint8_t data[16];
|
||||
memcpy(data, &nq->node_id, 8);
|
||||
data[8] = nq->conn_presence;
|
||||
data[9] = nq->conn_up;
|
||||
memcpy(data + 10, &best_rtt, 2);
|
||||
memcpy(data + 12, &best_rtt, 2);
|
||||
memcpy(data + 14, &bgp_nodes, 2);
|
||||
g_event_handler(CHAT_EVT_NODEINFO_UPDATED, data, sizeof(data));
|
||||
}
|
||||
|
||||
|
||||
+40
-7
@@ -53,31 +53,41 @@ else
|
||||
fi
|
||||
|
||||
# Резолвим НЕ-Qt зависимости (FFmpeg, mingw-runtime) всегда: windeployqt копирует только Qt.
|
||||
# FFmpeg ищем ПЕРВЫМ в $FFMPEG_BIN: exe линкован именно под кастомный билд,
|
||||
# а pacman-ffmpeg той же мажорной версии в /ucrt64/bin дал бы неверный набор кодеков.
|
||||
FFMPEG_BIN="$SRC_DIR/ffmpeg/ffmpeg_build/install/bin"
|
||||
OBJDUMP="objdump"; [ -n "${MSYSTEM_PREFIX:-}" ] && OBJDUMP="$MSYSTEM_PREFIX/bin/objdump"
|
||||
shopt -s nocasematch
|
||||
log " Resolving non-Qt dependencies recursively..."
|
||||
todo="$BUILD_DIR/vibechat.exe"
|
||||
while [ -n "$todo" ]; do
|
||||
next_todo=""
|
||||
for src in $todo; do
|
||||
for dep in $(objdump -p "$src" 2>/dev/null | grep "DLL Name:" | awk '{print $3}'); do
|
||||
for dep in $($OBJDUMP -p "$src" 2>/dev/null | grep "DLL Name:" | awk '{print $3}'); do
|
||||
case "$dep" in
|
||||
KERNEL32.dll|msvcrt.dll|USER32.dll|GDI32.dll|SHELL32.dll|ADVAPI32.dll|\
|
||||
WS2_32.dll|ole32.dll|OLEAUT32.dll|IPHLPAPI.DLL|BCRYPT.dll|dbghelp.dll|\
|
||||
api-ms-win-*)
|
||||
kernel32.dll|msvcrt.dll|msvcp140.dll|vcruntime140.dll|ucrtbase.dll|\
|
||||
user32.dll|gdi32.dll|gdi32full.dll|shell32.dll|shlwapi.dll|advapi32.dll|\
|
||||
ole32.dll|oleaut32.dll|comdlg32.dll|comctl32.dll|ws2_32.dll|wsock32.dll|\
|
||||
iphlpapi.dll|netapi32.dll|dnsapi.dll|winmm.dll|imm32.dll|version.dll|\
|
||||
setupapi.dll|crypt32.dll|bcrypt.dll|ncrypt.dll|dbghelp.dll|kernelbase.dll|\
|
||||
rpcrt4.dll|psapi.dll|powrprof.dll|cfgmgr32.dll|userenv.dll|secur32.dll|\
|
||||
uxtheme.dll|dwmapi.dll|d3d11.dll|dxgi.dll|opengl32.dll|glu32.dll|\
|
||||
wtsapi32.dll|mpr.dll|api-ms-win-*)
|
||||
continue ;;
|
||||
esac
|
||||
[ -f "$BUILD_DIR/$dep" ] && continue
|
||||
if cp "/ucrt64/bin/$dep" "$BUILD_DIR/" 2>/dev/null; then
|
||||
if [ -d "$FFMPEG_BIN" ] && cp "$FFMPEG_BIN/$dep" "$BUILD_DIR/" 2>/dev/null; then
|
||||
log " OK: $dep (ffmpeg)"; next_todo="$next_todo $BUILD_DIR/$dep"
|
||||
elif cp "/ucrt64/bin/$dep" "$BUILD_DIR/" 2>/dev/null; then
|
||||
log " OK: $dep"; next_todo="$next_todo $BUILD_DIR/$dep"
|
||||
elif cp "/mingw64/bin/$dep" "$BUILD_DIR/" 2>/dev/null; then
|
||||
log " OK: $dep (mingw64)"; next_todo="$next_todo $BUILD_DIR/$dep"
|
||||
elif [ -d "$FFMPEG_BIN" ] && cp "$FFMPEG_BIN/$dep" "$BUILD_DIR/" 2>/dev/null; then
|
||||
log " OK: $dep (ffmpeg)"; next_todo="$next_todo $BUILD_DIR/$dep"
|
||||
fi
|
||||
done
|
||||
done
|
||||
todo="$next_todo"
|
||||
done
|
||||
shopt -u nocasematch
|
||||
# Qt platform plugin (loaded dynamically, not in import table)
|
||||
mkdir -p "$BUILD_DIR/platforms"
|
||||
for d in /ucrt64/share/qt5/plugins /ucrt64/lib/qt5/plugins; do
|
||||
@@ -86,6 +96,29 @@ done
|
||||
cp "$SRC_DIR/rlottie_build/librlottie.dll" "$BUILD_DIR/" 2>/dev/null && log " OK: librlottie.dll" || log " WARN: librlottie.dll not found"
|
||||
cp "$SRC_DIR/setup_firewall.bat" "$BUILD_DIR/" 2>/dev/null && log " OK: setup_firewall.bat" || log " WARN: setup_firewall.bat not found"
|
||||
|
||||
# Проверяем, что все ожидаемые не-Qt DLL на месте (FFmpeg + mingw-runtime + rlottie + zlib + OpenSSL)
|
||||
log " Verifying required non-Qt DLLs..."
|
||||
MISSING=0
|
||||
if [ -d "$FFMPEG_BIN" ]; then
|
||||
for d in avcodec-*.dll avformat-*.dll avutil-*.dll swscale-*.dll swresample-*.dll; do
|
||||
if ls "$BUILD_DIR/$d" >/dev/null 2>&1; then
|
||||
log " OK: $d"
|
||||
else
|
||||
log " WARN: $d MISSING in build dir"; MISSING=1
|
||||
fi
|
||||
done
|
||||
else
|
||||
log " SKIP: FFmpeg not built — no FFmpeg DLLs expected"
|
||||
fi
|
||||
for d in libstdc++-6.dll libgcc_s_*.dll libwinpthread-1.dll librlottie.dll zlib1.dll libcrypto-*.dll; do
|
||||
if ls "$BUILD_DIR/$d" >/dev/null 2>&1; then
|
||||
log " OK: $d"
|
||||
else
|
||||
log " WARN: $d MISSING in build dir"; MISSING=1
|
||||
fi
|
||||
done
|
||||
[ "$MISSING" -eq 1 ] && log " WARN: some required non-Qt DLLs missing — app may not start"
|
||||
|
||||
log ""
|
||||
log "[4/4] Verifying..."
|
||||
EXE="$BUILD_DIR/vibechat.exe"
|
||||
|
||||
Reference in new issue
Block a user