Skip to content

oven-sh/zig

 
 

Bun's fork of zig

Upgrade info:

Process:

git fetch upstream
git fetch upstream --tags
git checkout 014-dev
git checkout -b upgrade-0.15.1
git reset --soft 0.14.1
git commit -m "our 0.14.1 patches"
git config --global merge.conflictstyle zdiff3
git rev-parse HEAD # COMMIT_ID
git reset --hard 0.15.1
git cherry-pick COMMIT_ID 
# to show the diff, `git diff 0.14.1 014-dev`
# alternatively, the changes can be made into a patch file and manually applied

if some parts fail (ie the file was renamed), remove them from the patch and apply them manually

resolve merge conflicts

  • Current is the new zig version
  • Base is the merge base
  • Incoming is our patch

commit

Building a Release build locally:

mkdir build
cd build
cmake .. -DZIG_STATIC_LLVM=ON -DZIG_STATIC_ZSTD=ON -DCMAKE_PREFIX_PATH="$(brew --prefix llvm@20);$(brew --prefix lld@20);$(brew --prefix zstd)" -DCMAKE_BUILD_TYPE=Release -GNinja -DZIG_NO_LIB=ON
ninja install

Building zig only given stage3

stage3/bin/zig build -p stage4 -Denable-llvm -Dno-lib

Updating CI:

  • If there was an llvm upgrade, need to upgrade zig-bootstrap ref and check that the sed commands will still work
  • Update zls
  • zls will silently be missing if the build fails in CI so test the build locally
  • search for /tsan|sanitize_thread/g. make sure every instance has the equivalent version for asan below it

About

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Zig 97.8%
  • C 1.3%
  • C++ 0.6%
  • Python 0.1%
  • CMake 0.1%
  • JavaScript 0.1%