From eb075d0c8df2f526e5290f8e614c6dc8f859b5fd Mon Sep 17 00:00:00 2001 From: udondan Date: Sun, 13 Sep 2026 09:52:53 +0200 Subject: [PATCH] chore: fix build-release failing under newer Swift toolchain -Xswiftc -warnings-as-errors was applied to the whole build graph, so any warning surfacing in swift-argument-parser under a newer Swift compiler broke the build. Scope the flag to our own targets via Package.swift swiftSettings instead, bump swift-argument-parser past 1.3.x to pick up its Sendable-conformance fixes, and migrate off its now-deprecated single-argument completion closure API. --- Makefile | 2 +- Package.resolved | 4 ++-- Package.swift | 8 +++++--- Sources/RemindersLibrary/CLI.swift | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index d447a1f..464d54a 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ ARCHIVE=$(EXECUTABLE).tar.gz .PHONY: clean build-release package build-release: - swift build --configuration release -Xswiftc -warnings-as-errors --arch arm64 --arch x86_64 + swift build --configuration release --arch arm64 --arch x86_64 package: build-release $(RELEASE_BUILD)/$(EXECUTABLE) --generate-completion-script zsh > _reminders diff --git a/Package.resolved b/Package.resolved index c8f0563..789a5f6 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/apple/swift-argument-parser", "state": { "branch": null, - "revision": "46989693916f56d1186bd59ac15124caef896560", - "version": "1.3.1" + "revision": "6a52f3251125d74daf04fcbd5e6f08a75d074382", + "version": "1.8.2" } } ] diff --git a/Package.swift b/Package.swift index 58a5d03..f42dfe0 100644 --- a/Package.swift +++ b/Package.swift @@ -10,18 +10,20 @@ let package = Package( .executable(name: "reminders", targets: ["reminders"]), ], dependencies: [ - .package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "1.3.1")), + .package(url: "https://github.com/apple/swift-argument-parser", .upToNextMajor(from: "1.3.1")), ], targets: [ .executableTarget( name: "reminders", - dependencies: ["RemindersLibrary"] + dependencies: ["RemindersLibrary"], + swiftSettings: [.unsafeFlags(["-warnings-as-errors"])] ), .target( name: "RemindersLibrary", dependencies: [ .product(name: "ArgumentParser", package: "swift-argument-parser"), - ] + ], + swiftSettings: [.unsafeFlags(["-warnings-as-errors"])] ), .testTarget( name: "RemindersTests", diff --git a/Sources/RemindersLibrary/CLI.swift b/Sources/RemindersLibrary/CLI.swift index ad2bbef..9081e49 100644 --- a/Sources/RemindersLibrary/CLI.swift +++ b/Sources/RemindersLibrary/CLI.swift @@ -218,7 +218,7 @@ private struct Delete: ParsableCommand { } } -func listNameCompletion(_ arguments: [String]) -> [String] { +func listNameCompletion(_ arguments: [String], _ position: Int, _ prefix: String) -> [String] { // NOTE: A list name with ':' was separated in zsh completion, there might be more of these or // this might break other shells return reminders.getListNames().map { $0.replacingOccurrences(of: ":", with: "\\:") }