This commit is contained in:
Your Name
2026-08-11 09:12:51 +08:00
parent c3ceb0dd0f
commit cfe4c82c90
111 changed files with 26110 additions and 826 deletions
+99 -53
View File
@@ -29,11 +29,44 @@ helper="$(find "$artifact" -type f -name 'QtWebEngineProcess' -print -quit)"
resources="$(find "$artifact" -type f -name 'qtwebengine_resources*.pak' -print -quit)"
companion="$(find "$artifact" -type f -path '*video_companion_dist/index.html' -print -quit)"
executable="$artifact/Contents/MacOS/DoctorWorkstation"
qt_multimedia_module="$(find "$artifact" -type f -name 'QtMultimedia*.so' \
! -name 'QtMultimediaWidgets*.so' -print -quit)"
qt_multimedia_widgets_module="$(find "$artifact" -type f -name 'QtMultimediaWidgets*.so' -print -quit)"
qt_multimedia_framework="$(find "$artifact" -type d -name 'QtMultimedia.framework' -print -quit)"
qt_multimedia_widgets_framework="$(find "$artifact" -type d -name 'QtMultimediaWidgets.framework' -print -quit)"
qt_multimedia_dylib="$(find "$artifact" -type f -name '*Qt6Multimedia*.dylib' \
! -name '*Widgets*' ! -name '*Quick*' -print -quit)"
qt_multimedia_widgets_dylib="$(find "$artifact" -type f -name '*Qt6MultimediaWidgets*.dylib' -print -quit)"
multimedia_plugin_dir="$(find "$artifact" -type d -path '*/plugins/multimedia' -print -quit)"
multimedia_backend=""
if [[ -n "$multimedia_plugin_dir" ]]; then
multimedia_backend="$(find "$multimedia_plugin_dir" -type f \
\( -name '*mediaplugin*.dylib' -o -name '*mediaplugin*.so' \) -print -quit)"
fi
[[ -n "$helper" ]] || { echo "QtWebEngineProcess is missing from the app." >&2; exit 1; }
[[ -n "$resources" ]] || { echo "QtWebEngine resources are missing from the app." >&2; exit 1; }
[[ -n "$companion" ]] || { echo "video_companion_dist is missing from the app." >&2; exit 1; }
[[ -x "$executable" ]] || { echo "Frozen application entry point is missing." >&2; exit 1; }
[[ -n "$qt_multimedia_module" ]] || {
echo "PySide6.QtMultimedia is missing from the app." >&2; exit 1;
}
[[ -n "$qt_multimedia_widgets_module" ]] || {
echo "PySide6.QtMultimediaWidgets is missing from the app." >&2; exit 1;
}
[[ -n "$qt_multimedia_framework" || -n "$qt_multimedia_dylib" ]] || {
echo "Qt6Multimedia framework/dylib is missing from the app." >&2; exit 1;
}
[[ -n "$qt_multimedia_widgets_framework" || -n "$qt_multimedia_widgets_dylib" ]] || {
echo "Qt6MultimediaWidgets framework/dylib is missing from the app." >&2; exit 1;
}
[[ -n "$multimedia_plugin_dir" ]] || {
echo "PySide6 plugins/multimedia is missing from the app." >&2; exit 1;
}
[[ -n "$multimedia_backend" ]] || {
echo "A Qt multimedia platform/FFmpeg backend plugin is missing from the app." >&2; exit 1;
}
echo "Frozen Qt multimedia file gate passed."
codesign --verify --deep --strict --verbose=2 "$artifact"
@@ -55,58 +88,71 @@ mkdir -p \
"$smoke_root/xdg/cache" \
"$smoke_root/tmp"
set +e
env \
TMPDIR="$smoke_root/tmp" \
XDG_CONFIG_HOME="$smoke_root/xdg/config" \
XDG_STATE_HOME="$smoke_root/xdg/state" \
XDG_CACHE_HOME="$smoke_root/xdg/cache" \
DOCTOR_CONFIG_DIR="$smoke_root/doctor/config" \
DOCTOR_LOG_DIR="$smoke_root/doctor/logs" \
DOCTOR_API_BASE_URL="https://127.0.0.1:9" \
DOCTOR_DEMO_MODE="true" \
DOCTOR_VIDEO_MODE="embedded" \
DOCTOR_VIDEO_WEB_URL="" \
DOCTOR_VERIFY_SSL="true" \
DOCTOR_LOG_LEVEL="INFO" \
DOCTOR_SMOKE_TEST="1" \
HTTP_PROXY="http://127.0.0.1:9" \
HTTPS_PROXY="http://127.0.0.1:9" \
ALL_PROXY="http://127.0.0.1:9" \
NO_PROXY="" \
QT_QPA_PLATFORM="offscreen" \
"$executable" --smoke-test >"$smoke_root/stdout.txt" 2>"$smoke_root/stderr.txt" &
smoke_pid=$!
smoke_running=1
for _ in {1..300}; do
if ! kill -0 "$smoke_pid" 2>/dev/null; then
smoke_running=0
break
fi
sleep 0.1
done
if [[ "$smoke_running" == "1" ]]; then
kill "$smoke_pid" 2>/dev/null
wait "$smoke_pid" 2>/dev/null
smoke_status=124
else
wait "$smoke_pid"
smoke_status=$?
fi
set -e
run_frozen_gate() {
local gate_slug="$1"
local gate_label="$2"
local gate_argument="$3"
local stdout_file="$smoke_root/$gate_slug-stdout.txt"
local stderr_file="$smoke_root/$gate_slug-stderr.txt"
local diagnostics="$smoke_root/$gate_slug-diagnostics.txt"
local smoke_pid smoke_running smoke_status
if [[ "$smoke_status" -ne 0 ]]; then
cat "$smoke_root/stderr.txt" >&2
echo "Frozen application smoke test failed with exit code $smoke_status." >&2
exit 1
fi
diagnostics="$smoke_root/diagnostics.txt"
cat "$smoke_root/stdout.txt" "$smoke_root/stderr.txt" >"$diagnostics"
find "$smoke_root" -type f -name '*.log' -exec cat {} + >>"$diagnostics"
if grep -Eiq 'traceback \(most recent call last\)|unhandled exception|uncaught exception|fatal python error' "$diagnostics"; then
cat "$diagnostics" >&2
echo "Frozen application smoke-test logs contain an unhandled exception." >&2
exit 1
fi
echo "Frozen entry smoke test passed (--smoke-test, isolated demo mode)."
env \
TMPDIR="$smoke_root/tmp" \
XDG_CONFIG_HOME="$smoke_root/xdg/config" \
XDG_STATE_HOME="$smoke_root/xdg/state" \
XDG_CACHE_HOME="$smoke_root/xdg/cache" \
DOCTOR_CONFIG_DIR="$smoke_root/doctor/config" \
DOCTOR_LOG_DIR="$smoke_root/doctor/logs" \
DOCTOR_API_BASE_URL="https://127.0.0.1:9" \
DOCTOR_DEMO_MODE="true" \
DOCTOR_VIDEO_MODE="embedded" \
DOCTOR_VIDEO_WEB_URL="" \
DOCTOR_VERIFY_SSL="true" \
DOCTOR_LOG_LEVEL="INFO" \
DOCTOR_SMOKE_TEST="1" \
HTTP_PROXY="http://127.0.0.1:9" \
HTTPS_PROXY="http://127.0.0.1:9" \
ALL_PROXY="http://127.0.0.1:9" \
NO_PROXY="" \
QT_QPA_PLATFORM="offscreen" \
"$executable" "$gate_argument" >"$stdout_file" 2>"$stderr_file" &
smoke_pid=$!
smoke_running=1
for _ in {1..300}; do
if ! kill -0 "$smoke_pid" 2>/dev/null; then
smoke_running=0
break
fi
sleep 0.1
done
if [[ "$smoke_running" == "1" ]]; then
kill "$smoke_pid" 2>/dev/null || true
wait "$smoke_pid" 2>/dev/null || true
smoke_status=124
elif wait "$smoke_pid"; then
smoke_status=0
else
smoke_status=$?
fi
if [[ "$smoke_status" -ne 0 ]]; then
cat "$stderr_file" >&2
echo "$gate_label failed with exit code $smoke_status." >&2
exit 1
fi
cat "$stdout_file" "$stderr_file" >"$diagnostics"
find "$smoke_root" -type f -name '*.log' -exec cat {} + >>"$diagnostics"
if grep -Eiq 'traceback \(most recent call last\)|unhandled exception|uncaught exception|fatal python error' "$diagnostics"; then
cat "$diagnostics" >&2
echo "$gate_label logs contain an unhandled exception." >&2
exit 1
fi
echo "$gate_label passed ($gate_argument, isolated offscreen mode)."
}
run_frozen_gate \
"media" "Frozen Qt multimedia smoke gate" "--media-smoke-test"
run_frozen_gate \
"entry" "Frozen application entry smoke gate" "--smoke-test"
echo "Build complete: $artifact"