Skip to content

Add Cloud Agent Swift-on-Linux development environment - #16

Open
djpfs wants to merge 2 commits into
mainfrom
cursor/setup-swift-linux-env-1087
Open

Add Cloud Agent Swift-on-Linux development environment#16
djpfs wants to merge 2 commits into
mainfrom
cursor/setup-swift-linux-env-1087

Conversation

@djpfs

@djpfs djpfs commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a repo-managed Cursor Cloud Agent environment for Macker.

Macker is a macOS-only application — the GUI uses SwiftUI/AppKit and ContainerBackend talks to Apple's container-apiserver over libxpc (xpc_connection_*) plus the Security framework, none of which exist on Linux and are not guarded by #if os(...). Cloud Agents run on x86_64 Linux, so the full product cannot be built, tested, or run here (CI builds/tests on macos-15). This environment therefore provides the pinned Swift 6 toolchain so agents can still do useful work: edit sources with SourceKit-LSP, resolve dependencies, and run the same formatter CI uses.

What this adds

  • .cursor/environment.json — repo-managed config running on Cursor's default Linux image.
  • .cursor/install.sh — idempotent, self-provisioning: installs the pinned Swift 6.1 toolchain (via swiftly, matching swift-tools-version: 6.0) on first boot, then swift package resolve. Does not run swift build, which cannot succeed on Linux by design.
  • .cursor/README.md — documents the macOS-only build limitation and what the Linux environment can/cannot do.

The install step is self-healing so it works on the default image and is baked into environment builds on subsequent boots. (A committed Dockerfile was intentionally dropped: just-in-time Cloud Agents don't build a repo Dockerfile, and a greenfield run can't validate one via the build tooling — a self-provisioning install step is fully validatable instead.)

Capabilities on Linux

Capability Command Works
Resolve dependencies swift package resolve yes
Format / lint swift format lint -r Sources Tests yes
Edit with SourceKit-LSP (editor) yes
Build the app swift build / make build no — macOS-only
Run tests swift test / make test no — macOS + Xcode
Run the app/CLI macker no — macOS + apple/container

Validation

  • swift package resolve succeeds on Linux (Swift 6.1.3).
  • install.sh runs cleanly and is idempotent (fast path re-run verified).
  • swift build fails only on Darwin-only frameworks (xpc_connection_t, Security), confirming the toolchain is correctly wired and the sole blocker is the macOS platform.
  • swift format runs against Sources/Tests.
  • Validated end-to-end via a Cloud Agent environment build that runs install.sh from scratch on a clean image, plus a fresh agent booted from the resulting build.
Open in Web Open in Cursor 

cursoragent and others added 2 commits August 28, 2026 02:12
Macker is a macOS-only app (SwiftUI/AppKit + apple/container libxpc), so it
cannot be built/tested/run on Linux Cloud Agents. This adds a repo-managed
environment that installs the pinned Swift 6 toolchain so agents can edit,
resolve dependencies, and run swift-format.

- .cursor/Dockerfile: FROM swift:6.1-noble + git/curl, ubuntu user
- .cursor/install.sh: idempotent 'swift package resolve'
- .cursor/environment.json: repo-managed config
- .cursor/README.md: documents the macOS-only build limitation

Co-authored-by: João Pedro Freire <djpfs@users.noreply.github.com>
A committed .cursor/Dockerfile is not built by just-in-time Cloud Agents, and a
greenfield run cannot validate a Dockerfile via trigger-environment-build. Switch
to a repo-managed default-image environment whose install.sh installs the pinned
Swift 6 toolchain (idempotent/self-healing) so it can be built and verified with
the standard environment-build flow.

- Remove .cursor/Dockerfile
- install.sh: install swiftly + Swift 6.1 on first boot, then resolve deps
- environment.json: default image + install step
- README: document repo-managed default-image setup

Co-authored-by: João Pedro Freire <djpfs@users.noreply.github.com>
@djpfs
djpfs marked this pull request as ready for review August 28, 2026 02:46
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