From 7a6628c17a92853a4661929b98a23e9ff66cee82 Mon Sep 17 00:00:00 2001 From: miqaeli Date: Fri, 22 May 2026 15:09:47 +0400 Subject: [PATCH] Fix Linux build: import FoundationNetworking in AlibabaTokenPlanCookieHeader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AlibabaTokenPlanCookieHeader.swift uses HTTPCookie (lines 79, 94, 95, 97-99, 102, 113, 118, 134, 146) but only imports Foundation. On macOS HTTPCookie lives in Foundation, but on Linux it was moved to FoundationNetworking and is "explicitly marked unavailable" in Foundation — so the new file added in #1098 (Alibaba Token Plan provider) breaks the Linux build of CodexBarCore outright. Sibling new files in the same PR (AlibabaTokenPlanUsageFetcher, T3ChatUsageFetcher) already use the right conditional import; this one was overlooked. Verify on Ubuntu 24.04 x86_64 with Swift 6.2.4: Before: `swift build` -> `error: 'HTTPCookie' is unavailable: This type has moved to the FoundationNetworking module. Import that module to use it.` (10+ occurrences across the file, build aborts) After: `swift build` -> Build complete! (72.86s) `swift test` -> 14/14 pass (3 suites) No source-of-truth change beyond restoring buildability — adds the same `#if canImport(FoundationNetworking) / import FoundationNetworking / #endif` block that already guards GeminiStatusProbe, ManusCookieHeader, AlibabaTokenPlanUsageFetcher, T3ChatUsageFetcher, etc. Co-Authored-By: Claude Opus 4.7 --- .../Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift b/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift index 03791cc95..60c2ab24b 100644 --- a/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift +++ b/Sources/CodexBarCore/Providers/Alibaba/AlibabaTokenPlanCookieHeader.swift @@ -1,4 +1,7 @@ import Foundation +#if canImport(FoundationNetworking) +import FoundationNetworking +#endif struct AlibabaTokenPlanCookieHeaders: Sendable { private static let cachedAPIHeaderName = "__codexbar_alibaba_token_plan_api"