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.
This commit is contained in:
can1357
2026-04-13 00:59:48 +02:00
parent 897c485ed4
commit 1d1d341dc0
+2 -2
View File
@@ -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 {