54 lines
2 KiB
Markdown
54 lines
2 KiB
Markdown
|
|
# Zig 0.17.0 build failure transcript
|
||
|
|
|
||
|
|
## Environment
|
||
|
|
|
||
|
|
- Zig: 0.17.0-dev.387+31f157d80 (x86_64-linux)
|
||
|
|
- Herdr: v0.6.2, commit `ede2059` (with FreeBSD patches)
|
||
|
|
- OS: Debian 13 (debby)
|
||
|
|
- Rust: stable
|
||
|
|
|
||
|
|
## Full stderr
|
||
|
|
|
||
|
|
```
|
||
|
|
pkg/wuffs/src/c.zig:1:15: error: invalid builtin function: '@cImport'
|
||
|
|
pub const c = @cImport({
|
||
|
|
^~~~~~~~
|
||
|
|
build.zig:27:62: error: member function expected 4 argument(s), found 3
|
||
|
|
const file_version: ?[]const u8 = if (b.build_root.handle.readFileAlloc(
|
||
|
|
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
|
||
|
|
/home/samob/.local/zig-x86_64-linux-0.17.0-dev.387+31f157d80/lib/std/Io/Dir.zig:1323:5: note: function declared here
|
||
|
|
pub fn readFileAlloc(
|
||
|
|
~~~~^~
|
||
|
|
referenced by:
|
||
|
|
runBuild__anon_34429: /home/samob/.local/zig-x86_64-linux-0.17.0-dev.387+31f157d80/lib/std/Build.zig:2262:44
|
||
|
|
main: /home/samob/.local/zig-x86_64-linux-0.17.0-dev.387+31f157d80/lib/compiler/build_runner.zig:461:29
|
||
|
|
5 reference(s) hidden; use '-freference-trace=7' to see all references
|
||
|
|
src/build/zig.zig:13:9: error: Your Zig version v0.17.0-dev.387+31f157d80 does not meet the required build version of v0.15.2
|
||
|
|
@compileError(std.fmt.comptimePrint(
|
||
|
|
^~~~~~~~~~~~~
|
||
|
|
build.zig:16:24: note: called at comptime here
|
||
|
|
buildpkg.requireZig(minimum_zig_version);
|
||
|
|
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
|
||
|
|
|
||
|
|
thread 'main' (272349) panicked at build.rs:74:5:
|
||
|
|
zig build for vendored libghostty-vt failed: exit status: 2
|
||
|
|
```
|
||
|
|
|
||
|
|
## Root cause
|
||
|
|
|
||
|
|
Vendored `libghostty-vt` was written for Zig 0.15.2. Between 0.15.2 and 0.17.0:
|
||
|
|
|
||
|
|
1. `@cImport` builtin was removed (used in `pkg/wuffs/src/c.zig`)
|
||
|
|
2. `readFileAlloc` signature changed from 3 args to 4 args (used in `build.zig` build scripts)
|
||
|
|
3. `requireZig` compile-time check bails on version mismatch
|
||
|
|
|
||
|
|
## Fix
|
||
|
|
|
||
|
|
Install Zig 0.15.2: https://ziglang.org/download/0.15.2/zig-linux-x86_64-0.15.2.tar.xz
|
||
|
|
|
||
|
|
```bash
|
||
|
|
tar -xf zig-linux-x86_64-0.15.2.tar.xz -C ~/.local/
|
||
|
|
ln -sf ~/.local/zig-linux-x86_64-0.15.2/zig ~/.local/bin/zig
|
||
|
|
zig version # should print 0.15.2
|
||
|
|
```
|