Commit Graph

23 Commits

Author SHA1 Message Date
Mitchell Hashimoto
7aa9591746 Update to Zig 0.16.0 (#12726)
Closes #12228
Supersedes #12388

**UPDATED** - Also check comments for additional details!

This commit represents the majority of the work necessary to upgrade
Ghostty to use Zig 0.16.0.

At this point, all tests pass under Linux, but more work may be
necessary to get them to build and function on other platforms.

There are some parts of this update that deserve commentary, so that
follows below:

## Expanded use of global state (IO/environment related)

Global state, once generally only used by the C library, has now been
expanded to be used across the project at large. The static local
variable that holds the state has been moved private in its source
container with all attributes that need to be accessed globally gated
behind accessors, most of which guard on testing and send test copies
instead. Use of the global state in non-testing scenarios asserts that
the state has been initialized through `init` naturally through the
optional assertion process.

The rationale for this change is to have a location to store a
general-purpose I/O implementation and environment variables, both of
which are now provided through [Juicy
Main](https://ziglang.org/download/0.16.0/release-notes.html#Juicy-Main)
and hence can no longer be accessed or mutated through stdlib without
use of lower-level system calls and hacks (some of which are employed,
but sparingly).

As the code matures, dependence on global state should naturally slim
down.

We do not allow global state to be used in libghostty-vt. There are
comptime guards that prevent this should compilation of libghostty-vt
end up pulling `global.zig`. This means that as per the last paragraph,
work has already begun to de-couple the codebase from global state where
necessary. Additionally, in some places where environment needs to be
updated and where it can be done in an isolated fashion, environment
maps are used - system-level injection of environment through the use of
`setenv` or `unsetenv` now only happens during early initialization (and
hopefully we can remove these in the future too, especially since they
require re-synchronization of the higher-level environment primitives
after this is done).

## The `lib/compat` Tree

Some stdlib features that have been removed but still either seem they
would be valuable to us or outright complex to move away from
(particularly `SegmentedList`) have been extracted from 0.15.2, updated
as needed, and placed in `src/lib/compat`. The intention again is to
allow for piecemeal migration to more modern implementations or possibly
straight local versions.

This paradigm has also allowed us to add `std.Io.Condition.waitTimeout`,
which incidentally was missed in the 0.16.0 shuffle and has been
re-added for 0.17.0. We can remove this in favor of the upstream when we
eventually migrate to that, obviously.

Note that there was a lot more of this extracted code when this work was
started, but a lot of said code has been removed (namely environment or
process/fd-related functionality).

## translate-c Issues (functional on Linux, Darwin WIP)

There have been a number of C translation issues that we have been
working through through submitted patches and the great help from folks
on the Arocc and Zig side. This is ongoing, with the remaining work to
getting things fixed mainly focused on the MacOS side. Stay tuned for
further developments.

As mentioned at the top, follow comments for more details!
2026-07-22 08:26:45 -07:00
Chris Marchesi
e8525c0fd9 Update to Zig 0.16.0
This commit represents the majority of the work necessary to upgrade
Ghostty to use Zig 0.16.0.

Key parts:

* In addition to its previous responsibilities, the global state now
  houses state for global I/O implementations and the process
  environment. It is now also utilized in the main application along
  with the C library. Where necessary, global state is isolated from key
  parts of the implementation (e.g., in libghostty subsystems), and it's
  expected that this list will grow.

* We currently manage our own C translation layer where necessary. In
  these cases, cImport has been removed in favor of the new external
  translate-c package. Due to fixes that have needed be made to properly
  translate the dependencies that were swapped out, as mentioned, we
  have had to backport fixes from the current translate-c package (and
  the upstream Arocc dependency). We will host this ourselves until Zig
  0.17.0 is released with these fixes.

* Where necessary (only a small number of cases), some stdlib code from
  0.15.2 (and even from 0.17.0) has been taken, adopted, and vendored in
  lib/compat.

Co-authored-by: Leah Amelia Chen <hi@pluie.me>
2026-07-21 12:35:05 -07:00
dependabot[bot]
f5477459ea build(deps): bump actions/checkout from 7.0.0 to 7.0.1
Bumps [actions/checkout](https://github.com/actions/checkout) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](9c091bb21b...3d3c42e5aa)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-21 00:12:59 +00:00
dependabot[bot]
3f6b9a16bc build(deps): bump mitchellh/vouch/action/check-issue
Bumps [mitchellh/vouch/action/check-issue](https://github.com/mitchellh/vouch) from baeb3bf7c7e6c12d6e33bab3870b7e936580a934 to d66fa29a64600490892131ad87597c30c91fcac4.
- [Release notes](https://github.com/mitchellh/vouch/releases)
- [Commits](baeb3bf7c7...d66fa29a64)

---
updated-dependencies:
- dependency-name: mitchellh/vouch/action/check-issue
  dependency-version: d66fa29a64600490892131ad87597c30c91fcac4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-13 00:15:02 +00:00
dependabot[bot]
e1e2e5f34e build(deps): bump mitchellh/vouch/action/check-issue
Bumps [mitchellh/vouch/action/check-issue](https://github.com/mitchellh/vouch) from 52aec3d64655edf2fdb58f298e02da754a056daf to baeb3bf7c7e6c12d6e33bab3870b7e936580a934.
- [Release notes](https://github.com/mitchellh/vouch/releases)
- [Commits](52aec3d646...baeb3bf7c7)

---
updated-dependencies:
- dependency-name: mitchellh/vouch/action/check-issue
  dependency-version: baeb3bf7c7e6c12d6e33bab3870b7e936580a934
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-26 00:12:35 +00:00
dependabot[bot]
b3cc5000e0 build(deps): bump actions/checkout from 6.0.3 to 7.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.3 to 7.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](df4cb1c069...9c091bb21b)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-19 00:12:41 +00:00
dependabot[bot]
5f7738a0e9 build(deps): bump actions/checkout from 6.0.2 to 6.0.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](de0fac2e45...df4cb1c069)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-03 18:35:02 +00:00
trag1c
4f94afdb4b vouch: enable auto-locking closed issues 2026-05-20 18:13:49 +02:00
dependabot[bot]
ee316e43c1 build(deps): bump actions/create-github-app-token from 3.1.1 to 3.2.0
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Changelog](https://github.com/actions/create-github-app-token/blob/main/CHANGELOG.md)
- [Commits](1b10c78c78...bcd2ba4921)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: 3.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-13 01:38:02 +00:00
trag1c
2f067e14f1 ci: fix vouch-check-issue to checkout the template file 2026-04-24 13:48:06 +02:00
trag1c
cb518e6afd ci: use a custom template for ghostty-vouch issue comments 2026-04-19 15:41:41 +02:00
dependabot[bot]
c2a1ac5866 build(deps): bump actions/create-github-app-token from 3.0.0 to 3.1.1
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 3.0.0 to 3.1.1.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](f8d387b68d...1b10c78c78)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: 3.1.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 00:23:33 +00:00
dependabot[bot]
0fb1519cf2 build(deps): bump actions/create-github-app-token from 2.2.1 to 3.0.0
Bumps [actions/create-github-app-token](https://github.com/actions/create-github-app-token) from 2.2.1 to 3.0.0.
- [Release notes](https://github.com/actions/create-github-app-token/releases)
- [Commits](29824e69f5...f8d387b68d)

---
updated-dependencies:
- dependency-name: actions/create-github-app-token
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-16 00:17:13 +00:00
Mitchell Hashimoto
245ea56597 update vouch to 1.4.2 2026-02-24 09:48:57 -08:00
Mitchell Hashimoto
c3a900d1f4 ci: update vouch to 1.4.1 2026-02-23 19:49:30 -08:00
Mitchell Hashimoto
7928883f73 ci: add sync-codeowners action so that codeowners auto-vouch 2026-02-19 13:26:49 -08:00
Mitchell Hashimoto
b6dbd445d0 ci: update create-github-app-token 2026-02-16 21:02:44 -08:00
Mitchell Hashimoto
39a10ecc0c ci: vouch uses the Ghostty Vouch GitHub app to bypass merge restrictions (#10779) 2026-02-16 20:48:25 -08:00
Mitchell Hashimoto
dc3a25c2a3 ci: update vouch to 1.3.1
For GH API retries
2026-02-16 12:13:47 -08:00
Mitchell Hashimoto
ef9431b55c ci: update vouch to 1.3, create PRs instead of pushing to main
This will let us re-enable our main branch protection rules. :)
2026-02-15 14:43:02 -08:00
Mitchell Hashimoto
eb68d98bad update vouch 2026-02-15 06:57:55 -08:00
Mitchell Hashimoto
c2cb050713 fix pins 2026-02-15 06:53:31 -08:00
Mitchell Hashimoto
ad6921f276 Use mitchellh/vouch 2026-02-15 06:53:30 -08:00