28 Commits

Author SHA1 Message Date
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
Jeffrey C. Ollie
e8c845b758 core: fixup callconv(.C) -> callconv(.c)
https://ziglang.org/download/0.14.0/release-notes.html#Calling-Convention-Enhancements-and-setAlignStack-Replaced
2025-05-07 08:41:09 -05: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
bd848a27d2 update all packages to new hash for caching 2025-03-12 07:30:01 -07:00
Mitchell Hashimoto
7e2286eb8c Zig 0.14 2025-03-11 14:39:04 -07:00
Mitchell Hashimoto
8231ebb770 build: mirror most of our direct dependencies
This adds a new script `update-mirror.sh` which generates the proper
blob format for R2 (or any blob storage) to mirror all of our
dependencies.

It doesn't automate updating build.zig.zon but on an ongoing basis this
should be easy to do manually, and we can strive to automate it in the
future.

I omitted iTerm2 color themes because we auto-update that via CI and
updating all of the machinery to send it to our mirror and so on is a
pain. Additionally, this doesn't mirror transitive dependencies because
Zig doesn't have a way to fetch those from a mirror instead (unless you
pre-generate a full cache like packagers but that's not practical for
day to day development).

It's hugely beneficial just to get most of our dependencies mirrored.
2025-02-14 10:06:15 -08:00
azhn
29f040716c Fix cimgui version string to match pkg/cimgui/vendor/ and the upstream version 2025-01-03 17:47:50 +11:00
Nyaa97
7eb5563e9c Fix linking freetype and glslang 2024-10-30 16:43:41 -04: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
7a7f7da4ef pkg: yeet more usingns 2024-08-16 16:52:28 -07:00
Mitchell Hashimoto
a30e791c85 begin 0.13 update process -- very broken 2024-06-24 15:16:22 -07:00
Mitchell Hashimoto
a11c7ac785 update Dear Imgui to 1.90.6 2024-05-10 10:17:33 -07:00
Mitchell Hashimoto
595f24585e working on more zig breaking changes 2024-04-17 20:50:50 -07: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
Mitchell Hashimoto
22648d60e7 pkg/apple-sdk: detect apple sdk based on target 2024-01-09 22:24:34 -08:00
Mitchell Hashimoto
829776bebd pkg/apple-sdk: always require a module 2024-01-09 22:11:03 -08:00
Mitchell Hashimoto
c0722b3652 build: use Xcode for the macOS SDK 2024-01-09 21:53:01 -08:00
Krzysztof Wolicki
3c78df70fb Maybe this will help macos 2024-01-07 21:39:53 +01:00
Krzysztof Wolicki
ddebb31b8a Add include paths to more modules in pkg/ 2024-01-07 19:07:16 +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
55f681a0fd inspector is scaled to native dpi 2023-10-24 15:27:15 -07:00
Mitchell Hashimoto
e62a8bbaae pkg/cimgui: use freetype for font rendering 2023-10-24 15:27:15 -07:00
Mitchell Hashimoto
a6dfad9689 pkg/cimgui: requires libcpp 2023-10-24 15:27:15 -07:00
Mitchell Hashimoto
9fb4497675 pkg/cimgui: add osx backend 2023-10-24 15:27:14 -07:00
Mitchell Hashimoto
3ac6e8392d pkg/cimgui: add metal backend 2023-10-24 15:27:14 -07:00
Mitchell Hashimoto
869e4133f1 apprt/gtk: can render imgui 2023-10-24 15:27:14 -07:00
Mitchell Hashimoto
efddef9d1c build: add cimgui to build 2023-10-24 15:27:13 -07:00
Mitchell Hashimoto
aaa74c40c3 pkg/cimgui 2023-10-24 15:27:13 -07:00