Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion schemes/release-6.0/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"update-checkout-scheme": "release/6.0",
"base-tag": "swift-6.0-DEVELOPMENT-SNAPSHOT-2024-10-08-a",
"base-tag": "swift-6.0-DEVELOPMENT-SNAPSHOT-2024-10-12-a",
"build-compiler": false,
"icu4c": ["https://github.com/swiftwasm/icu4c-wasi/releases/download/0.8.0/icu4c-wasi.tar.xz"],
"libxml2": ["https://github.com/swiftwasm/libxml2-wasm/releases/download/2.0.0/libxml2-wasm32-unknown-wasi.tar.gz"],
Expand Down

This file was deleted.

42 changes: 42 additions & 0 deletions schemes/release-6.0/swift-foundation/984.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 904db472e5db7bf77aed8f36f84f761fbd471cda Mon Sep 17 00:00:00 2001
From: Yuta Saito <[email protected]>
Date: Wed, 16 Oct 2024 05:12:44 +0000
Subject: [PATCH] [wasm] Fix WASI build around TimeZone

https://github.com/swiftlang/swift-foundation/pull/975 started to
restrict the fallback value for `TZDIR` and it revealed that WASI
platform implicitly depends on TZDIR even though it won't have such
directory. This patch explicitly handles the case for WASI platform for
timezone operations.
---
Sources/FoundationEssentials/TimeZone/TimeZone.swift | 2 +-
Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Sources/FoundationEssentials/TimeZone/TimeZone.swift b/Sources/FoundationEssentials/TimeZone/TimeZone.swift
index 9be9de09..fa26a8c7 100644
--- a/Sources/FoundationEssentials/TimeZone/TimeZone.swift
+++ b/Sources/FoundationEssentials/TimeZone/TimeZone.swift
@@ -390,7 +390,7 @@ extension TimeZone {

extension TimeZone {
internal static func dataFromTZFile(_ name: String) -> Data {
-#if NO_TZFILE || os(Windows)
+#if NO_TZFILE || os(Windows) || os(WASI)
return Data()
#else
let path = TZDIR + "/" + name
diff --git a/Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift b/Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift
index b4c84d71..ccbb69aa 100644
--- a/Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift
+++ b/Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift
@@ -131,6 +131,9 @@ struct TimeZoneCache : Sendable, ~Copyable {
return TimeZone(inner: result)
}
}
+#elseif os(WASI)
+ // WASI doesn't provide a way to get the current timezone for now, so
+ // just return the default GMT timezone.
#else
let buffer = UnsafeMutableBufferPointer<CChar>.allocate(capacity: Int(PATH_MAX + 1))
defer { buffer.deallocate() }
Loading