From 40af8cc0babc4c2affe6a27a823261dba9b29fc5 Mon Sep 17 00:00:00 2001 From: Kenta Kubo <601636+kkebo@users.noreply.github.com> Date: Wed, 3 Dec 2025 02:53:31 +0900 Subject: [PATCH] Fix build failure on Swift Playground The PR #311 introduced `Context.environment`, so that swift-async-algorithm can no longer be used in the Swift Playground. However, `Context.environment` is equivalent to `ProcessInfo.processInfo.environment`, so this is an unnecessary sacrifice. This change is intended to fix that. --- Package.swift | 3 ++- Package@swift-5.8.swift | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index c6a2894c..1c5eb68e 100644 --- a/Package.swift +++ b/Package.swift @@ -1,5 +1,6 @@ // swift-tools-version: 6.2 +import Foundation import PackageDescription import CompilerPluginSupport @@ -93,7 +94,7 @@ let package = Package( ] ) -if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { +if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { package.dependencies += [ .package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0") ] diff --git a/Package@swift-5.8.swift b/Package@swift-5.8.swift index 8161e475..40a43dba 100644 --- a/Package@swift-5.8.swift +++ b/Package@swift-5.8.swift @@ -1,5 +1,6 @@ // swift-tools-version: 5.8 +import Foundation import PackageDescription import CompilerPluginSupport @@ -87,7 +88,7 @@ let package = Package( ] ) -if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { +if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { package.dependencies += [ .package(url: "https://github.com/apple/swift-collections.git", from: "1.1.0") ]