https://codeberg.org/ziglang/zig/issues/32123
This bug can only be reproduced using the btrfs file system.
https://codeberg.org/ziglang/zig/issues/32123
This bug can only be reproduced using the btrfs file system.
I’m using the Cachyos system: Linux 7.0.1-1-cachyos.
However, I don’t believe this is due to Cachyos itself; it’s solely caused by the btrfs file system. Using the ext4 file system on this system wouldn’t cause this bug.
I can reproduce that issue on btrfs on Ubuntu 22.04 LTS, and not with ext4 on the same machine.
I posted the output in a reply on your issue.
The patch you posted there did not work for me, not even after I cleaned the cache and re-compiled (on btrfs).
After modifying the Elf2.zig file, did you recompile the Release version of zig? This requires recompiling the new zig.
No sorry, I am stupid. I just changed the source code and compiled with the released 0.16.0, but that of course doesn’t help. I’ll try to find some time to redo that later on.
I compiled the 0.16.0 checkout on ext4 with the release 0.16.0 compiler, and although the result will show error: process terminated with signal ABRT when compiling anything (compiled with or without the patches, on 0.16.0 source both on ext4 and btrfs partitions).
I am not familiar enough with compiling zig itself, I get a Compiler crash context, and don’t know how to interpret the output of /tmp/zigcode/build/stage4/bin/zig ast-check -t src/main.zig
It seems there’s a problem with the compiled Zig.
I usually use the method recommended in the Zig project README to build it via make.
Build LLVM (takes about half an hour, but it’s a one-time build and can be used in the next major version, The following build llvm-21, which is suitable for zig 0.16.0. The master branch needs to build llvm-22.)
cd ~/Downloads
git clone --depth 1 --branch release/21.x https://github.com/llvm/llvm-project llvm-project-21
cd llvm-project-21
git checkout release/21.x
mkdir build-release
cd build-release
cmake ../llvm \
-DCMAKE_INSTALL_PREFIX=$HOME/local/llvm21-assert \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_PROJECTS="lld;clang" \
-DLLVM_ENABLE_LIBXML2=OFF \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_ENABLE_LIBEDIT=OFF \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_PARALLEL_LINK_JOBS=1 \
-G Ninja
ninja install
Build the release version of Zig
~/gitcode/zig master
❯ git checkout 0.16.0
HEAD 目前位于 24fdd5b7a4 Release 0.16.0
~/gitcode/zig tags/0.16.0^0
❯ mkdir build
~/gitcode/zig tags/0.16.0^0
❯ cd build/
~/gitcode/zig/build tags/0.16.0^0
❯ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=$HOME/local/llvm21-assert -DZIG_EXTRA_BUILD_ARGS="-Dno-langref;"
.....
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/hk/gitcode/zig/build
~/gitcode/zig/build tags/0.16.0^0
❯ make install