Skip to content

Build GraphcodeKit, the CLI, and graphcoded on Linux (#83) - #110

Open
scgopi wants to merge 2 commits into
mainfrom
issue-83-linux-foundations
Open

Build GraphcodeKit, the CLI, and graphcoded on Linux (#83)#110
scgopi wants to merge 2 commits into
mainfrom
issue-83-linux-foundations

Conversation

@scgopi

@scgopi scgopi commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Summary

First concrete step toward #83 (Add linux version): the three non-UI products — GraphcodeKit, graphcode (CLI), and graphcoded (daemon) — now build on Linux, gated by CI.

  • Root 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 from Tuist/Package.swift and ignores the root manifest (verified: tuist install still succeeds). Targets stay in Swift language mode 5 to match how Tuist builds these same sources today.
  • Platform guards:
    • PTYProcessSession: openpty is Darwin/libutil; on Linux the PTY is opened with the POSIX posix_openpt/grantpt/unlockpt/ptsname sequence instead.
    • DaemonSocketClient + graphcoded/main.swift: sockaddr_un.sun_len doesn't exist on Linux; SOCK_STREAM imports as the __socket_type enum there; timeval.tv_usec is suseconds_t on both.
    • FramedMessageIO: import Glibc fallback for read/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 the swift:6.2 container and smoke-runs the CLI — the portability gate for this and future changes.

What this does NOT cover

  • The graphcode app (SwiftUI + GhosttyKit + Carbon) — a Linux UI is a much larger separate effort.
  • zmx (Zig, in ThirdParty/) cross-compiles in principle but isn't wired into Linux CI.
  • A daemon install/service story on Linux (systemd user unit).

Test plan

  • swift build passes on macOS; SwiftPM-built graphcode prints usage and exits 0
  • tuist install still resolves (root manifest doesn't confuse Tuist)
  • Linux CI job on this PR is green

Closes nothing on its own — #83 stays open for the app story; findings documented there.

🤖 Generated with Claude Code

Sravani2201 and others added 2 commits August 14, 2026 21:08
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>
@scgopi scgopi mentioned this pull request Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants