Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix potential crash issue

laurenspriemecf4ca779e4b
diff --git a/desktop/scripts/ml_parity_runner.ts b/desktop/scripts/ml_parity_runner.ts
index 534620030f..9a1c957ef0 100755
--- a/desktop/scripts/ml_parity_runner.ts
+++ b/desktop/scripts/ml_parity_runner.ts
@@ -498,11 +498,18 @@ const main = async () => {
const host = new HostClient(args.electronBinPath, args.hostScriptPath, args.userDataPath);
await host.setDecodeHelperSource(productionDecodeHelperSource());
- // `renderableImageBlob` checks these static build-time flags in shared web code.
- (globalThis as { electron?: { convertToJPEG: (imageData: Uint8Array) => Promise<Uint8Array> } }).electron =
- {
- convertToJPEG: (imageData: Uint8Array) => host.convertToJPEG(imageData),
+ // `renderableImageBlob` and shared logging helpers check this shim.
+ (globalThis as {
+ electron?: {
+ convertToJPEG: (imageData: Uint8Array) => Promise<Uint8Array>;
+ logToDisk: (message: string) => void;
};
+ }).electron = {
+ convertToJPEG: (imageData: Uint8Array) => host.convertToJPEG(imageData),
+ logToDisk: (message: string) => {
+ process.stderr.write(`${message}\n`);
+ },
+ };
const { renderableImageBlob } = await import(
"../../web/packages/gallery/services/convert.ts"
diff --git a/infra/ml/tools/run_suite.sh b/infra/ml/tools/run_suite.sh
index ca684dc0bf..bc15897d87 100755
--- a/infra/ml/tools/run_suite.sh
+++ b/infra/ml/tools/run_suite.sh
@@ -233,6 +233,8 @@ run_platform_runner() {
esac
}
+declare -a failed_platform_runners=()
+
for platform in "${selected_platforms[@]}"; do
set +e
run_platform_runner "$platform"
@@ -245,16 +247,23 @@ for platform in "${selected_platforms[@]}"; do
;;
1)
echo "Platform runner failed for $platform."
+ failed_platform_runners+=("$platform(exit=1)")
;;
2)
echo "Platform runner unavailable for $platform."
;;
*)
echo "Platform runner returned unexpected exit code $platform_run_exit for $platform."
+ failed_platform_runners+=("$platform(exit=$platform_run_exit)")
;;
esac
done
+if ((${#failed_platform_runners[@]} > 0)); then
+ echo "One or more platform runners failed: ${failed_platform_runners[*]}" >&2
+ exit 1
+fi
+
declare -a compare_args=()
missing_platform_count=0