Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions scripts/test_vendor_libghostty_vt.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,45 @@ def test_local_vendor_patches_are_applied_to_vendored_tree(self) -> None:
f"stderr:\n{result.stderr}",
)

def test_wuffs_dependency_uses_c_only_release_mirror(self) -> None:
root = Path(__file__).resolve().parent.parent / "vendor" / "libghostty-vt"
dependency_files = [
root / "build.zig.zon.json",
root / "build.zig.zon.nix",
root / "build.zig.zon.txt",
root / "pkg" / "wuffs" / "build.zig.zon",
]
c_only_url = (
"git+https://github.com/google/wuffs-mirror-release-c.git"
"?rev=v0.4.0-alpha.10#7411f488fe2e2c205c3d3b3d28638b7356522930"
)
zig_hash = "N-V-__8AAP5JWgCGP_AD0teWpa4krRvE9VPZzvviGdbmN4jI"
nix_hash = "sha256-AMuAaCbNJYnSeac1B1IRSUh4rlE2KphT04/Ak4Pig5M="
old_zig_hash = "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs"
old_archive = (
"wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz"
)

for path in dependency_files:
with self.subTest(path=path.relative_to(root)):
text = path.read_text()
self.assertIn(c_only_url, text)
self.assertNotIn(old_zig_hash, text)
self.assertNotIn(old_archive, text)

package_manifest = (root / "pkg" / "wuffs" / "build.zig.zon").read_text()
generated_json = (root / "build.zig.zon.json").read_text()
generated_nix = (root / "build.zig.zon.nix").read_text()
self.assertIn(zig_hash, package_manifest)
self.assertIn(zig_hash, generated_json)
self.assertIn(zig_hash, generated_nix)
self.assertIn(nix_hash, generated_json)
self.assertIn(nix_hash, generated_nix)
self.assertRegex(
generated_nix,
r'name = "wuffs";\n\s+url = .*\n\s+hash = .*\n\s+unpack = true;',
)

