Package Details: zig-git 0.11.0.r3596.gfbb38a7682-1

Git Clone URL: https://aur.archlinux.org/zig-git.git (read-only, click to copy)
Package Base: zig-git
Description: a programming language prioritizing robustness, optimality, and clarity
Upstream URL: https://ziglang.org
Keywords: compiler language programming zig ziglang
Licenses: MIT
Conflicts: zig
Provides: zig
Submitter: PedroHLC
Maintainer: leopoldek
Last Packager: leopoldek
Votes: 12
Popularity: 0.002001
First Submitted: 2016-08-09 17:43 (UTC)
Last Updated: 2024-04-08 18:38 (UTC)

Required by (66)

Sources (1)

Latest Comments

1 2 3 4 5 Next › Last »

edtoml commented on 2023-04-10 13:45 (UTC) (edited on 2023-06-17 12:30 (UTC) by edtoml)

Jun 17th update. To build the latest zig I use the following process. First build a local copy of llvm 16

cd ~/llvm
git clone --depth 1 --branch release/16.x https://github.com/llvm/llvm-project llvm-project-16
cd llvm-project-16
git checkout release/16.x
mkdir build
cd build
cmake ../llvm \
  -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm16 \
  -DCMAKE_PREFIX_PATH=$HOME/local/llvm16 \
  -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 \
  -G Ninja \
  -DLLVM_PARALLEL_LINK_JOBS=1 \
  -DLLVM_ENABLE_BINDINGS=OFF
ninja install

Second use your local llvm to build zig. Using the yay pacman wrapper:

PATH=$HOME/local/llvm16:$PATH yay -S --editmenu zig-git

Third edit the pkgbuild when requested (third question yay asks) replacing the cmake command with:

    cmake -B build -S zig \
        -DCMAKE_PREFIX_PATH="$HOME/local/llvm16;$HOME/local" \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=None \
        -DZIG_STATIC_LLVM=ON 

The DCMAKE_PREFIX_PATH needs to be added and ZIG_SHARED_LLVM=ON has to be changed to ZIG_STATIC_LLVM=ON.

alex_courtis commented on 2023-01-15 04:21 (UTC)

An alternative to zig-dev-bin (0.11.x at time of writing) is zig-static which is at a more stable 0.10.0

leopoldek commented on 2022-12-23 04:26 (UTC) (edited on 2022-12-23 04:28 (UTC) by leopoldek)

Since llvm15 is taking awhile to make it to the core repos, I've gone ahead and updated to the latest commit ahead of time. This means that you will need to compile your own copy of llvm15 and point to it using something like CMAKE_PREFIX_PATH. Or package llvm15 yourself. Or you can use the zig-dev-bin package also on the AUR which downloads a binary and doesn't require llvm as a build dependency.

Note that the AUR llvm-git package won't work as that compiles llvm16 and Zig checks for llvm15 specifically.

edtoml commented on 2022-10-23 00:37 (UTC)

The Zig devs fixed a problem where stage3 was being built twice... This means that we need to add 'cmake --install build' after 'cmake --build build'.

edtoml commented on 2022-10-18 18:11 (UTC) (edited on 2022-10-18 18:16 (UTC) by edtoml)

With llvm 15.0.3 "-DLLVM_USE_STATIC_ZSTD=ON" is no longer required when building llvm. When building zig, the PKGBUILD needs to be updated, removing the "#commit=e2...fd" and adding "-DCMAKE_PREFIX_PATH=$HOME/local/llvm15 \" to the cmake command.

edtoml commented on 2022-10-13 16:29 (UTC) (edited on 2022-10-13 16:30 (UTC) by edtoml)

An update as to what to do to build with a local copy of llvm15.
- As of zig 0.10.0-dev.4333+f5f28e0d2 the patch from 12888 is no longer required.
- The commit still needs to be removed from the PKGBUILD.
- With llvm 15.0.2 you need to add -DLLVM_USE_STATIC_ZSTD=ON to the llvm make command shown below.

edtoml commented on 2022-09-23 20:24 (UTC)

The package build has been updated to build the last version of zig that builds with llvm 14. If you want to build master, in addition to changes I posted below, you now need to remove the #commit=e2bb92b2e27dc54852a0227345e294ae383358fd from the source.

source=("git+https://github.com/ziglang/zig.git#commit=e2bb92b2e27dc54852a0227345e294ae383358fd")

edtoml commented on 2022-09-18 12:30 (UTC) (edited on 2022-09-18 12:30 (UTC) by edtoml)

Zig updated to llvm15. Looks like Arch is taking time to integrate llvm15. I my opinion creating a local copy of llvm is the way to go. This is what I use:

cd ~/llvm
git clone --depth 1 --branch release/15.x https://github.com/llvm/llvm-project llvm-project-15
cd llvm-project-15
git checkout release/15.x
mkdir build
cd build
make ../llvm -DCMAKE_INSTALL_PREFIX=$HOME/local/llvm15 -DCMAKE_PREFIX_PATH=$HOME/local/llvm15 -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="lld;clang" -DLLVM_ENABLE_LIBXML2=OFF -DLLVM_ENABLE_TERMINFO=OFF  -DLL
VM_ENABLE_LIBEDIT=OFF  -DLLVM_ENABLE_ASSERTIONS=ON  -G Ninja  -DLLVM_PARALLEL_LINK_JOBS=1 -DLLVM_ENABLE_BINDINGS=OFF
ninja install

Read zig issue 12888: https://github.com/ziglang/zig/issues/12888 and manually update the PKGBUILD as per the issue. I use:

PATH=$HOME/local/llvm15:$PATH yay -S --editmenu zig-git

misilelaboratory commented on 2022-09-15 08:54 (UTC) (edited on 2022-09-15 08:54 (UTC) by misilelaboratory)

I can't build it, because zig need llvm 15 (not 14)