Commit Graph

286 Commits (main)

Author SHA1 Message Date
Nikolay Bryskin 9910a1a475
test: add audio-bell thread-leak NixOS check (GNOME/Wayland)
Adds a bell-leak-check-gnome NixOS test (nix/tests.nix) that launches
Ghostty under GNOME on Wayland, rings 100 bells in the window, and fails
if the GUI process thread count grows per-bell — the end-to-end
signature of the GStreamer pipeline leak fixed in this branch. Verified
locally: growth of ~1 thread over 100 bells, vs ~+400 pre-fix.

Replaces the earlier Xvfb shell script + workflow job: per review, X11
support in GNOME is going away, and this belongs as a Nix check
alongside the other *-gnome tests rather than a standalone script.

The VM has no GPU, so it renders via llvmpipe; the test gives the guest
enough cores/RAM for software GL and tolerates the +new-window D-Bus
activation exceeding its client-side timeout (the window still comes up)
by waiting for the window rather than hard-failing on the call.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 01:06:21 +03:00
Sander 7123bddc18
libghostty-vt: fix linker tests for darwin 2026-05-01 16:44:52 +02:00
Sander d17e5517c7
libghostty-vt: fix dependency path resolution errors
Zigs build infra computes relatives paths to build-time executables that use `setCwd.`
The logic is purely lexical and doesn't take into account symlinks, unlike `chdir` that follows symlinks.

If the `cwd` resolves to a different depth, then the relative path becomes incorrect.
2026-05-01 16:44:52 +02:00
Sander a971bf16a0
libghostty-vt: support building nix derivation on darwin 2026-05-01 16:22:00 +02:00
Jeffrey C. Ollie 8f3d9b4690
update zon2nix to 0.5.0
fix hash outputs for flatpak
build with Zig 0.16 from nixpkgs
(which required fixing prettier reference in devShell.nix)
2026-04-27 12:42:04 -05:00
Mitchell Hashimoto ae1dd5666d
fuzz: fix macOS AFL toolchain and linker setup for macOS 26.4
On macOS 26.4, AFL builds were picking up Nix compiler-wrapper
variables and Apple SDK target settings from the shell environment.
That caused afl-cc to drive the wrong linker and target configuration,
which broke even simple fuzz harness builds. Unset the Nix compiler and 
linker environment in the fuzz dev shell so AFL++ uses the system or 
Homebrew Apple toolchain directly. 

Also force afl-cc to link with lld because the newer Apple linker
asserts on the custom sections emitted by AFL's LLVM
instrumentation. Finally, pin fuzz-libghostty to the host target so the
build does not inherit stray SDK targets from the environment.
2026-04-23 09:06:12 -07:00
Sander 733abbcc39
libghostty-vt: revert .pc changes and use Nix to fix them
Keeps the .pc files templated and instead uses Nix to rewrite the libdir for the static library.
2026-04-21 23:20:06 +02:00
Domen Kožar 38d6451d73 libghostty-vt: emit resolved include/lib dirs in .pc files
`${prefix}/include` and `${prefix}/lib` are wrong under split-prefix installs (e.g. Nix multi-output).
Use `b.h_dir` / `b.lib_dir` instead and drop the unneeded Nix postInstall/postFixup hooks.

Co-Authored-By: Sander <hey@sandydoo.me>
2026-04-21 20:03:53 +02:00
Mitchell Hashimoto e51de8b58f
libghostty: Remove all libc++ and libc++ ABI dependencies
This updates simdutf to my fork which has a SIMDUTF_NO_LIBCXX option
that removes all libc++ and libc++ ABI dependencies. 

From there, the hand-written simd code we have has been updated to also
no longer use any libc++ features. Part of this required removing utfcpp
since it depended on libc++ (`<iterator>`).

libghostty-vt now only depends on libc.
2026-04-15 10:27:05 -07:00
Mitchell Hashimoto a82e156925
build: add libghostty-vt-static pkg-config module
Keep libghostty-vt.pc as the shared/default pkg-config module so
`pkg-config --static libghostty-vt` continues to emit the historical
`-lghostty-vt` flags. This preserves the old behavior for consumers
that still want it, even though that form remains ambiguous on macOS
when both the dylib and archive are installed in the same directory.

Add a separate libghostty-vt-static.pc module for consumers that need
an unambiguous static link. Its `Libs:` entry points directly at the
installed archive so macOS does not resolve the request to the dylib.

