ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
34.04k stars 2.49k forks source link

Build error when trying to upgrade https://git.sr.ht/~mil/fbp from 0.9.1 to 0.10.0 #14067

Open light4 opened 1 year ago

light4 commented 1 year ago

Zig Version

0.10.0

Steps to Reproduce and Observed Behavior

Build error when trying to upgrade https://git.sr.ht/~mil/fbp to 0.10.0 Is this a tranlsate-c bug? Already fixed some break changes like std.fs.OpenOption.

~/s/fbp on  master [!?] via ↯ v0.10.0 🕙 19:07:23                                                                                       
❯ zig build -Drelease-small=true -Dtarget=aarch64-linux-musl                                                                             
/home/light4/sources/fbp/zig-cache/o/ad7f85495eecff7a52204bf550494c3e/cimport.zig:828:126: error: expected type 'c_uint', found 'c_int'
pub inline fn _IOC(a: anytype, b: anytype, c: anytype, d: anytype) @TypeOf((((a << @as(c_int, 30)) | (b << @as(c_int, 8))) | c) | (d << @
as(c_int, 16))) {                                                                                                                        
                                                                                                                             ^
/home/light4/sources/fbp/zig-cache/o/ad7f85495eecff7a52204bf550494c3e/cimport.zig:828:126: note: unsigned 32-bit int cannot represent all
 possible signed 32-bit values                                      
referenced by:                                                      
    _IOW: /home/light4/sources/fbp/zig-cache/o/ad7f85495eecff7a52204bf550494c3e/cimport.zig:837:64
    UI_SET_EVBIT: /home/light4/sources/fbp/zig-cache/o/ad7f85495eecff7a52204bf550494c3e/cimport.zig:2050:26
    remaining reference traces hidden; use '-freference-trace' to see all reference traces

error: fbp...
error: The following command exited with error code 1:
/usr/bin/zig build-exe /home/light4/sources/fbp/src/main.zig -lc /home/light4/sources/fbp/zig-cache/o/09dd01065f140282cad92b7e63bf064a/li
bfreetype.a -lc -OReleaseSmall --cache-dir /home/light4/sources/fbp/zig-cache --global-cache-dir /home/light4/.cache/zig --name fbp -targ
et aarch64-linux-musl -mcpu generic --pkg-begin freetype /home/light4/sources/fbp/libs/mach-freetype/src/main.zig --pkg-end -I /home/ligh
t4/sources/fbp/libs/mach-freetype/upstream/freetype/include --enable-cache 
error: the following build command failed with exit code 1:
/home/light4/sources/fbp/zig-cache/o/f24194d8e38a7c2cceae6fdc3d4da99f/build /usr/bin/zig /home/light4/sources/fbp /home/light4/sources/fb
p/zig-cache /home/light4/.cache/zig -Drelease-small=true -Dtarget=aarch64-linux-musl

Expected Behavior

Build ok.

Vexu commented 1 year ago

Same as #13162 but for |

perillo commented 1 year ago

I think this issue has been fixed. After updating the code to the latest compiler version, zig build builds correctly.

@light4, can you confirm it?