From 1f578da985ff8b05bc7ec6e4488a93ca657980e9 Mon Sep 17 00:00:00 2001 From: SeungHyun Hong Date: Tue, 14 Apr 2026 10:17:41 +0900 Subject: [PATCH] fix: SPM manifest compilation on Swift 6.1 `String(cString:encoding:)` is a Foundation extension on `String` and is not available in the SwiftPM manifest context, where only `PackageDescription` is imported. On Swift 6.1 / Xcode 16+, `swift package resolve` now fails with: error: extra argument 'encoding' in call Use the stdlib `String(cString:)` initializer, which already decodes as UTF-8 and matches the original intent. --- Package@swift-6.1.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Package@swift-6.1.swift b/Package@swift-6.1.swift index 636c3b8e10..8ccba0b397 100644 --- a/Package@swift-6.1.swift +++ b/Package@swift-6.1.swift @@ -69,7 +69,7 @@ var targets: [Target] = [ ] let env = getenv("EXPERIMENTAL_SPM_BUILDS") -if let env = env, String(cString: env, encoding: .utf8) == "1" { +if let env = env, String(cString: env) == "1" { products.append(.library(name: "SentrySPM", type: .dynamic, targets: ["SentryObjc"])) targets.append(contentsOf: [ // At least one source file is required, therefore we use a dummy class to satisfy the SPM build system