Update the Nix packaging to rewrite the new static module into the `dev`
output, use it in the static-link smoke test, and add a compatibility
check that covers both pkg-config entry points.
2026-04-09 20:27:30 -07:00
Jeffrey C. Ollie 28c75e2c61
libghostty-vt: fix nix package name 2026-04-06 23:41:04 -05:00
Jeffrey C. Ollie 1322d64534
libghostty-vt: nix package updates and more nix tests 2026-04-06 22:41:57 -05:00
Jeffrey C. Ollie 06144d30f2
libghostty-vt: allow version to be customized from the Zig build command 2026-04-04 17:04:01 -05:00
Jeffrey C. Ollie 1bd7c19dac
nix: add option to disable simd in libghostty-vt package 2026-04-04 15:06:19 -05:00
Jeffrey C. Ollie 326178adb8
nix: address review comments
* split out dev subpackage
* change version number to 0.1.0
* supported on same platforms as Zig
2026-04-03 20:19:50 -05:00
Jeffrey C. Ollie 4f825e87f5
add a nix package (with CI tests) for libghostty-vt 2026-04-03 16:28:21 -05:00
Mitchell Hashimoto 3dee62f904
build: add CMake support for libghostty-vt
Add a top-level CMakeLists.txt that wraps `zig build lib-vt` so that
CMake-based downstream projects can consume libghostty-vt without
needing to interact with the Zig build system directly. A custom
command triggers the zig build during `cmake --build`, and the
resulting shared library is exposed as an IMPORTED target.

Downstream projects can pull in the library via FetchContent, which
fetches the source and builds it as part of their own CMake build, or
via find_package after a manual install step. The package config
template in dist/cmake/ sets up the ghostty-vt::ghostty-vt target
with proper include paths and macOS rpath handling.

A c-vt-cmake example demonstrates the FetchContent workflow, creating
a terminal, writing VT sequences, and formatting the output as plain
text. CI is updated to auto-discover and build CMake-based examples
alongside the existing Zig-based ones.
2026-03-20 10:42:42 -07:00
Mitchell Hashimoto 5fa1a991d0
up to 1.3.2-dev 2026-03-13 09:22:46 -07:00
Mitchell Hashimoto 332b2aefc6
1.3.1 2026-03-13 09:00:30 -07:00
Mitchell Hashimoto 703d11c642
Bump version to 1.3.0 2026-03-09 08:48:36 -07:00
rhodes-b eaa83b82b3 address comments 2026-03-02 17:25:04 -06:00
rhodes-b 5e7a5cc9c1 pin python depds to latest tag 2026-03-01 23:04:07 -06:00
Jacob Sandlund 79f0bfe374
nix: update ucs-detect to latest master 2026-02-23 09:23:42 -05:00
Jon Parise 21ea94610a macos: lint Swift files using SwiftLint
SwiftLint <https://realm.github.io/SwiftLint/> is both a linter and
formatting. It's a popular way to spot issues and enforce a consistent
style.

Our SwiftLint configuration lives in macos/.swiftlint.yml, where is is
automatically discovered. It's very configurable, and I made an initial
pass as some basic, weakly-opinionated rules. The "TODO" section lists
rules that currently have violations but can be easily (auto)fixed in
follow-up commits.

Our integration is CLI-based. Similar to our other support tools, we
expect developers to install `swiftlint` via nix or e.g. Homebrew.
This is documented in HACKING.md.

We also have an optional Xcode integration, for in-editor feedback. When
`swiftlint` is available, it's run as a script-based Build Phase.

SwiftLint supports an auto-fix mode (--fix). Agents are aware of this
via AGENTS.md.

The rules are enforced using a (nix-based) CI job.
2026-02-19 14:42:11 -05:00
Caleb Norton 1c023c6519 chore: nix typos and deprecations 2026-02-08 16:20:41 -06:00
Caleb Norton 8892714f9b chore: sync with nixpkgs changes 2026-02-08 16:17:50 -06:00
MithicSpirit d512de7e78
nix: update zon2nix
After the last commit, zon2nix required recompiling zig, which caused
slow build times and CI failures.
2026-01-12 12:53:21 -05:00
MithicSpirit 5c8c7c627c
nix: update nixpkgs, remove zig.hook, and remove x11-gnome
As of NixOS/nixpkgs#473413[1], `zig.hook` no longer supports
`zig_default_flags`, and now they can and must be provided in
`zigBuildFlags` instead.

Updating also requires removing gnome-xorg since it has been removed
from nixpkgs.

