22 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
Mitchell Hashimoto
d8cc19612f crash: beforeSend needs to add contexts to the event directly 2024-09-02 09:55:57 -07:00
Mitchell Hashimoto
f0916d58e8 crash: try to attach dimensions to the crash report 2024-09-01 14:15:11 -07:00
Mitchell Hashimoto
72c1b00b0b pkg/sentry: uuid string is null-terminated 2024-08-31 14:05:55 -07:00
Mitchell Hashimoto
920a1051e5 crash: discard envelopes that do not contain a crash 2024-08-31 12:24:11 -07:00
Mitchell Hashimoto
0f35f6267e pkg/breakpad: add linux_syscall_support.h to the vendored files 2024-08-28 21:43:18 -07:00
Mitchell Hashimoto
7613e5f211 add pkg/breakpad, configure sentry to use breakpad 2024-08-28 21:43:18 -07:00
Mitchell Hashimoto
d66178718c pkg/sentry: build in unwinder 2024-08-28 21:43:18 -07:00
Mitchell Hashimoto
13f1752836 build: don't include sentry on windows 2024-08-28 21:43:18 -07:00
Mitchell Hashimoto
33e9bc14ef don't send empty envelopes 2024-08-28 21:43:18 -07:00
Mitchell Hashimoto
833efe9a81 pkg/sentry: fix darwin lib builds 2024-08-28 21:43:18 -07:00
Mitchell Hashimoto
2abdf291f4 implement sentry transport to write crash reports to XDG_STATE_HOME 2024-08-28 21:43:18 -07:00
Mitchell Hashimoto
e029490535 sentry init uses proper cache dir, sets tags 2024-08-28 21:43:18 -07:00
Mitchell Hashimoto
e4e9a19607 pkg/sentry: fix Linux builds 2024-08-28 21:43:17 -07:00
Mitchell Hashimoto
b11f0d5cc9 pkg/sentry: custom transports 2024-08-28 21:43:17 -07:00
Mitchell Hashimoto
1070068090 pkg/sentry: add more Zig APIs 2024-08-28 21:43:17 -07:00
Mitchell Hashimoto
2793cf8112 pkg/sentry: initial builds 2024-08-28 21:43:17 -07:00