nix: don't strip if we are building a debug version of the package (#7395)

This commit is contained in:
Mitchell Hashimoto
2025-05-20 06:47:27 -07:00
committed by GitHub
2 changed files with 20 additions and 2 deletions

View File

@ -211,8 +211,23 @@ jobs:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Test NixOS package build
run: nix build .#ghostty
- name: Test release NixOS package build
run: nix build .#ghostty-releasefast
- name: Check version
run: result/bin/ghostty +version | grep -q 'builtin.OptimizeMode.ReleaseFast'
- name: Check to see if the binary has been stripped
run: nm result/bin/.ghostty-wrapped 2>&1 | grep -q 'no symbols'
- name: Test debug NixOS package build
run: nix build .#ghostty-debug
- name: Check version
run: result/bin/ghostty +version | grep -q 'builtin.OptimizeMode.Debug'
- name: Check to see if the binary has not been stripped
run: nm result/bin/.ghostty-wrapped 2>&1 | grep -q 'main_ghostty.main'
build-dist:
runs-on: namespace-profile-ghostty-md

View File

@ -36,6 +36,7 @@
buildInputs = import ./build-support/build-inputs.nix {
inherit pkgs lib stdenv enableX11 enableWayland;
};
strip = optimize != "Debug" && optimize != "ReleaseSafe";
in
stdenv.mkDerivation (finalAttrs: {
pname = "ghostty";
@ -87,6 +88,7 @@ in
buildInputs = buildInputs;
dontConfigure = true;
dontStrip = !strip;
GI_TYPELIB_PATH = gi_typelib_path;
@ -96,6 +98,7 @@ in
"-Dversion-string=${finalAttrs.version}-${revision}-nix"
"-Dgtk-x11=${lib.boolToString enableX11}"
"-Dgtk-wayland=${lib.boolToString enableWayland}"
"-Dstrip=${lib.boolToString strip}"
];
outputs = [