[1] https://github.com/NixOS/nixpkgs/pull/473413
2026-01-11 20:17:12 -05:00
Uzair Aftab 07578d5e3f nix: replace deprecated system with stdenv.hostPlatform.system 2025-12-15 18:59:34 +01:00
Jeffrey C. Ollie 8386159764
nix vm tests: add test for ssh-terminfo shell integration feature 2025-11-20 08:30:09 -06:00
Jeffrey C. Ollie f26a6b949c
nix vm tests: sync ghostty user with other tests 2025-11-20 08:30:09 -06:00
Jeffrey C. Ollie debec946da
nix vm tests: refactor to make gnome vm node builder reusable 2025-11-20 08:30:08 -06:00
Jeffrey C. Ollie c77bbe6d7e
nix vms: make base vm more suitable for tests 2025-11-20 08:30:08 -06:00
Jeffrey C. Ollie ca8313570c
nix: add vm-based integration tests 2025-11-20 08:30:08 -06:00
Mitchell Hashimoto a315f8f32e
nix: add ucs-detect
This makes `ucs-detect` available in our Nix environment so that we can
run tests on our Unicode support. In the future, I'd like to modify our
CI to run this too.

This also adds a `./test/ucs-detect.sh` script that runs `ucs-detect`
with consistent options that match the upstream test styles.
2025-11-06 09:22:18 -08:00
Jeffrey C. Ollie 1caab0c208
nix: make sure zon2nix uses Zig 0.15 in generated files (#9220) 2025-10-15 11:56:07 -07:00
Jeffrey C. Ollie c91bfb9dd5
bump version for development (#9218) 2025-10-15 11:55:30 -07:00
Mitchell Hashimoto f0eb46ea26
Add update-mirror Nu script to ease mirror updating for deps
This adds a new script we can manually run that downloads all the files
that need to be uploaded to the mirror and updates our build.zig.zon.
The upload still happens manually [by me] but this simplifies the task
greatly.
2025-10-03 07:39:41 -07:00
Mitchell Hashimoto 87b77e1980
ci: cleanup 2025-10-03 07:10:43 -07:00
Mitchell Hashimoto 32bf37e5e4
setup basic doxygen for docs
We may not stick with Doxygen, but it gives us something to start with.
2025-09-23 15:51:27 -07:00
Jeffrey C. Ollie d4bc73a9d6
update to the latest zon2nix 2025-09-20 17:02:24 -05:00
Mitchell Hashimoto 1201bc27d2
bump the version for development 2025-09-15 11:01:14 -07:00
Mitchell Hashimoto 510f4e474c
Set version to 1.2.0 2025-09-15 08:25:54 -07:00
azhn 928f5492dc Fix name of `check-zig-cache.sh` in documentation for updating the zig cache hash 2025-09-13 06:54:56 +10:00
Jeffrey C. Ollie bb78adbd93
devshell: add poop 2025-09-04 23:44:23 -05:00
Mitchell Hashimoto ee573ebd36
ai: add `gh-issue` command to help diagnose GitHub issues
This enables agents (namely Amp) to use `/gh-issue <number/url>` to 
begin diagnosing a GitHub issue, explaining the problem, and suggesting
a plan of action. This action explicitly prompts the AI to not write
code.

I've used this manually for months with good results, so now I'm
formalizing it in the repo for other contributors.

Example diagnosing #8523:

https://ampcode.com/threads/T-3e26e8cc-83d1-4e3c-9b5e-02d9111909a7
2025-09-04 13:56:50 -07:00
Jeffrey C. Ollie a18332828a
nix: update zon2nix
- Builds with Zig 0.15 now (but still works just fine with Zig
  0.14 projects).
- Fixes a double-free if nix-prefetch-git can't be found or errors out
- Adds support for generating Flatpak package metadata natively.
2025-08-23 21:31:00 -05:00
Jeffrey C. Ollie 3dc45fcd55
devshell: add deps that allow GTK to load SVG resources
GTK dynamically loads librsvg when it needs to convert a SVG-only icon
(or any other SVG-only resource) for display. This PR adds the libraries
that GTK needs so that running programs from within the developer shell
can display those SVG resources.
2025-07-23 15:48:00 -05:00
Bryan Lee cbb3f6f64f
ci: add shellcheck linting for shell scripts
Add shellcheck to CI pipeline to ensure shell scripts follow best practices
and catch common errors. Fix existing shellcheck warnings in test scripts
to pass the new linting requirements.
2025-07-11 02:54:05 +08:00
Breno A. 0a1ade0158 pin GitHub Actions to specific SHAs 2025-07-06 06:59:50 -07:00