Skip to content

Fix package and test parsing on Swift toolchains before 6.1 - #109

Merged
devxoul merged 1 commit into
devxoul:mainfrom
dajiaohuang:fix/swift-pre61-trailing-commas-20261016
Oct 18, 2026
Merged

devxoul merged 1 commit into
devxoul:mainfrom
dajiaohuang:fix/swift-pre61-trailing-commas-20261016

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Problem

With Swift 6.0.3 on Ubuntu 24.04, swift build at main (529bfcb) fails while loading Package.swift:

Package.swift:18:1: error: unexpected ',' separator

After removing that argument-list trailing comma, swift test reaches the same syntax error in testRethrows. Trailing commas in function calls require Swift 6.1+, while the package currently declares Swift tools 5.0. This prevents consumers with an older toolchain from building the package, before any library code is compiled.

Change

Remove the two argument-list trailing commas in the package manifest and existing test. Array/dictionary trailing commas are unchanged. No API, deployment target, tools-version or runtime behavior changes. The Tuist configuration and its current toolchain requirements are untouched.

Validation

Using Swift 6.0.3, with isolated HOME/config/cache/temp directories:

  • Before: manifest fails; fixing only the manifest exposes the test's matching parser failure.
  • After: swift build and all 7 existing swift test tests pass.
  • A small external consumer passed value-copy with, reference identity/mutation then/with, do, collection conformances, NSObject/OperationQueue, JSONEncoder/JSONDecoder round-trip, and throwing closures through all three public methods.
  • git diff --check passes.

Apple-platform Tuist/Xcode simulator checks were not run on this Windows/WSL host. Swift 5.x itself was not tested; the observed failure and repair are on 6.0.3. The existing README installation corrections in #95/#97 and actor-isolation work in #107 are separate and are not duplicated here.

@typeey typeey Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed both edits line-by-line. Removing these trailing commas avoids syntax introduced in Swift 6.1 without changing behavior. No correctness or regression issues found.

Build/test results remain author-reported; not independently rerun.

@devxoul
devxoul merged commit 532b0e2 into devxoul:main Oct 18, 2026
4 of 6 checks passed
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