Skip to content

Conversation

@aduh95
Copy link
Contributor

@aduh95 aduh95 commented Nov 13, 2025

N.B.: it only works if you provide the temporal_capi a shared library.

I've tested it with:

  • shared ICU: nix-shell --arg withTemporal true --run 'make build-ci -j12'
  • without ICU: nix-shell --arg icu null --arg withTemporal true --run 'make build-ci -j12'
  • small ICU: nix-shell --argstr icu small --arg withTemporal true --run 'make build-ci -j12'

I needed to apply the following patch, IIUC that's related to targeting a different version of temporal_capi (already fixed upstream v8/v8@0cbecc1 and v8/v8@e0dc7e8), and V8 using some non-exposed ICU internals.

diff --git a/deps/v8/src/objects/js-date-time-format.cc b/deps/v8/src/objects/js-date-time-format.cc
index 496ce5325ac..2be0ada1992 100644
--- a/deps/v8/src/objects/js-date-time-format.cc
+++ b/deps/v8/src/objects/js-date-time-format.cc
@@ -946,8 +946,6 @@ bool CalendarEquals(temporal_rs::AnyCalendarKind kind,
     case HijriTabularTypeIIFriday:
       return other_kind == "islamic-civil" || other_kind == "islamicc" ||
              other_kind == "islamic";
-    case HijriSimulatedMecca:
-      return other_kind == "islamic-rgsa" || other_kind == "islamic";
     case HijriTabularTypeIIThursday:
       return other_kind == "islamic-tbla" || other_kind == "islamic";
     case HijriUmmAlQura:
diff --git a/deps/v8/src/objects/js-temporal-zoneinfo64.cc b/deps/v8/src/objects/js-temporal-zoneinfo64.cc
index 99dd3a84c1e..b6b399c10dc 100644
--- a/deps/v8/src/objects/js-temporal-zoneinfo64.cc
+++ b/deps/v8/src/objects/js-temporal-zoneinfo64.cc
@@ -11,12 +11,44 @@
 #include "temporal_rs/TimeZone.hpp"
 
 #ifdef V8_INTL_SUPPORT
-#include "udatamem.h"
+#include "unicode/udata.h"
+typedef struct  {
+    uint16_t    headerSize;
+    uint8_t     magic1;
+    uint8_t     magic2;
+} MappedData;
+typedef struct  {
+    MappedData  dataHeader;
+    UDataInfo   info;
+} DataHeader;
+typedef struct {
+    void*  Lookup;
+    void*  NumEntries; 
+} commonDataFuncs;
+struct UDataMemory {
+    const commonDataFuncs  *vFuncs;      /* Function Pointers for accessing TOC             */
+
+    const DataHeader *pHeader;     /* Header of the memory being described by this    */
+                                   /*   UDataMemory object.                           */
+    const void       *toc;         /* For common memory, table of contents for        */
+                                   /*   the pieces within.                            */
+    UBool             heapAllocated;  /* True if this UDataMemory Object is on the    */
+                                   /*  heap and thus needs to be deleted when closed. */
+
+    void             *mapAddr;     /* For mapped or allocated memory, the start addr. */
+                                   /* Only non-null if a close operation should unmap */
+                                   /*  the associated data.                           */
+    void             *map;         /* Handle, or other data, OS dependent.            */
+                                   /* Only non-null if a close operation should unmap */
+                                   /*  the associated data, and additional info       */
+                                   /*   beyond the mapAddr is needed to do that.      */
+    int32_t           length;      /* Length of the data in bytes; -1 if unknown.     */
+};
 #else
 // Defined in builtins-temporal-zoneinfo64-data.cc, generated by
 // include-file-as-bytes.py
-extern "C" uint32_t zoneinfo64_static_data[];
-extern "C" size_t zoneinfo64_static_data_len;
+static uint32_t zoneinfo64_static_data[] = {};
+static size_t zoneinfo64_static_data_len = 0;
 #endif
 
 namespace v8::internal {
@@ -33,7 +65,7 @@ ZoneInfo64Provider::ZoneInfo64Provider() {
   // NOT udata_getLength: this ignores the header,
   // and we're parsing resb files with the header
   auto length = memory->length;
-  const void* data = udata_getRawMemory(memory);
+  const void* data = udata_getMemory(memory);
   DCHECK_WITH_MSG(length % 4 == 0, "ICU4C should align udata to uint32_t");
   if (length % 4 != 0) {
     // This really shouldn't happen: ICU4C aligns these files
-- 
2.51.0

The first commit is cherry-picked from #60693, cc @targos

Refs: #58730

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/gyp
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added build Issues and PRs related to build files or the CI. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency. labels Nov 13, 2025
@aduh95 aduh95 added dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. labels Nov 13, 2025
@legendecas
Copy link
Member

For static library support: #60703 :D

targos and others added 2 commits November 18, 2025 01:43
Refs: nodejs#58730
Co-authored-by: =?UTF-8?q?Micha=C3=ABl=20Zasso?= <targos@protonmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@aduh95 aduh95 force-pushed the v8-enable-temporal-support branch from d5596f8 to 11024b0 Compare November 18, 2025 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI. dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. dont-land-on-v24.x PRs that should not land on the v24.x-staging branch and should not be released in v24.x. needs-ci PRs that need a full CI run. tools Issues and PRs related to the tools directory. v8 engine Issues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants