Skip to content

Commit 923b818

Browse files
nodejs-26/26.13.0 package update (#407015)
* Automated fixes: - image-main-package: os/nodejs-26.yaml - package nodejs-26 is an image main package - outdated-version: os/nodejs-26.yaml - package nodejs-26 is outdated: current version 26.12.1, next version 26.13.0, updated commit: 18b32a3b1552e199a01f1a8d9fd64aa756d3b75b * nodejs-26: bump to 26.13.0 Fix the FTBFS on 26.13.0. V8's build-time generator gen-regexp-special-case aborts with "Check failed: ch <= 0xffff" because ICU 79's case-insensitive closure of U+00DF/U+1E9E now includes a supplementary-plane character, while Canonicalize() only accepts UTF-16 code units. Add v8-regexp-special-case-icu79.patch, which skips code points above 0xFFFF in the generator loops. They are irrelevant for non-unicode /i regexps. * nodejs-26: move patch comments into patch files Drop the explanatory comment block above the patch step in the main manifest. The PBKDF2 rationale already lives in ncrypto-pbkdf2-pkcs5.patch; add the ICU 79 rationale as a header to v8-regexp-special-case-icu79.patch. * nodejs-26: address validator findings for 26.13.0 bump Remove the stale 26.12.1 reference from the LTO comment in vars, and restore the comment explaining ncrypto-pbkdf2-pkcs5.patch that was dropped when the second patch was added. * chore(nodejs-26): correct LTO note and cite upstream V8 fix The vars comment blamed --enable-lto for gen-regexp-special-case aborting with "Check failed: ch <= 0xffff". That abort comes from ICU 79.1, which merged into os/ on 2026-10-26 (#401030), the same day the LTO attempt ran. nodejs/node#66987 shows the same abort on a 24.22.1 build with system ICU 79.1 and no LTO. Say that, and note LTO has not been retried with the patch applied. Point the patch header at upstream V8 commit f607706154ea, whose generator half this patch carries, and at the nodejs/node issue, so the patch can be dropped once deps/v8 includes the fix. * fix(nodejs-26): carry the full upstream V8 fix for ICU 79 Replace the generator-only patch with a backport of v8/v8@f607706, taken from Homebrew's node 26.13.0 patch, whose base blobs match this deps/v8 exactly. Besides the gen-regexp-special-case fix, it adds SupplementaryEquivalentsSet so that U+00DF and U+1E9E also match U+1DF95 under /iu and /iv, as upstream V8 does with ICU 79. Add a test covering those matches and the /i cases that the generated IgnoreSet decides. Drop the epoch comment, which described the brotli patch removed in 6f7b9eb177. --------- Co-authored-by: package-updater <[email protected]> Co-authored-by: Daniel Watkins <[email protected]> Co-authored-by: Amber Arcadia <[email protected]> Export: 507fd15db8cabaa2b15d3f07f0171f132e662926
1 parent 7122ecf commit 923b818

2 files changed

Lines changed: 239 additions & 8 deletions

File tree

‎nodejs-26.yaml‎

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package:
22
name: nodejs-26
3-
version: "26.12.1" # On update, please check if -fdelete-null-pointer-checks is still required
4-
epoch: 2 # use system brotli BLOCK_SWITCH error code
3+
version: "26.13.0" # On update, please check if -fdelete-null-pointer-checks is still required
4+
epoch: 0
55
description: "JavaScript runtime built on V8 engine"
66
dependencies:
77
provides:
@@ -21,10 +21,11 @@ vars:
2121
# SHA256 of docker-entrypoint.sh from nodejs/docker-node
2222
docker-entrypoint-hash: a15ac9589c04baf9da95b08e0e79b5cf1d75ab8dc64e06a5e68e4ceb0ad7c8ea
2323
# configure.py flags shared by the node, -minimal and -libnode builds.
24-
# LTO off: with --enable-lto (GCC: -flto=4 -ffat-lto-objects) the build of
25-
# 26.12.1 fails early, because V8's build-time generator
26-
# gen-regexp-special-case, itself compiled with LTO, aborts with
27-
# "Check failed: ch <= 0xffff".
24+
# No --enable-lto yet: a 26.12.1 LTO attempt aborted in V8's
25+
# gen-regexp-special-case with "Check failed: ch <= 0xffff", but that
26+
# abort comes from ICU 79, hits non-LTO builds too, and is fixed by
27+
# v8-regexp-special-case-icu79.patch. LTO has not been retried since.
28+
# https://linear.app/chainguard/issue/OS-5265
2829
configure-flags: >-
2930
--prefix=/usr --shared-brotli --shared-zlib --shared-openssl --shared-cares --shared-nghttp2 --shared-libuv --ninja --openssl-use-def-ca-store --with-icu-default-data-dir=$(icu-config --icudatadir) --with-intl=system-icu --openssl-conf-name=openssl_conf
3031
openssl-version: "4.0"
@@ -67,13 +68,13 @@ pipeline:
6768
with:
6869
repository: https://github.com/nodejs/node.git
6970
tag: v${{package.version}}
70-
expected-commit: bc2e01dcf6acd5cf7d169b5f26cf89abaaeb41f1
71+
expected-commit: 18b32a3b1552e199a01f1a8d9fd64aa756d3b75b
7172

7273
# Keep PBKDF2 matching Chainguard's PKCS5_PBKDF2_HMAC() under OpenSSL 4:
7374
# pass pkcs5=1 so non-approved parameters still work under FIPS
7475
- uses: patch
7576
with:
76-
patches: ncrypto-pbkdf2-pkcs5.patch
77+
patches: ncrypto-pbkdf2-pkcs5.patch v8-regexp-special-case-icu79.patch
7778

7879
- name: Configure and build
7980
runs: |
@@ -144,6 +145,26 @@ test:
144145
EOF
145146
node testIntl.js | grep -F '1,234.56'
146147
node testIntl.js | grep -F '1.234,56'
148+
- name: Regexp case equivalents of U+1DF95 (v8-regexp-special-case-icu79.patch)
149+
runs: |
150+
cat <<'EOF' > testCaseFold.js
151+
const assert = require('node:assert');
152+
const S = '\u{1DF95}';
153+
// Fails if the system ICU lacks Unicode 18 case data, which would
154+
// make the checks below vacuous.
155+
assert.strictEqual(S.toUpperCase(), 'SS');
156+
assert.ok(/^\u00df$/iu.test(S));
157+
assert.ok(/^\u1e9e$/iu.test(S));
158+
assert.ok(new RegExp('^' + S + '$', 'iu').test('\u00df'));
159+
assert.ok(/^[\u00df]$/iu.test(S));
160+
assert.ok(/^\u00df$/iu.test('\u1e9e'));
161+
// /i compares UTF-16 code units: no supplementary matches, and
162+
// U+00DF/U+1E9E and U+017F/s stay distinct (generated IgnoreSet).
163+
assert.ok(!/^\u00df$/i.test(S));
164+
assert.ok(!/^\u00df$/i.test('\u1e9e'));
165+
assert.ok(!/^s$/i.test('\u017f'));
166+
EOF
167+
node testCaseFold.js
147168
148169
subpackages:
149170
- name: ${{package.name}}-minimal
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
From: Jakob Linke <[email protected]>
2+
Subject: [PATCH] [regexp] Handle supplementary case equivalents of BMP
3+
characters
4+
5+
Backport of https://github.com/v8/v8/commit/f607706154eabc4a949628a88b38dbe95cd2274c
6+
to the deps/v8 in Node.js 26.13.0, taken from Homebrew's copy at
7+
https://github.com/Homebrew/homebrew-core/blob/eece823190c2737941058921ecc7ae1f4d2de3b3/Patches/node/icu4c-79.patch
8+
(same base blobs). Upstream's test changes are not included. Drop this
9+
patch once deps/v8 contains that commit.
10+
11+
With ICU 79, U+1DF95 (added in Unicode 18) simple-folds to U+00DF, so
12+
the case-insensitive closure of U+00DF/U+1E9E contains a
13+
supplementary-plane character. V8's build-time generator
14+
gen-regexp-special-case passes it to Canonicalize(), which only accepts
15+
UTF-16 code units, and aborts with "Check failed: ch <= 0xffff".
16+
17+
The generator now drops supplementary code points from the non-unicode
18+
closures and emits SupplementaryEquivalentsSet. The parser uses that set
19+
to desugar U+00DF and U+1E9E under /iu and /iv, so they also match
20+
U+1DF95.
21+
22+
Bug: https://github.com/nodejs/node/issues/66987
23+
---
24+
diff --git a/deps/v8/src/regexp/gen-regexp-special-case.cc b/deps/v8/src/regexp/gen-regexp-special-case.cc
25+
index 86f6b21..98f7097 100644
26+
--- a/deps/v8/src/regexp/gen-regexp-special-case.cc
27+
+++ b/deps/v8/src/regexp/gen-regexp-special-case.cc
28+
@@ -9,6 +9,7 @@
29+
30+
#include "src/base/strings.h"
31+
#include "src/regexp/special-case.h"
32+
+#include "unicode/uchar.h"
33+
34+
namespace v8 {
35+
namespace internal {
36+
@@ -17,6 +18,19 @@ static const base::uc32 kSurrogateStart = 0xd800;
37+
static const base::uc32 kSurrogateEnd = 0xdfff;
38+
static const base::uc32 kNonBmpStart = 0x10000;
39+
40+
+// Removes supplementary code points from |set| and returns whether any were
41+
+// present. Since Unicode 18, the case closure of a BMP character can contain
42+
+// supplementary code points (U+1DF95 LATIN SMALL LIGATURE LONG S WITH
43+
+// DESCENDER S case-folds to U+00DF LATIN SMALL LETTER SHARP S). Non-unicode
44+
+// ignoreCase matching compares UTF-16 code units, so a supplementary code
45+
+// point never matches a BMP character and does not take part in Canonicalize.
46+
+bool RemoveSupplementary(icu::UnicodeSet& set) {
47+
+ constexpr UChar32 kFirstSupplementary = static_cast<UChar32>(kNonBmpStart);
48+
+ if (!set.containsSome(kFirstSupplementary, UCHAR_MAX_VALUE)) return false;
49+
+ set.remove(kFirstSupplementary, UCHAR_MAX_VALUE);
50+
+ return true;
51+
+}
52+
+
53+
// The following code generates "src/regexp/special-case.cc".
54+
void PrintSet(std::ofstream& out, const char* name,
55+
const icu::UnicodeSet& set) {
56+
@@ -51,6 +65,7 @@ void PrintSpecial(std::ofstream& out) {
57+
icu::UnicodeSet current;
58+
icu::UnicodeSet special_add;
59+
icu::UnicodeSet ignore;
60+
+ icu::UnicodeSet supplementary_equivalents;
61+
UErrorCode status = U_ZERO_ERROR;
62+
icu::UnicodeSet upper("[\\p{Lu}]", status);
63+
CHECK(U_SUCCESS(status));
64+
@@ -63,6 +78,7 @@ void PrintSpecial(std::ofstream& out) {
65+
}
66+
current.set(i, i);
67+
current.closeOver(USET_CASE_INSENSITIVE);
68+
+ if (RemoveSupplementary(current)) supplementary_equivalents.add(i);
69+
70+
// Check to see if all characters in the case-folding equivalence
71+
// class as defined by UnicodeSet::closeOver all map to the same
72+
@@ -112,6 +128,7 @@ void PrintSpecial(std::ofstream& out) {
73+
UChar32 canonical = RegExpCaseFolding::Canonicalize(c);
74+
current.set(c, c);
75+
current.closeOver(USET_CASE_INSENSITIVE);
76+
+ RemoveSupplementary(current);
77+
current.removeAll(ignore);
78+
for (int32_t j = 0; j < current.getRangeCount(); j++) {
79+
for (UChar32 c2 = current.getRangeStart(j);
80+
@@ -124,6 +141,7 @@ void PrintSpecial(std::ofstream& out) {
81+
82+
PrintSet(out, "IgnoreSet", ignore);
83+
PrintSet(out, "SpecialAddSet", special_add);
84+
+ PrintSet(out, "SupplementaryEquivalentsSet", supplementary_equivalents);
85+
}
86+
87+
void WriteHeader(const char* header_filename) {
88+
diff --git a/deps/v8/src/regexp/regexp-parser.cc b/deps/v8/src/regexp/regexp-parser.cc
89+
index 2792cd0..dd883c3 100644
90+
--- a/deps/v8/src/regexp/regexp-parser.cc
91+
+++ b/deps/v8/src/regexp/regexp-parser.cc
92+
@@ -10,6 +10,7 @@
93+
#include "src/regexp/regexp-ast.h"
94+
#include "src/regexp/regexp-macro-assembler.h"
95+
#include "src/regexp/regexp.h"
96+
+#include "src/regexp/special-case.h"
97+
#include "src/strings/char-predicates-inl.h"
98+
#include "src/utils/ostreams.h"
99+
#include "src/utils/utils.h"
100+
@@ -156,6 +157,10 @@ void RegExpTextBuilder::FlushText() {
101+
102+
void RegExpTextBuilder::AddCharacter(base::uc16 c) {
103+
FlushPendingSurrogate();
104+
+ if (NeedsDesugaringForIgnoreCase(c)) {
105+
+ AddClassRangesForDesugaring(c);
106+
+ return;
107+
+ }
108+
if (characters_ == nullptr) {
109+
characters_ = zone()->New<ZoneList<base::uc16>>(4, zone());
110+
}
111+
@@ -238,15 +243,18 @@ bool RegExpTextBuilder::NeedsDesugaringForUnicode(RegExpClassRanges* cc) {
112+
return false;
113+
}
114+
115+
-// We only use this for characters made of surrogate pairs. All other
116+
-// characters outside of character classes are made case independent in the
117+
-// code generation.
118+
+// Desugar supplementary characters with case equivalents and BMP characters
119+
+// with supplementary equivalents. Other atoms are folded during code
120+
+// generation.
121+
bool RegExpTextBuilder::NeedsDesugaringForIgnoreCase(base::uc32 c) {
122+
#ifdef V8_INTL_SUPPORT
123+
if (IsUnicodeMode() && ignore_case()) {
124+
+ if (c <= unibrow::Utf16::kMaxNonSurrogateCharCode) {
125+
+ return RegExpCaseFolding::HasSupplementaryEquivalents(
126+
+ static_cast<base::uc16>(c));
127+
+ }
128+
icu::UnicodeSet set(c, c);
129+
- set.closeOver(USET_CASE_INSENSITIVE);
130+
- set.removeAllStrings();
131+
+ RegExpCaseFolding::CloseOver(set, RegExpCaseFolding::Mode::kUnicode);
132+
return set.size() > 1;
133+
}
134+
// In the case where ICU is not included, we act as if the unicode flag is
135+
diff --git a/deps/v8/src/regexp/special-case.h b/deps/v8/src/regexp/special-case.h
136+
index 753c923..80b88a3 100644
137+
--- a/deps/v8/src/regexp/special-case.h
138+
+++ b/deps/v8/src/regexp/special-case.h
139+
@@ -7,8 +7,8 @@
140+
141+
#ifdef V8_INTL_SUPPORT
142+
#include "src/base/logging.h"
143+
+#include "src/base/strings.h"
144+
#include "src/common/globals.h"
145+
-
146+
#include "unicode/uchar.h"
147+
#include "unicode/uniset.h"
148+
#include "unicode/unistr.h"
149+
@@ -71,9 +71,17 @@ namespace internal {
150+
// another character. Characters that match no other characters in
151+
// their equivalence class are added to IgnoreSet. Characters that
152+
// match at least one other character are added to SpecialAddSet.
153+
+// Supplementary code points are ignored throughout: non-unicode matching
154+
+// compares UTF-16 code units, so they can never match a BMP character.
155+
+//
156+
+// The generator additionally emits SupplementaryEquivalentsSet, the BMP
157+
+// characters whose Unicode case closure contains supplementary code points.
158+
+// This set is used for unicode-mode matching, see HasSupplementaryEquivalents.
159+
160+
class RegExpCaseFolding final : public AllStatic {
161+
public:
162+
+ enum class Mode { kNonUnicode, kUnicode };
163+
+
164+
static const icu::UnicodeSet& IgnoreSet();
165+
static const icu::UnicodeSet& SpecialAddSet();
166+
167+
@@ -108,6 +116,43 @@ class RegExpCaseFolding final : public AllStatic {
168+
// h. Return cu.
169+
return cu;
170+
}
171+
+
172+
+ // Close a set of characters under case equivalence, preserving its
173+
+ // original members. Non-unicode inputs must be UTF-16 code units.
174+
+ static void CloseOver(icu::UnicodeSet& set, Mode mode) {
175+
+ if (mode == Mode::kUnicode) {
176+
+ set.closeOver(USET_SIMPLE_CASE_INSENSITIVE);
177+
+ return;
178+
+ }
179+
+ DCHECK(!set.containsSome(0x10000, 0x10ffff));
180+
+ if (IgnoreSet().containsNone(set)) {
181+
+ CloseOverNonUnicode(set);
182+
+ return;
183+
+ }
184+
+ if (IgnoreSet().containsAll(set)) return;
185+
+ // Ignored characters neither contribute nor acquire equivalents, but
186+
+ // must remain in the result if they were explicitly present.
187+
+ icu::UnicodeSet ignored(set);
188+
+ ignored.retainAll(IgnoreSet());
189+
+ set.removeAll(IgnoreSet());
190+
+ CloseOverNonUnicode(set);
191+
+ set.addAll(ignored);
192+
+ }
193+
+
194+
+ // Whether c has supplementary Unicode case equivalents.
195+
+ static bool HasSupplementaryEquivalents(base::uc16 c) {
196+
+ return SupplementaryEquivalentsSet().contains(c);
197+
+ }
198+
+
199+
+ private:
200+
+ static const icu::UnicodeSet& SupplementaryEquivalentsSet();
201+
+
202+
+ // Requires a set containing no IgnoreSet characters.
203+
+ static void CloseOverNonUnicode(icu::UnicodeSet& set) {
204+
+ set.closeOver(USET_SIMPLE_CASE_INSENSITIVE);
205+
+ set.removeAll(IgnoreSet());
206+
+ set.remove(0x10000, 0x10ffff);
207+
+ }
208+
};
209+
210+
} // namespace internal

0 commit comments

Comments
 (0)