Skip to content

fix: add -Dcpu=baseline to zig build for cross-platform compatibility#2

Merged
Zeno-sole merged 3 commits into
deepin-community:masterfrom
Zeno-sole:fix/cpu-baseline
May 21, 2026
Merged

fix: add -Dcpu=baseline to zig build for cross-platform compatibility#2
Zeno-sole merged 3 commits into
deepin-community:masterfrom
Zeno-sole:fix/cpu-baseline

Conversation

@Zeno-sole
Copy link
Copy Markdown
Contributor

Summary

  • Add -Dcpu=baseline flag to zig build commands in debian/rules
  • Default ReleaseFast enables native CPU optimization which generates instructions (e.g. AVX-512) unsupported on older CPUs
  • Fixes SIGILL (illegal instruction) crash on x86-64 machines without AVX-512 support

Test plan

  1. Build ghostty on OBS CI - verify successful package generation
  2. Run ghostty on x86-64 CPU without AVX-512 - verify no SIGILL crash
  3. Run ghostty on x86-64 CPU with AVX-512 - verify no performance regression

Add -Dcpu=baseline flag to zig build command in both override_dh_auto_build
and override_dh_auto_install targets. The default ReleaseFast mode enables
native CPU optimization, generating instructions (e.g. AVX-512) unsupported
on older x86-64 CPUs, causing SIGILL crashes at runtime.

Log: Added -Dcpu=baseline to ensure binary runs on all x86-64 machines

Influence:
1. Verify ghostty runs on x86-64 CPUs without AVX-512 support
2. Verify ghostty runs on x86-64 CPUs with AVX-512 support
3. Verify ghostty deb package builds successfully in OBS CI
4. Verify no performance regression on modern CPUs

fix: 为 zig 构建添加 -Dcpu=baseline 以支持跨平台兼容

在 override_dh_auto_build 和 override_dh_auto_install 目标中添加
-Dcpu=baseline 标志。默认的 ReleaseFast 模式启用 native CPU 优化,
生成旧 CPU 不支持的指令(如 AVX-512),导致运行时 SIGILL 崩溃。

Log: 添加 -Dcpu=baseline 确保二进制在所有 x86-64 机器上运行

Influence:
1. 验证 ghostty 在没有 AVX-512 的 x86-64 CPU 上运行正常
2. 验证 ghostty 在支持 AVX-512 的 x86-64 CPU 上运行正常
3. 验证 ghostty deb 包在 OBS CI 中构建成功
4. 验证现代 CPU 上没有性能回归

repo: ghostty #master
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

TAG Bot

TAG: 1.3.0_us1-0ubuntu1deepin2
EXISTED: no
DISTRIBUTION: unstable

Add libghostty-vt runtime and libghostty-vt-dev development binary
packages to the debian packaging. The VT library was previously
excluded during packaging (not-installed). Now it is properly
split into separate packages so other applications can use the
Ghostty VT engine for terminal emulation.

Log: Added libghostty-vt and libghostty-vt-dev packages

Influence:
1. Verify libghostty-vt.so is installed in /usr/lib/
2. Verify libghostty-vt-dev installs headers to /usr/include/ghostty/
3. Verify ghostty main package still works without libghostty-vt
4. Verify pkg-config works: pkg-config --cflags --libs libghostty-vt
5. Verify OBS CI builds all three binary packages

feat: 将 libghostty-vt 打包为独立共享库

新增 libghostty-vt 运行时和 libghostty-vt-dev 开发二进制包。
VT 库之前被排除在打包之外(not-installed)。现在将其正确拆分为
独立包,使其他应用程序能够使用 Ghostty VT 引擎进行终端仿真。

Log: 新增 libghostty-vt 和 libghostty-vt-dev 包

Influence:
1. 验证 libghostty-vt.so 安装在 /usr/lib/
2. 验证 libghostty-vt-dev 安装头文件到 /usr/include/ghostty/
3. 验证 ghostty 主包无需 libghostty-vt 仍可正常工作
4. 验证 pkg-config 正常工作: pkg-config --cflags --libs libghostty-vt
5. 验证 OBS CI 构建所有三个二进制包

repo: ghostty #master
The zig build system does not generate libghostty-vt.pc, causing OBS CI
build failure with dh_install error:
"Cannot find usr/lib/pkgconfig/libghostty-vt.pc"
Remove the pkg-config line from the install list to fix the build.

Log: Fixed OBS CI dh_install error for missing pkg-config file

Influence:
1. Verify OBS CI builds successfully for all three binary packages
2. Verify libghostty-vt-dev installs headers correctly

fix: 从 libghostty-vt-dev.install 中移除不存在的 pkg-config 文件

zig 构建系统不生成 libghostty-vt.pc 文件,导致 OBS CI 构建失败,
dh_install 报错:"Cannot find usr/lib/pkgconfig/libghostty-vt.pc"
从安装列表中移除该行以修复构建。

Log: 修复 OBS CI 中缺少 pkg-config 文件导致的 dh_install 错误

Influence:
1. 验证 OBS CI 成功构建所有三个二进制包
2. 验证 libghostty-vt-dev 正确安装头文件

repo: ghostty #fix/cpu-baseline
@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hudeng-go

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Zeno-sole Zeno-sole merged commit cf69d80 into deepin-community:master May 21, 2026
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants