diff options
| author | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | 2022-09-08 13:31:18 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | 2022-09-08 13:46:05 -0700 |
| commit | d7d372124b54100504f6d30cac1d2084cf998af7 (patch) | |
| tree | cbdeacb03c6ac016079841cba258899991bfef0c | |
| parent | 97aef76501e05bad02a99284c85e5aad97beca6a (diff) | |
update to stage3 zig with -fstage1
| -rw-r--r-- | .github/workflows/test.yml | 6 | ||||
| -rw-r--r-- | Makefile | 2 | ||||
| -rw-r--r-- | README.md | 6 | ||||
| -rw-r--r-- | flake.lock | 6 | ||||
| -rw-r--r-- | nix/overlay.nix | 8 |
5 files changed, 16 insertions, 12 deletions
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 @@ -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 @@ -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=<target-triple>`. 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; } |
