Files
ghostty/macos/build.nu
Mitchell Hashimoto 04aff46022 macos: add build script, update AGENTS.md, skip UI tests
This is an update to address common agentic issues I run into,
but the `build.nu` script may be generally helpful to people using
the Nix env since `xcodebuild` is broken by default in Nix due to the
compiler/linker overrides Nix shell does.
2026-03-05 19:55:50 -08:00

33 lines
1.0 KiB
Plaintext
Executable File

#!/usr/bin/env nu
# Build the macOS Ghostty app using xcodebuild with a clean environment
# to avoid Nix shell interference (NIX_LDFLAGS, NIX_CFLAGS_COMPILE, etc.).
def main [
--scheme: string = "Ghostty" # Xcode scheme (Ghostty, Ghostty-iOS, DockTilePlugin)
--configuration: string = "Debug" # Build configuration (Debug, Release, ReleaseLocal)
--action: string = "build" # xcodebuild action (build, test, clean, etc.)
] {
let project = ($env.FILE_PWD | path join "Ghostty.xcodeproj")
let build_dir = ($env.FILE_PWD | path join "build")
# Skip UI tests for CLI-based invocations because it requires
# special permissions.
let skip_testing = if $action == "test" {
[-skip-testing GhosttyUITests]
} else {
[]
}
(^env -i
$"HOME=($env.HOME)"
"PATH=/usr/bin:/bin:/usr/sbin:/sbin"
xcodebuild
-project $project
-scheme $scheme
-configuration $configuration
$"SYMROOT=($build_dir)"
...$skip_testing
$action)
}