47 Commits

Author SHA1 Message Date
Mitchell Hashimoto
7e2286eb8c Zig 0.14 2025-03-11 14:39:04 -07:00
Mitchell Hashimoto
8bf5c4ed7f This is a major refactor of build.zig.
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.
2025-01-07 19:47:43 -08:00
Leah Amelia Chen
31439f311d build: add wayland 2025-01-05 12:27:11 -08:00
Jeffrey C. Ollie
cb8d30f938 core: add build option to disable sentry 2025-01-02 13:32:45 -08:00
Jeffrey C. Ollie
8ecb11a602 gtk: add option to not link against libX11 2024-12-28 13:40:17 -06:00
Mitchell Hashimoto
8f15f1a066 Make Ghostty release channel aware
Ghostty now has a release channel build configuration. Current valid
values are "tip" and "stable" but I imagine more will be added in the
future.

The release channel is inferred whether the version we specify with the
`-Dversion-string` build flag has a prerelease tag or not. If it does,
the release channel is "tip". If it doesn't, the release channel is
"stable".

This also adds a configuration to specify the release channel for
auto-updates for the macOS application.
2024-12-20 14:21:59 -08:00
Mitchell Hashimoto
270d454c4e webgen: update config to support callouts, emit keybind actions 2024-12-19 17:15:39 -08:00
Mitchell Hashimoto
82c9787fd3 build: generate reference page for config for website 2024-12-18 07:06:35 -08:00
Mitchell Hashimoto
b9345e8d6a try to abstract bundle ID to a zig file 2024-11-25 16:11:02 -08:00
Jeffrey C. Ollie
b353ddf46d core/gtk: unify libadwaita/adwaita options in the code
Fixes #2574
2024-11-08 22:19:04 -06:00
Mitchell Hashimoto
8bb8b01e54 build: use Zig system packaging options
This allows dynamically linking against system libraries, which is
particularly useful for packaging.
2024-10-24 14:46:37 -07:00
Mitchell Hashimoto
6aab430caf terminal: disable slow safety tests in releasesafe 2024-08-31 21:14:12 -07:00
Łukasz Niemier
f9be02a20f chore: clean up typos 2024-08-05 13:56:57 +02:00
Mitchell Hashimoto
caf2742b76 Merge pull request #1584 from mitchellh/paged-terminal
Low-memory terminal state implementation
2024-03-26 20:00:20 -07:00
Mitchell Hashimoto
a416d4236a remove old terminal implementation 2024-03-26 16:14:25 -07:00
Mitchell Hashimoto
4e607e8901 only show optimization 2024-03-26 09:47:09 -07:00
Mitchell Hashimoto
9006a3f431 bench/resize 2024-03-22 20:27:33 -07:00
Mitchell Hashimoto
2725b7d9b2 bench/screen-copy 2024-03-22 20:27:31 -07:00
Mitchell Hashimoto
e7bf9dc53c vt-insert-lines bench 2024-03-22 20:27:26 -07:00
Mitchell Hashimoto
7ad94caaeb bench/page-init 2024-03-22 20:27:19 -07:00
Jeffrey C. Ollie
654010362f log more information about the build 2024-03-17 19:06:49 -05:00
Mitchell Hashimoto
f7a9879579 build: fix issue for long branch names 2024-02-16 13:59:42 -08:00
Mitchell Hashimoto
6437623500 bench/grapheme-break 2024-02-09 09:12:05 -08:00
Mitchell Hashimoto
d4fa0fcabf bench/codepoint-width 2024-02-06 17:11:11 -08:00
Mitchell Hashimoto
b030663e03 bench/stream: benchmark for stream processing 2024-02-05 21:22:27 -08:00
Mitchell Hashimoto
f1227a3ebd build: get benchmarks building again 2024-02-04 20:27:53 -08:00
Mitchell Hashimoto
1a9f80c403 add helpgen entrypoint 2024-02-04 20:17:47 -08:00
Mitchell Hashimoto
1f2b30496b move mdgen main to build dir 2024-02-04 20:04:18 -08:00
Mitchell Hashimoto
c2b3f99faa build: create new build options per compile step
This is going to let us put more object-specific config into the options
rather than affecting every object build per build.
2024-02-04 19:40:59 -08:00
Mitchell Hashimoto
f61eaea4d0 build: update our macOS checks to check for macOS specifically 2024-01-13 15:29:12 -08:00
Mitchell Hashimoto
bfe3c356f0 build: move our configuration out of globals 2024-01-13 15:18:45 -08:00
Mitchell Hashimoto
d4b53cac06 build: move more options to BuildConfig 2024-01-13 15:11:28 -08:00
Mitchell Hashimoto
dfa55988d6 build: use BuildConfig struct 2024-01-13 15:08:37 -08:00
Mitchell Hashimoto
adb7958f61 remove tracy usage from all files 2024-01-13 15:06:08 -08:00
Mitchell Hashimoto
63386e4a22 build: can select renderer with -Drenderer
Note that not all renderers work in all environments.
2023-08-25 08:12:31 -07:00
Mitchell Hashimoto
7ccf86b175 remove imgui and devmode
imgui has been a source of compilation challenges (our fault not theirs)
and devmode hasn't worked in awhile, so drop it.
2023-08-20 08:50:24 -07:00
Kevin Hovsäter
22b8173164 Fix typos 2023-08-08 14:27:34 +02:00
Mitchell Hashimoto
b196e43ee4 fix some issues for future Zig update 2023-05-19 08:34:07 -07:00
Mitchell Hashimoto
0907da4eba build: generate a version number, show in log on startup 2023-03-04 20:34:15 -08:00
Mitchell Hashimoto
06035e2f95 can now use -Dfont-backend to choose the font backend to use 2023-03-04 10:50:13 -08:00
Mitchell Hashimoto
7595ccf18f build_config sets runtime to "none" if embedded 2023-03-03 09:09:44 -08:00
Mitchell Hashimoto
52d22a140c termio: exec uses new flatpak command, no more host-spawn 2023-02-27 11:26:31 -08:00
Mitchell Hashimoto
d1a1ba4cb6 output runtime at startup 2023-02-25 15:09:26 -08:00
Mitchell Hashimoto
48c9c65915 add app runtime option, add gtk backend 2023-02-24 07:58:29 -08:00
Mitchell Hashimoto
eed6979868 apprt: start embedded implement, make App API available to C 2023-02-19 10:44:55 -08:00
Mitchell Hashimoto
ba8f142770 app: only create first window in exe mode 2023-02-19 10:44:55 -08:00
Mitchell Hashimoto
26182611c6 move allocator to global state 2023-02-19 10:44:55 -08:00