Build GraphcodeKit, the CLI, and graphcoded on Linux (#83) - #110
Open
scgopi wants to merge 2 commits into
Open
Conversation
Adds a root Package.swift so the non-UI products build with SwiftPM on Linux, guards the Darwin-only code paths (openpty, sun_len, SOCK_STREAM, launchd bootstrap), and adds a Linux CI workflow as the portability gate. The macOS app keeps building through Tuist, which resolves its dependencies from Tuist/Package.swift and ignores the root manifest. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
posix_openpt/grantpt/unlockpt/ptsname never make it through Swift's Glibc module (stdlib.h feature-macro guards), while pty.h — and with glibc >= 2.34 libc itself — provides openpty on both platforms. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First concrete step toward #83 (Add linux version): the three non-UI products —
GraphcodeKit,graphcode(CLI), andgraphcoded(daemon) — now build on Linux, gated by CI.Package.swift: a SwiftPM manifest for the non-UI targets, so they build anywhere swift-corelibs Foundation runs. Tuist keeps resolving the app's dependencies fromTuist/Package.swiftand ignores the root manifest (verified:tuist installstill succeeds). Targets stay in Swift language mode 5 to match how Tuist builds these same sources today.PTYProcessSession:openptyis Darwin/libutil; on Linux the PTY is opened with the POSIXposix_openpt/grantpt/unlockpt/ptsnamesequence instead.DaemonSocketClient+graphcoded/main.swift:sockaddr_un.sun_lendoesn't exist on Linux;SOCK_STREAMimports as the__socket_typeenum there;timeval.tv_usecissuseconds_ton both.FramedMessageIO:import Glibcfallback forread/write/errno.DaemonBootstrap: launchd/quarantine-xattr install flow, only called by the macOS app — gated#if os(macOS). A Linux install story would be a systemd user unit, out of scope here..github/workflows/linux.yml: builds with theswift:6.2container and smoke-runs the CLI — the portability gate for this and future changes.What this does NOT cover
graphcodeapp (SwiftUI + GhosttyKit + Carbon) — a Linux UI is a much larger separate effort.zmx(Zig, inThirdParty/) cross-compiles in principle but isn't wired into Linux CI.Test plan
swift buildpasses on macOS; SwiftPM-builtgraphcodeprints usage and exits 0tuist installstill resolves (root manifest doesn't confuse Tuist)Closes nothing on its own — #83 stays open for the app story; findings documented there.
🤖 Generated with Claude Code