| Age | Commit message (Collapse) | Author | |
|---|---|---|---|
| 2025-09-18 | build: explicitly suffix generated Zig source files | Leah Amelia Chen | |
| Previously we're just feeding the compiler source files generated via capturing stdout, which all by default have the filename `stdout`. Under some particular yet uncertain circumstances in Zig 0.14 (only factor we've found so far is a large amount of cores/compilation shards) the compiler will actually crash on an unreachable code path that assumes all source files either end in .zig or .zon, causing crashes for packagers for distros like Nixpkgs and Gentoo. Given this has been explicitly made illegal in Zig 0.15 (see ziglang/zig#24957) I don't really see why we shouldn't fix this for 1.2 too. We have to do this at some point no matter what anyways. | |||
| 2025-05-19 | build: add unwind tables and frame pointers to debug/test builds | Mitchell Hashimoto | |
| This fixes an issue where stack traces were unreliable on some platforms (namely aarch64-linux in a MacOS VM). I'm unsure if this is a bug in Zig (defaults should be changed?) or what, because this isn't necessary on other platforms, but this works around the issue. I've unconditionally enabled this for all platforms, depending on build mode (debug/test) and not the target. This is because I don't think there is a downside for other platforms but if thats wrong we can fix that quickly. Some binaries have this unconditionally enabled regardless of build mode (e.g. the Unicode tables generator) because having symbols in those cases is always useful. Some unrelated GTK test fix is also included here. I'm not sure why CI didn't catch this (perhaps we only run tests for none-runtime) but all tests pass locally and we can look into that elsewhere. | |||
| 2025-03-11 | Zig 0.14 | Mitchell Hashimoto | |
| 2025-01-07 | This is a major refactor of `build.zig`. | Mitchell Hashimoto | |
| The major idea behind the refactor is to split the `build.zig` file up into distinct `src/build/*.zig` files. By doing so, we can improve readability of the primary `build.zig` while also enabling better reuse of steps. Our `build.zig` is now less than 150 lines of code (of course, it calls into a lot more lines but they're neatly organized now). Improvements: * `build.zig` is less than 150 lines of readable code. * Help strings and unicode table generators are only run once when multiple artifacts are built since the results are the same regardless of target. * Metal lib is only built once per architecture (rather than once per artifact) * Resources (shell integration, terminfo, etc.) and docs are only built/installed for artifacts that need them Breaking changes: * Removed broken wasm build (@gabydd will re-add) * Removed conformance files, shell scripts are better and we don't run these anymore * Removed macOS app bundle creation, we don't use this anymore since we use Xcode ## Some History Our `build.zig` hasn't been significantly refactored since the project started, when Zig was _version 0.10_. Since then, the build system has changed significantly. We've only ever duct taped the `build.zig` as we needed to support new Zig versions, new features, etc. It was a mess. The major improvement is adapting the entire Ghostty `build.zig` to the Step and LazyPath changes introduced way back in Zig 0.12. This lets us better take advantage of parallelism and the dependency graph so that steps are only executed as they're needed. As such, you can see in the build.zig that we initialize a lot of things, but unless a final target (i.e. install, run) references those steps, _they'll never be executed_. This lets us clean up a lot. | |||
