Commit Graph

19 Commits (main)

Author SHA1 Message Date
Mitchell Hashimoto d02770d292
zig-15: build binary builds 2025-10-03 07:10:41 -07:00
Mitchell Hashimoto c979ece916
build-system: Replace deprecated usages of root_source_file on addTests (#8031)
Yet another low-hanging fruit
2025-07-22 15:28:11 -07:00
Jayson Reis d5995ac45c
build-system: Replace deprecated usages of root_source_file on addTests 2025-07-23 00:03:44 +02:00
Jayson Reis acc2ea724f
build-system: Replace deprecated usages of addStaticLibrary with addLibrary (#8029)
Hi there, this is just a low-hanging fruit and it also prepares the way
for the future 0.15, which removes addStaticLibrary.
Please, let me know what to do on the `// TODO` comments.
2025-07-22 14:47:18 -07:00
Mitchell Hashimoto 0f1860f066
build: use a libc txt file to point to correct Apple SDK
This fixes an issue where Ghostty would not build against the macOS 15.5 SDK.

What was happening was that Zig was adding its embedded libc paths to
the clang command line, which included old headers that were
incompatible with the latest (macOS 15.5) SDK. Ghostty was adding the
newer paths but they were being overridden by the embedded libc paths.

The reason this was happening is because Zig was using its own logic to
find the libc paths and this was colliding with the paths we were
setting manually. To fix this, we now use a `libc.txt` file that
explicitly tells Zig where to find libc, and we base this on our own SDK
search logic.
2025-05-29 15:04:05 -07:00
Mitchell Hashimoto cfea2ea12c
build: mark most dependencies as lazy
Lazy dependencies are only fetched if the build script would actually
reach a usage of that dependency at runtime (when the `lazyDependency`
function is called). This can save a lot of network traffic, disk uage,
and time because we don't have to fetch and build dependencies that we
don't actually need.

Prior to this commit, Ghostty fetched almost everything for all
platforms and configurations all the time. This commit reverses that to
fetching almost nothing until it's actually needed.

There are very little downsides to doing this[1]. One downside is `zig
build --fetch` doesn't fetch lazy dependencies, but we don't rely on
this command for packaging and suggest using our custom shell script
that downloads a cached list of URLs (`build.zig.zon.txt`).

This commit doesn't cover 100% of dependencies, since some provide no
benefit to make lazy while the complexity to make them lazy is higher
(in code style typically).

Conversely, some simple dependencies are marked lazy even if they're
almost always needed if they don't introduce any real complexity to the
code, because there is very little downside to do so.

[1]: https://ziggit.dev/t/lazy-dependencies-best-dependencies/5509/5
2025-03-14 13:32:19 -07:00
Mitchell Hashimoto 86d3f18707
pkg/oniguruma: fix build 2025-03-12 09:10:17 -07:00
Mitchell Hashimoto 7e2286eb8c
Zig 0.14 2025-03-11 14:39:04 -07:00
Jan200101 0493b79caf
don't make library building logic public 2025-01-03 22:42:29 +01:00
Jan200101 dc90ef776e
don't build oniguruma when system integration is enabled 2025-01-03 21:27:22 +01:00
Mitchell Hashimoto 1677e95f86
pkg/oniguruma: add additional header configs for build
Fixes #1887

There seems to be no issue adding these for our other platforms and it
appears to get builds on Chimera working.
2024-06-28 07:34:55 -04:00
Mitchell Hashimoto a30e791c85
begin 0.13 update process -- very broken 2024-06-24 15:16:22 -07:00
Mitchell Hashimoto 595f24585e
working on more zig breaking changes 2024-04-17 20:50:50 -07:00
Krzysztof Wolicki edaafdf57a build API change: update usage of addCSourceFiles 2024-02-26 18:00:43 +01:00
Mitchell Hashimoto 3360a008cd
build: build produces a broken object file for iOS
This gets `zig build -Dtarget=aarch64-ios` working. By "working" I mean
it produces an object file without compiler errors. However, the object
file certainly isn't useful since it uses a number of features that will
not work in the iOS sandbox.

This is just an experiment more than anything to see how hard it would be to
get libghostty working within iOS to render a terminal. Note iOS doesn't
support ptys so this wouldn't be a true on-device terminal. The
challenge right now is to just get a terminal rendering (not usable).
2024-01-13 21:38:58 -08:00
Krzysztof Wolicki 9e14a7ea62 Add include paths to modules in pkg/ 2024-01-07 17:39:39 +01:00
Krzysztof Wolicki 1913243c35 WIP: Update to new build module API after Zig PR #18160
Temporarily change dependency sources to forks until they update
2024-01-03 21:50:32 +01:00
Mitchell Hashimoto 364020973c
pkg/oniguruma: search 2023-11-29 15:29:43 -08:00
Mitchell Hashimoto c0a06ab523
pkg/oniguruma: basic build 2023-11-29 15:29:43 -08:00