Commit e82a3e9
committed
feat: Zig 0.16.0 compatibility — cross-compile, CLI args, process spawn
## Cross-compilation fixes (Zig 0.16.0 API changes)
- Replace std.c.stat with Io.Dir.cwd().statFile — std.c removed from
cross-compilation C headers in Zig 0.16.0
- Rename Permissions.unixNew → Permissions.fromMode — API renamed
- Remove unused arena parameter from maybe_install_musl_runtime
(arena.dupeZ replaced by statFile which takes a string directly)
- Comptime-guard the musl runtime call site to avoid unused-parameter
warnings on macOS (the function only runs on Linux)
## Process spawning (cross-platform)
- Replace std.process.replace with std.process.spawn + child.wait
std.process.replace does not work reliably on macOS arm64 in Zig 0.16.0
- Unify Windows/Unix code paths — both use the same spawn+wait pattern
(removes the broken Windows-only std.process.Child.spawnAndWait)
- Use .exited (lowercase) for Child.Term enum, var for mutable Child
## CLI argument passing
- Pass CLI args via ADO_ARGS environment variable in the Zig wrapper
(the -extra BEAM flag does not reliably reach init:get_plain_arguments()
in certain release configurations)
- Join args_trimmed into a space-separated string and set as ADO_ARGS
All targets compile: macOS (arm64/x86_64), Linux (x86_64/arm64), Windows (x86_64)1 parent de9c866 commit e82a3e9
2 files changed
Lines changed: 44 additions & 46 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
50 | 67 | | |
51 | 68 | | |
52 | 69 | | |
| |||
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
| 87 | + | |
| 88 | + | |
95 | 89 | | |
96 | | - | |
| 90 | + | |
97 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | 101 | | |
105 | | - | |
106 | | - | |
107 | 102 | | |
108 | 103 | | |
109 | 104 | | |
110 | 105 | | |
111 | 106 | | |
112 | 107 | | |
113 | 108 | | |
| 109 | + | |
114 | 110 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
227 | 225 | | |
228 | | - | |
| 226 | + | |
229 | 227 | | |
230 | | - | |
| 228 | + | |
231 | 229 | | |
232 | 230 | | |
233 | 231 | | |
| |||
237 | 235 | | |
238 | 236 | | |
239 | 237 | | |
240 | | - | |
| 238 | + | |
241 | 239 | | |
242 | 240 | | |
243 | 241 | | |
| |||
0 commit comments