node/tools/nix/temporal-no-vendored-icu.patch
Antoine du Hamel de5644cba8
tools: make v8.nix more stable
If we only pass to the V8 builders the dependencies it actually needs,
we can avoid rebuilding the same version of V8 just because an unrelated
Node.js dependency has been updated.

PR-URL: https://github.com/nodejs/node/pull/62508
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-04-10 14:34:30 +00:00

63 lines
2.8 KiB
Diff

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