def test_embedded_libghostty_logging_is_silenced(self) -> None:
root = Path(__file__).resolve().parent.parent / "vendor" / "libghostty-vt"
lib_vt = root / "src" / "lib_vt.zig"
Expand Down
39 changes: 39 additions & 0 deletions vendor/libghostty-vt.patches.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,42 @@ cargo nextest run --locked modify_other_keys_query_tracks_mode_two
cargo nextest run --locked host_report_all_supplies_printable_releases_for_event_type_only_panes
python3 -m unittest scripts.test_vendor_libghostty_vt scripts.test_ui_hot_path_architecture
```

## 0003 use the C-only Wuffs release mirror

status: active

patch: `vendor/patches/libghostty-vt/0003-use-c-only-wuffs-mirror.patch`

herdr issue: https://github.com/herdrdev/herdr/issues/3737

upstream discussion: https://github.com/ghostty-org/ghostty/pull/13789

upstream pr: https://github.com/ghostty-org/ghostty/pull/13789

vendored base: `c5a21edfcbc2d5b46540ad91b7980aca31f5f1f3`

local files:

- `vendor/libghostty-vt/build.zig.zon.json`
- `vendor/libghostty-vt/build.zig.zon.nix`
- `vendor/libghostty-vt/build.zig.zon.txt`
- `vendor/libghostty-vt/pkg/wuffs/build.zig.zon`

reason: The full Wuffs source archive includes an artificial malformed JPEG
that some endpoint protection products delete during Nix cache realization or
Zig dependency fetching. This backports the merged upstream switch to Wuffs'
C-only release mirror, which contains the C sources libghostty-vt compiles but
not the unrelated test corpus.

remove when: the vendored source contains Ghostty PR 13789, commit
`7c4c7adadc8b080ab168ed0af48319185dcbd2ba`, or an equivalent C-only Wuffs pin,
and the dependency and build verification passes without this patch.

verification:

```sh
python3 -m unittest scripts.test_vendor_libghostty_vt
just check
nix build .#herdr
```
6 changes: 3 additions & 3 deletions vendor/libghostty-vt/build.zig.zon.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions vendor/libghostty-vt/build.zig.zon.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/libghostty-vt/build.zig.zon.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/libghostty-vt/pkg/wuffs/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
.dependencies = .{
// google/wuffs
.wuffs = .{
.url = "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz",
.hash = "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs",
.url = "git+https://github.com/google/wuffs-mirror-release-c.git?rev=v0.4.0-alpha.10#7411f488fe2e2c205c3d3b3d28638b7356522930",
.hash = "N-V-__8AAP5JWgCGP_AD0teWpa4krRvE9VPZzvviGdbmN4jI",
.lazy = true,
},

Expand Down
70 changes: 70 additions & 0 deletions vendor/patches/libghostty-vt/0003-use-c-only-wuffs-mirror.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
diff --git a/vendor/libghostty-vt/build.zig.zon.json b/vendor/libghostty-vt/build.zig.zon.json
index 63d5fd61..7f64f2c5 100644
--- a/vendor/libghostty-vt/build.zig.zon.json
+++ b/vendor/libghostty-vt/build.zig.zon.json
@@ -139,10 +139,10 @@
"url": "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/archive/1.47/wayland-protocols-1.47.tar.gz",
"hash": "sha256-3S3xSrX0EDgleq7cxLX7msDuAY8/D5SvkJcCjmDTMiM="
},
- "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs": {
+ "N-V-__8AAP5JWgCGP_AD0teWpa4krRvE9VPZzvviGdbmN4jI": {
"name": "wuffs",
- "url": "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz",
- "hash": "sha256-nkzSCr6W5sTG7enDBXEIhgEm574uLD41UVR2wlC+HBM="
+ "url": "git+https://github.com/google/wuffs-mirror-release-c.git?rev=v0.4.0-alpha.10#7411f488fe2e2c205c3d3b3d28638b7356522930",
+ "hash": "sha256-AMuAaCbNJYnSeac1B1IRSUh4rlE2KphT04/Ak4Pig5M="
},
"z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ": {
"name": "z2d",
diff --git a/vendor/libghostty-vt/build.zig.zon.nix b/vendor/libghostty-vt/build.zig.zon.nix
index 2b05dd1b..124c2d2a 100644
--- a/vendor/libghostty-vt/build.zig.zon.nix
+++ b/vendor/libghostty-vt/build.zig.zon.nix
@@ -346,12 +346,12 @@ in
};
}
{
- name = "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs";
+ name = "N-V-__8AAP5JWgCGP_AD0teWpa4krRvE9VPZzvviGdbmN4jI";
path = fetchZigArtifact {
name = "wuffs";
- url = "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz";
- hash = "sha256-nkzSCr6W5sTG7enDBXEIhgEm574uLD41UVR2wlC+HBM=";
- unpack = false;
+ url = "git+https://github.com/google/wuffs-mirror-release-c.git?rev=v0.4.0-alpha.10#7411f488fe2e2c205c3d3b3d28638b7356522930";
+ hash = "sha256-AMuAaCbNJYnSeac1B1IRSUh4rlE2KphT04/Ak4Pig5M=";
+ unpack = true;
};
}
{
diff --git a/vendor/libghostty-vt/build.zig.zon.txt b/vendor/libghostty-vt/build.zig.zon.txt
index 02da0630..55444ddd 100644
--- a/vendor/libghostty-vt/build.zig.zon.txt
+++ b/vendor/libghostty-vt/build.zig.zon.txt
@@ -1,3 +1,4 @@
+git+https://github.com/google/wuffs-mirror-release-c.git?rev=v0.4.0-alpha.10#7411f488fe2e2c205c3d3b3d28638b7356522930
git+https://github.com/jacobsandlund/uucode#5f05f8f83a75caea201f12cc8ea32a2d82ea9732
https://deps.files.ghostty.org/DearBindings_v0.17_ImGui_v1.92.5-docking.tar.gz
https://deps.files.ghostty.org/JetBrainsMono-2.304.tar.gz
@@ -24,7 +25,6 @@ https://deps.files.ghostty.org/uucode-0.2.0-ZZjBPqZVVABQepOqZHR7vV_NcaN-wats0IB6
https://deps.files.ghostty.org/vaxis-7dbb9fd3122e4ffad262dd7c151d80d863b68558.tar.gz
https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz
https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz
-https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz
https://deps.files.ghostty.org/z2d-0.10.0-j5P_Hu-6FgBsZNgwphIqh17jDnj8_yPtD8yzjO6PpHRQ.tar.gz
https://deps.files.ghostty.org/zf-3c52637b7e937c5ae61fd679717da3e276765b23.tar.gz
https://deps.files.ghostty.org/zig_js-04db83c617da1956ac5adc1cb9ba1e434c1cb6fd.tar.gz
diff --git a/vendor/libghostty-vt/pkg/wuffs/build.zig.zon b/vendor/libghostty-vt/pkg/wuffs/build.zig.zon
index eb99ba0b..532a116e 100644
--- a/vendor/libghostty-vt/pkg/wuffs/build.zig.zon
+++ b/vendor/libghostty-vt/pkg/wuffs/build.zig.zon
@@ -5,7 +5,7 @@
.dependencies = .{
// google/wuffs
.wuffs = .{
- .url = "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz",
- .hash = "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs",
+ .url = "git+https://github.com/google/wuffs-mirror-release-c.git?rev=v0.4.0-alpha.10#7411f488fe2e2c205c3d3b3d28638b7356522930",
+ .hash = "N-V-__8AAP5JWgCGP_AD0teWpa4krRvE9VPZzvviGdbmN4jI",
.lazy = true,
},
Loading