diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1e9b01889..7422479b5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: # Cross-compile the binary. We always use static building for this # because its the only way to access the headers. - name: Test Build - run: nix develop -c zig build -Dstatic=true -Dtarget=${{ matrix.target }} + run: nix develop -c zig build -fstage1 -Dstatic=true -Dtarget=${{ matrix.target }} test: strategy: @@ -58,8 +58,8 @@ jobs: nix_path: nixpkgs=channel:nixos-unstable - name: test - run: nix develop -c zig build test + run: nix develop -c zig build test -fstage1 - name: Test Dynamic Build - run: nix develop -c zig build -Dstatic=false + run: nix develop -c zig build -fstage1 -Dstatic=false diff --git a/Makefile b/Makefile index e36a844dd..b075cc164 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ init: # Slightly cursed way that we setup a dev version of this locally on NixOS. dev/install: - zig build -Dcpu=baseline -Drelease-fast + zig build -fstage1 -Dcpu=baseline -Drelease-fast if [ -f "/etc/NIXOS" ]; then patchelf --set-rpath "${LD_LIBRARY_PATH}" zig-out/bin/ghostty; fi mkdir -p ${HOME}/bin cp zig-out/bin/ghostty ${HOME}/bin/devtty diff --git a/README.md b/README.md index ab52a8ab6..75a5a3a56 100644 --- a/README.md +++ b/README.md @@ -75,12 +75,16 @@ on the [Zig downloads page](https://ziglang.org/download/). With Zig installed, a binary can be built using `zig build`: ```shell-session -$ zig build +$ zig build -fstage1 ... $ zig-out/bin/ghostty ``` +**Important: you must specify the `-fstage1` flag.** Ghostty can't yet be +built with the self-hosted Zig backend, so we have to use "stage1" (the +C++ LLVM backend). + This will build a binary for the currently running system (if supported). You can cross compile by setting `-Dtarget=`. For example, `zig build -Dtarget=aarch64-macos` will build for Apple Silicon macOS. Note diff --git a/flake.lock b/flake.lock index 650ef8d08..092e5053c 100644 --- a/flake.lock +++ b/flake.lock @@ -109,11 +109,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1662000959, - "narHash": "sha256-2wW8/BWusCtDYiHkF4/o4Se16qc/EbtMsZuQspTW4lY=", + "lastModified": 1662668669, + "narHash": "sha256-91R5xjCt1cLJBbYygtiQwXCex596/2cxsTneKUdnVwc=", "owner": "mitchellh", "repo": "zig-overlay", - "rev": "9c8e4148bdc806397900cb95c7d2b3f844ac7aff", + "rev": "6ed17531becf61347f4f30b62ad22d21e14fc4da", "type": "github" }, "original": { diff --git a/nix/overlay.nix b/nix/overlay.nix index ec5c2c9d6..c3f77e273 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -13,8 +13,8 @@ final: prev: rec { wraptest = prev.callPackage ./wraptest.nix { }; # zig we want to be the latest nightly since 0.9.0 is not released yet. - # NOTE: we are pinned to this master version because it broke at a certain - # point due to the self-hosted compiler. We'll fix this ASAP. - #zig = final.zigpkgs.master; - zig = final.zigpkgs.master-2022-08-19; + zig = final.zigpkgs.master; + + # last known working stage1 build, the rest in the future are stage3 + #zig = final.zigpkgs.master-2022-08-19; }