Skip to content

Commit f575f30

Browse files
Merge pull request #443 from swiftwasm/update-base-tag/release-6.0-swift-6.0-DEVELOPMENT-SNAPSHOT-2024-10-12-a
Update base tag for release-6.0 to swift-6.0-DEVELOPMENT-SNAPSHOT-2024-10-12-a
2 parents 0b18b2c + d516a93 commit f575f30

File tree

3 files changed

+43
-31
lines changed

3 files changed

+43
-31
lines changed

schemes/release-6.0/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"update-checkout-scheme": "release/6.0",
3-
"base-tag": "swift-6.0-DEVELOPMENT-SNAPSHOT-2024-10-08-a",
3+
"base-tag": "swift-6.0-DEVELOPMENT-SNAPSHOT-2024-10-12-a",
44
"build-compiler": false,
55
"icu4c": ["https://github.com/swiftwasm/icu4c-wasi/releases/download/0.8.0/icu4c-wasi.tar.xz"],
66
"libxml2": ["https://github.com/swiftwasm/libxml2-wasm/releases/download/2.0.0/libxml2-wasm32-unknown-wasi.tar.gz"],

schemes/release-6.0/swift-corelibs-foundation/0004-CMake-Use-LIBXML2_INCLUDE_DIR-instead-of-hardcoding-.patch

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
From 904db472e5db7bf77aed8f36f84f761fbd471cda Mon Sep 17 00:00:00 2001
2+
From: Yuta Saito <[email protected]>
3+
Date: Wed, 16 Oct 2024 05:12:44 +0000
4+
Subject: [PATCH] [wasm] Fix WASI build around TimeZone
5+
6+
https://github.com/swiftlang/swift-foundation/pull/975 started to
7+
restrict the fallback value for `TZDIR` and it revealed that WASI
8+
platform implicitly depends on TZDIR even though it won't have such
9+
directory. This patch explicitly handles the case for WASI platform for
10+
timezone operations.
11+
---
12+
Sources/FoundationEssentials/TimeZone/TimeZone.swift | 2 +-
13+
Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift | 3 +++
14+
2 files changed, 4 insertions(+), 1 deletion(-)
15+
16+
diff --git a/Sources/FoundationEssentials/TimeZone/TimeZone.swift b/Sources/FoundationEssentials/TimeZone/TimeZone.swift
17+
index 9be9de09..fa26a8c7 100644
18+
--- a/Sources/FoundationEssentials/TimeZone/TimeZone.swift
19+
+++ b/Sources/FoundationEssentials/TimeZone/TimeZone.swift
20+
@@ -390,7 +390,7 @@ extension TimeZone {
21+
22+
extension TimeZone {
23+
internal static func dataFromTZFile(_ name: String) -> Data {
24+
-#if NO_TZFILE || os(Windows)
25+
+#if NO_TZFILE || os(Windows) || os(WASI)
26+
return Data()
27+
#else
28+
let path = TZDIR + "/" + name
29+
diff --git a/Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift b/Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift
30+
index b4c84d71..ccbb69aa 100644
31+
--- a/Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift
32+
+++ b/Sources/FoundationEssentials/TimeZone/TimeZone_Cache.swift
33+
@@ -131,6 +131,9 @@ struct TimeZoneCache : Sendable, ~Copyable {
34+
return TimeZone(inner: result)
35+
}
36+
}
37+
+#elseif os(WASI)
38+
+ // WASI doesn't provide a way to get the current timezone for now, so
39+
+ // just return the default GMT timezone.
40+
#else
41+
let buffer = UnsafeMutableBufferPointer<CChar>.allocate(capacity: Int(PATH_MAX + 1))
42+
defer { buffer.deallocate() }

0 commit comments

Comments
 (0)