native macOS codings agent orchestrator
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #140 from onevcat/onevtail/ghostty-sha-local-sync

build: auto-sync GhosttyKit by submodule SHA

authored by

Wei Wang and committed by
GitHub
01a5b9b4 eeccd4c7

+59 -5
+2
.gitignore
··· 65 65 Frameworks/GhosttyKit.xcframework 66 66 Resources/ghostty 67 67 Resources/terminfo 68 + .ghostty_hash 69 + .ghostty_build_stamp 68 70 *.profraw 69 71 .env 70 72 build/
+48 -5
Makefile
··· 13 13 GHOSTTY_RESOURCE_PATH := $(CURRENT_MAKEFILE_DIR)/Resources/ghostty 14 14 GHOSTTY_TERMINFO_PATH := $(CURRENT_MAKEFILE_DIR)/Resources/terminfo 15 15 GHOSTTY_BUILD_OUTPUTS := $(GHOSTTY_XCFRAMEWORK_PATH) $(GHOSTTY_RESOURCE_PATH) $(GHOSTTY_TERMINFO_PATH) 16 + GHOSTTY_BUILD_STAMP := $(CURRENT_MAKEFILE_DIR)/.ghostty_build_stamp 17 + GHOSTTY_HASH_FILE := $(CURRENT_MAKEFILE_DIR)/.ghostty_hash 16 18 SPM_CACHE_DIR := /tmp/supacode-spm-cache/SourcePackages 17 19 VERSION ?= 18 20 BUILD ?= 19 21 XCODEBUILD_FLAGS ?= 20 22 .DEFAULT_GOAL := help 21 - .PHONY: build-ghostty-xcframework build-app build-cli run-app install-dev-build install-release archive export-archive format lint check test test-cli-smoke test-cli-integration bump-version bump-and-release log-stream 23 + .PHONY: build-ghostty-xcframework ensure-ghostty sync-ghostty _check-ghostty-hash _record-ghostty-hash build-app build-cli run-app install-dev-build install-release archive export-archive format lint check test test-cli-smoke test-cli-integration bump-version bump-and-release log-stream 22 24 23 25 help: # Display this help. 24 26 @-+echo "Run make with one of the following targets:" 25 27 @-+echo 26 28 @-+grep -Eh "^[a-z-]+:.*#" $(CURRENT_MAKEFILE_PATH) | sed -E 's/^(.*:)(.*#+)(.*)/ \1 @@@ \3 /' | column -t -s "@@@" 27 29 28 - build-ghostty-xcframework: $(GHOSTTY_BUILD_OUTPUTS) # Build ghostty framework 30 + build-ghostty-xcframework: $(GHOSTTY_BUILD_STAMP) # Build ghostty framework 31 + @$(MAKE) _record-ghostty-hash 29 32 30 - $(GHOSTTY_BUILD_OUTPUTS): 33 + # Internal: actually rebuild ghostty. 34 + $(GHOSTTY_BUILD_STAMP): 31 35 @cd $(CURRENT_MAKEFILE_DIR)/ThirdParty/ghostty && mise exec -- zig build -Doptimize=ReleaseFast -Demit-xcframework=true -Dsentry=false 32 36 rsync -a ThirdParty/ghostty/macos/GhosttyKit.xcframework Frameworks 33 37 @src="$(CURRENT_MAKEFILE_DIR)/ThirdParty/ghostty/zig-out/share/ghostty"; \ ··· 38 42 rsync -a --delete "$$src/" "$$dst/"; \ 39 43 mkdir -p "$$terminfo_dst"; \ 40 44 rsync -a --delete "$$terminfo_src/" "$$terminfo_dst/" 45 + touch "$(GHOSTTY_BUILD_STAMP)" 41 46 42 - build-app: build-ghostty-xcframework # Build the macOS app (Debug) 47 + # Public entry point: only rebuilds ghostty if submodule SHA changed (or outputs are missing). 48 + ensure-ghostty: _check-ghostty-hash # Ensure GhosttyKit is up-to-date (fast path when unchanged) 49 + 50 + # Internal: compare current submodule SHA against the recorded one. 51 + _check-ghostty-hash: 52 + @current_sha="$$(git -C $(CURRENT_MAKEFILE_DIR)/ThirdParty/ghostty rev-parse HEAD)"; \ 53 + last_sha=""; \ 54 + if [ -f "$(GHOSTTY_HASH_FILE)" ]; then \ 55 + last_sha="$$(cat "$(GHOSTTY_HASH_FILE)")"; \ 56 + fi; \ 57 + artifacts_ok=1; \ 58 + for path in "$(GHOSTTY_XCFRAMEWORK_PATH)" "$(GHOSTTY_RESOURCE_PATH)" "$(GHOSTTY_TERMINFO_PATH)"; do \ 59 + if [ ! -e "$$path" ]; then \ 60 + artifacts_ok=0; \ 61 + fi; \ 62 + done; \ 63 + if [ "$$current_sha" != "$$last_sha" ] || [ "$$artifacts_ok" -ne 1 ]; then \ 64 + echo "Syncing GhosttyKit for submodule $$current_sha"; \ 65 + $(MAKE) -B build-ghostty-xcframework; \ 66 + if [ "$$current_sha" != "$$last_sha" ]; then \ 67 + rm -rf ~/Library/Developer/Xcode/DerivedData/supacode-*; \ 68 + echo "Cleared Xcode DerivedData for ghostty header/module changes"; \ 69 + fi; \ 70 + else \ 71 + echo "GhosttyKit up-to-date (SHA unchanged)"; \ 72 + fi 73 + 74 + # Internal: record the current submodule SHA after a successful build. 75 + _record-ghostty-hash: 76 + @git -C $(CURRENT_MAKEFILE_DIR)/ThirdParty/ghostty rev-parse HEAD > "$(GHOSTTY_HASH_FILE)" 77 + 78 + # Force a clean rebuild of GhosttyKit (ignores cached SHA, useful after submodule updates). 79 + sync-ghostty: # Force sync GhosttyKit to current submodule HEAD (always rebuilds) 80 + @echo "Forcing GhosttyKit rebuild..." 81 + $(MAKE) -B build-ghostty-xcframework 82 + rm -rf ~/Library/Developer/Xcode/DerivedData/supacode-* 83 + @echo "Done. Xcode module cache cleared for fresh compilation." 84 + 85 + build-app: ensure-ghostty # Build the macOS app (Debug) 43 86 bash -o pipefail -c 'xcodebuild -project supacode.xcodeproj -scheme supacode -configuration Debug build -skipMacroValidation -clonedSourcePackagesDirPath $(SPM_CACHE_DIR) 2>&1 | mise exec -- xcsift -qw --format toon' 44 87 45 88 build-cli: # Build Swift CLI binary (SPM) ··· 197 240 export-archive: # Export xarchive 198 241 bash -o pipefail -c 'xcodebuild -exportArchive -archivePath build/supacode.xcarchive -exportPath build/export -exportOptionsPlist build/ExportOptions.plist 2>&1 | mise exec -- xcsift -qw --format toon' 199 242 200 - test: build-ghostty-xcframework 243 + test: ensure-ghostty 201 244 xcodebuild test -project supacode.xcodeproj -scheme supacode -destination "platform=macOS" CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY="" -skipMacroValidation -clonedSourcePackagesDirPath $(SPM_CACHE_DIR) 2>&1 202 245 203 246 test-cli-smoke: build-cli # Smoke test CLI executable
+9
README.md
··· 31 31 make format # Run swift-format 32 32 ``` 33 33 34 + ### Local Ghostty sync (avoid submodule/XCFramework drift) 35 + 36 + ```bash 37 + make ensure-ghostty # fast SHA check, rebuilds only when ThirdParty/ghostty changed 38 + make sync-ghostty # force rebuild + clear DerivedData 39 + ``` 40 + 41 + `build-app` and `test` already run `ensure-ghostty` automatically. 42 + 34 43 ## Contributing 35 44 36 45 - I actual prefer a well written issue describing features/bugs u want rather than a vibe-coded PR