# Error when compiling Zig from source

**URL:** <https://ziggit.dev/t/error-when-compiling-zig-from-source/8650>\
**Category:** Help\
**Tags:** compiler\
**Created:** [February 18, 2025, 8:28pm UTC](https://ziggit.dev/t/error-when-compiling-zig-from-source/8650 "2025-02-18T20:28:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Negolng](https://ziggit.dev/user_avatar/ziggit.dev/negolng/32/4590_2.png) [@Negolng](https://ziggit.dev/u/Negolng)\
**Post date:** [February 18, 2025, 8:28pm UTC](https://ziggit.dev/t/error-when-compiling-zig-from-source/8650/1 "2025-02-18T20:28:32Z")

</div>

Hello, Zig Community!

I am using Zig compiler version `0.14.0-dev.3224+5ab511307`, which I compiled from source on my Arch Linux PC (with all packages up to date).

Today I wanted to update it by `git pull`-ing the [latest version](https://github.com/ziglang/zig/commit/0779e847f79851419dfeb39595b1817ce72ea9fa) from github and then running `sudo zig build install --release=fast -Dcpu=native`. I used the same flags to compile the previous Zig version.

After some time time the compilation process failed with this error:

```zig
negolng@negolng-arch ~/zig (master)> sudo zig build install --release=fast -Dcpu=native
install
└─ install zig
   └─ zig build-exe zig ReleaseFast native 2 errors
src/codegen/llvm.zig:101:10: error: no field named 'propeller' in enum 'Target.Cpu.Arch'
        .propeller,
        ~^ ~~~~~~~~
/usr/local/lib/zig/std/Target.zig:1341:22: note: enum declared here
    pub const Arch = enum {
                     ^~~~
src/target.zig:198:10: error: no field named 'propeller' in enum 'Target.Cpu.Arch'
        .propeller,
        ~^ ~~~~~~~~
/usr/local/lib/zig/std/Target.zig:1341:22: note: enum declared here
    pub const Arch = enum {
                     ^~~~
error: the following command failed with 2 compilation errors:
/usr/local/bin/zig build-exe --stack 48234496 -fno-sanitize-thread -OReleaseFast --dep aro --dep aro_translate_c --dep build_options -Mroot=/home/negolng/zig/src/main.zig -Maro=/home/negolng/zig/lib/compiler/aro/aro.zig --dep aro -Maro_translate_c=/home/negolng/zig/lib/compiler/aro_translate_c.zig -Mbuild_options=/home/negolng/zig/.zig-cache/c/d743ca96a7253c20cdb7b85e6646bf30/options.zig --cache-dir /home/negolng/zig/.zig-cache --global-cache-dir /root/.cache/zig --name zig --zig-lib-dir /usr/local/lib/zig/ --listen=- 
Build Summary: 289/292 steps succeeded; 1 failed
install transitive failure
└─ install zig transitive failure
   └─ zig build-exe zig ReleaseFast native 2 errors
error: the following build command failed with exit code 1:
/home/negolng/zig/.zig-cache/o/d2af8acc3e92eb0fe3a3911a66979daa/build /usr/local/bin/zig /usr/local/lib/zig /home/negolng/zig /home/negolng/zig/.zig-cache /root/.cache/zig --seed 0x2d9f25de -Z7cd016cc7dacb8b5 install --release=fast -Dcpu=native

```

I tried cleaning the build cache by `sudo rm -rf .zig-cache` and then re-building it without any flags (`sudo zig build install`) or with the `--release=safe` flag only, but goth the same error message both times.

I am still new to Zig and I have no idea how to solve this issue, so thanks in advance, I will appreciate any help! 🙂

---

<div class="post-metadata">

**Author:** ![dimdin](https://ziggit.dev/user_avatar/ziggit.dev/dimdin/32/1457_2.png) [@dimdin](https://ziggit.dev/u/dimdin)\
**Post date:** [February 18, 2025, 8:37pm UTC](https://ziggit.dev/t/error-when-compiling-zig-from-source/8650/2 "2025-02-18T20:37:18Z")

</div>

Hello @Negolng

zig 0.14 requires llvm 19.x  
What is your llvm version? (run `llvm-config --version`)

---

<div class="post-metadata">

**Author:** ![Negolng](https://ziggit.dev/user_avatar/ziggit.dev/negolng/32/4590_2.png) [@Negolng](https://ziggit.dev/u/Negolng)\
**Post date:** [February 18, 2025, 8:40pm UTC](https://ziggit.dev/t/error-when-compiling-zig-from-source/8650/3 "2025-02-18T20:40:26Z")

</div>

Seems like my version satisfies the requirements. It is `19.1.7`.

---

<div class="post-metadata">

**Author:** ![dimdin](https://ziggit.dev/user_avatar/ziggit.dev/dimdin/32/1457_2.png) [@dimdin](https://ziggit.dev/u/dimdin)\
**Post date:** [February 18, 2025, 9:38pm UTC](https://ziggit.dev/t/error-when-compiling-zig-from-source/8650/4 "2025-02-18T21:38:18Z")

</div>

`propeller` is declared at: [zig/lib/std/Target.zig at 4720a79477e7f0faf30bcce3ea4bfd3056469a79 · ziglang/zig · GitHub](https://github.com/ziglang/zig/blob/4720a79477e7f0faf30bcce3ea4bfd3056469a79/lib/std/Target.zig#L1320-L1350)

try again to `git pull` with fast forward or rebase if you have changes.

---

<div class="post-metadata">

**Author:** ![andrewrk](https://ziggit.dev/user_avatar/ziggit.dev/andrewrk/32/7011_2.png) [@andrewrk](https://ziggit.dev/u/andrewrk)\
**Post date:** [February 18, 2025, 11:01pm UTC](https://ziggit.dev/t/error-when-compiling-zig-from-source/8650/5 "2025-02-18T23:01:16Z")

</div>

> `sudo`

I recommend to never use `sudo` to install any software, ever, including Zig.

Leave your package manage to manage your root-owned directories.

When building from source, a good prefix is `~/.local`. With `zig build`, that would be `-p ~/.local`.

To build from source, please follow [the instructions](https://github.com/ziglang/zig/wiki/Contributing#editing-source-code). If you only want to use Zig and not contribute to it, I recommend instead to [download it](https://ziglang.org/download/).

---

<div class="post-metadata">

**Author:** ![Negolng](https://ziggit.dev/user_avatar/ziggit.dev/negolng/32/4590_2.png) [@Negolng](https://ziggit.dev/u/Negolng)\
**Post date:** [February 19, 2025, 9:33am UTC](https://ziggit.dev/t/error-when-compiling-zig-from-source/8650/6 "2025-02-19T09:33:15Z")

</div>

Thanks a lot! 😃

Seems like I have finally figured it out. I re-installed everything into `~/.local` without `sudo` and it works now! Seems like the problem was with the `sudo` installation.

But since I want to only use Zig without contributing, I decided to switch to using the [AUR package](https://aur.archlinux.org/packages/zig-nightly-bin) instead of compiling it by myself.
