From 1d1d341dc0ff3160e223c772018497019e15d5fd Mon Sep 17 00:00:00 2001 From: can1357 Date: Mon, 13 Apr 2026 00:59:48 +0200 Subject: [PATCH] fix(natives/scripts): fixed Linux host Zig target detection when report header is absent - Stored the process report in a local variable before reading the header for host detection. - Updated the type assertion so the header path is optional and guarded. - Kept the Linux zig target selection logic unchanged while fixing the runtime check. --- packages/natives/scripts/build-native.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/natives/scripts/build-native.ts b/packages/natives/scripts/build-native.ts index 82d7a7f47..d32807577 100644 --- a/packages/natives/scripts/build-native.ts +++ b/packages/natives/scripts/build-native.ts @@ -88,8 +88,8 @@ const effectiveVariant = resolveEffectiveVariant(); const variantSuffix = effectiveVariant ? `-${effectiveVariant}` : ""; function resolveLinuxHostZigTarget(): "x86_64-linux-gnu" | "x86_64-linux-musl" { - const header = process.report?.getReport?.().header as { glibcVersionRuntime?: string } | undefined; - return header?.glibcVersionRuntime ? "x86_64-linux-gnu" : "x86_64-linux-musl"; + const report = process.report?.getReport?.() as { header?: { glibcVersionRuntime?: string } } | undefined; + return report?.header?.glibcVersionRuntime ? "x86_64-linux-gnu" : "x86_64-linux-musl"; } function resolveSafeHostZigBuildConfig(): SafeHostZigBuildConfig | null {