Skip to content

Fix resb on big endian platforms#7658

Merged
robertbastian merged 4 commits intounicode-org:mainfrom
miladfarca:resb-fix-on-be
Feb 20, 2026
Merged

Fix resb on big endian platforms#7658
robertbastian merged 4 commits intounicode-org:mainfrom
miladfarca:resb-fix-on-be

Conversation

@miladfarca
Copy link
Copy Markdown
Contributor

@miladfarca miladfarca commented Feb 17, 2026

Node.js/V8 are now using Temporal with a dependency on Rust. On big endian platforms ICU4C provides data in native BE order causing ZoneInfo64 parsing to fail with "Failed to load timezone info" and is causing test failures on Node.js after enabling Temporal:
nodejs/node#61808

Following the instruction in this page:
https://chromium.googlesource.com/chromium/src/+/28fe000/third_party/rust/chromium_crates_io/patches/
I have uploaded a patch to Chromium to fix this issue on that repository:
http://crrev.com/c/7583895
And I have also applied the same patch here to ICU4X upstream.

Changelog

resb: Support big-endian platforms

@miladfarca miladfarca requested a review from a team as a code owner February 17, 2026 15:21
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 17, 2026

CLA assistant check
All committers have signed the CLA.

@miladfarca
Copy link
Copy Markdown
Contributor Author

/cc @leftmostcat

// contents of the repr info, we explicitly depend on little endian data
// in order to ensure compatibility with `zerovec`.
let (endianness, value) = (Endianness::try_from(value[0])?, &value[1..]);
if endianness != Endianness::Little {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: don't remove this check, make it compare to the platform

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use cfg!(target_endian = "little") to get a boolean

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've created a platform specific check.

@@ -117,11 +117,6 @@ impl TryFrom<&[u8]> for BinReprInfo {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the comment, it doesn't make sense

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

}
};
let descriptor = u32::from_le_bytes(descriptor);
let descriptor = u32::from_ne_bytes(descriptor);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should document from_words as requiring a native-endian file, noting that zoneinfo64.res comes in both formats, and then every time we do this we should say "See documentation on from_words".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a comment under utils/resb/src/binary/deserializer.rs.

miladfarca and others added 2 commits February 17, 2026 14:09
Co-authored-by: Robert Bastian <4706271+robertbastian@users.noreply.github.com>
@robertbastian
Copy link
Copy Markdown
Member

@miladfarca please sign the CLA

@miladfarca
Copy link
Copy Markdown
Contributor Author

miladfarca commented Feb 18, 2026

@robertbastian I'll need to check if we (IBM) are allowed to sign this CLA as we are not in your current list:
https://api.unicode.org/cla/corporate

@miladfarca
Copy link
Copy Markdown
Contributor Author

@robertbastian I have now signed the CLA, sorry for the delay.

@robertbastian robertbastian merged commit d310df8 into unicode-org:main Feb 20, 2026
32 checks passed
mohd-akram pushed a commit to gsource-mirror/chromium-src-third_party-rust that referenced this pull request Feb 23, 2026
On big endian platforms ICU4C provides data in native BE order causing
ZoneInfo64 parsing to fail with "Failed to load timezone info" and is
causing test failures on Node.js after enabling temporal on BE:
nodejs/node#61808

This CL uses `from_ne_bytes` to read data in native endian order
instead.

Patch is also applied to ICU4X upstream:
unicode-org/icu4x#7658

Bug: 401065166
Change-Id: Ib6d38b0decc2365187663b4eac5e2dfd3a975aa4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7583895
Reviewed-by: Manish Goregaokar <manishearth@google.com>
Commit-Queue: Manish Goregaokar <manishearth@google.com>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1588862}
NOKEYCHECK=True
GitOrigin-RevId: 19ec3dce45600fc7c825f921ac1cebe3bc63e1ba
richardlau added a commit to richardlau/node-1 that referenced this pull request Mar 6, 2026
Original commit message:

    Fix resb on big endian platforms (nodejs#7658)

Refs: unicode-org/icu4x@d310df8
Refs: unicode-org/icu4x#7658
richardlau added a commit to richardlau/node-1 that referenced this pull request Mar 6, 2026
Original commit message:

    Fix resb on big endian platforms

Refs: unicode-org/icu4x@d310df8
Refs: unicode-org/icu4x#7658
Vanya-PIP pushed a commit to nevaoss/chromium that referenced this pull request Mar 6, 2026
On big endian platforms ICU4C provides data in native BE order causing
ZoneInfo64 parsing to fail with "Failed to load timezone info" and is
causing test failures on Node.js after enabling temporal on BE:
nodejs/node#61808

This CL uses `from_ne_bytes` to read data in native endian order
instead.

Patch is also applied to ICU4X upstream:
unicode-org/icu4x#7658

Bug: 401065166
Change-Id: Ib6d38b0decc2365187663b4eac5e2dfd3a975aa4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7583895
Reviewed-by: Manish Goregaokar <manishearth@google.com>
Commit-Queue: Manish Goregaokar <manishearth@google.com>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1588862}
nodejs-github-bot pushed a commit to nodejs/node that referenced this pull request Mar 9, 2026
Original commit message:

    Fix resb on big endian platforms

Refs: unicode-org/icu4x@d310df8
Refs: unicode-org/icu4x#7658
PR-URL: #62138
Fixes: #61808
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
aduh95 pushed a commit to nodejs/node that referenced this pull request Mar 10, 2026
Original commit message:

    Fix resb on big endian platforms

Refs: unicode-org/icu4x@d310df8
Refs: unicode-org/icu4x#7658
PR-URL: #62138
Fixes: #61808
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
aduh95 pushed a commit to nodejs/node that referenced this pull request Mar 10, 2026
Original commit message:

    Fix resb on big endian platforms

Refs: unicode-org/icu4x@d310df8
Refs: unicode-org/icu4x#7658
PR-URL: #62138
Fixes: #61808
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants