Skip to content

Commit

Permalink
fix(napi): build error with zig@0.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Jan 20, 2023
1 parent c51d657 commit 2f52793
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/zig.yaml
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Install ziglang
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.10.0
version: 0.10.1
- name: Install dependencies
run: yarn install --immutable --mode=skip-build
- name: 'Build TypeScript'
Expand Down
18 changes: 11 additions & 7 deletions cli/src/build.ts
Expand Up @@ -844,14 +844,18 @@ async function patchArmFeaturesHForArmTargets() {
const p = zigLibDir
? join(zigLibDir, 'libc/glibc/sysdeps/arm/arm-features.h')
: join(zigExePath, '../lib/libc/glibc/sysdeps/arm/arm-features.h')
await writeFileAsync(p, ARM_FEATURES_H, {
mode: 0o644,
})
if (!existsSync(p)) {
await writeFileAsync(p, ARM_FEATURES_H, {
mode: 0o644,
})
}
} catch (e) {
throw new Error(
`Cannot patch arm-features.h, error: ${
(e as Error).message || e
}. See: https://github.com/ziglang/zig/issues/3287`,
console.error(
Error(
`Cannot patch arm-features.h, error: ${
(e as Error).message || e
}. See: https://github.com/ziglang/zig/issues/3287`,
),
)
}
}

0 comments on commit 2f52793

Please sign in to comment.