Compare commits
12 Commits
c8-stream-
...
c8-stream-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b225097bcd | ||
|
|
eb93c3f399 | ||
|
|
921be69a7f | ||
|
|
3dff411c5f | ||
| d9a6423cdb | |||
| ca5968eb63 | |||
| 266f57d480 | |||
| 1c8bd57e17 | |||
| d2683ec3f0 | |||
| 268f30610f | |||
| c159acc850 | |||
| 92bc2b1656 |
9
.gitignore
vendored
9
.gitignore
vendored
@ -1,2 +1,7 @@
|
||||
SOURCES/icu4c-64_2-src.tgz
|
||||
SOURCES/node-v10.24.0-stripped.tar.gz
|
||||
SOURCES/cjs-module-lexer-2.2.0.tar.gz
|
||||
SOURCES/icu4c-78.2-data-bin-b.zip
|
||||
SOURCES/icu4c-78.2-data-bin-l.zip
|
||||
SOURCES/node-v22.23.1-stripped.tar.gz
|
||||
SOURCES/undici-6.27.0.tar.gz
|
||||
SOURCES/wasi-sdk-wasi-sdk-12.tar.gz
|
||||
SOURCES/wasi-sdk-wasi-sdk-20.tar.gz
|
||||
|
||||
@ -1,2 +1,7 @@
|
||||
3127155ecf2b75ab4835f501b7478e39c07bb852 SOURCES/icu4c-64_2-src.tgz
|
||||
be0e0b385a852c376f452b3d94727492e05407e4 SOURCES/node-v10.24.0-stripped.tar.gz
|
||||
7f1e286f563622e12e0e9a9283508138127373ce SOURCES/cjs-module-lexer-2.2.0.tar.gz
|
||||
7a91e81c4f2c8368d80285a5bbdfe278d68e4a84 SOURCES/icu4c-78.2-data-bin-b.zip
|
||||
b9f5918e2118ef8531b0ffc04b3d50e951e3a166 SOURCES/icu4c-78.2-data-bin-l.zip
|
||||
8751335622db226d57c19ed444575147f0b62396 SOURCES/node-v22.23.1-stripped.tar.gz
|
||||
bc432a140b42f84d643387f13cdfa41396d723bc SOURCES/undici-6.27.0.tar.gz
|
||||
5ea3a1deb65a52a36ceb41324da690f54b2a4805 SOURCES/wasi-sdk-wasi-sdk-12.tar.gz
|
||||
da40abcb73a6dddafced6174d24ed49e414cda3c SOURCES/wasi-sdk-wasi-sdk-20.tar.gz
|
||||
|
||||
391
SOURCES/0001-CVE-2026-69152-brace-expansion-2.1.4.patch
Normal file
391
SOURCES/0001-CVE-2026-69152-brace-expansion-2.1.4.patch
Normal file
@ -0,0 +1,391 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Juhasz <tjuhasz@redhat.com>
|
||||
Date: Mon, 04 Aug 2026 00:00:00 +0000
|
||||
Subject: [PATCH] CVE-2026-14257: upgrade bundled brace-expansion to 2.1.4
|
||||
|
||||
Upgrade brace-expansion from 2.0.2 to 2.1.4 in npm's vendored
|
||||
node_modules. The new version adds EXPANSION_MAX and EXPANSION_MAX_LENGTH
|
||||
guards that cap the number and total size of expansions, preventing
|
||||
memory exhaustion from crafted input (CVE-2026-14257). The expand()
|
||||
function is rewritten to iterate instead of recurse, eliminating stack
|
||||
overflow on deeply chained brace groups.
|
||||
|
||||
Supersedes the earlier CVE-2026-13149 unbound-recursion patch.
|
||||
|
||||
Upstream: https://github.com/juliangruber/brace-expansion/releases/tag/v2.1.4
|
||||
---
|
||||
.../npm/node_modules/brace-expansion/index.js | 297 +++++++++++++++-----
|
||||
.../npm/node_modules/brace-expansion/package.json | 2 +-
|
||||
2 files changed, 217 insertions(+), 82 deletions(-)
|
||||
|
||||
diff --git a/deps/npm/node_modules/brace-expansion/index.js b/deps/npm/node_modules/brace-expansion/index.js
|
||||
--- a/deps/npm/node_modules/brace-expansion/index.js
|
||||
+++ b/deps/npm/node_modules/brace-expansion/index.js
|
||||
@@ -8,6 +8,20 @@
|
||||
var escComma = '\0COMMA'+Math.random()+'\0';
|
||||
var escPeriod = '\0PERIOD'+Math.random()+'\0';
|
||||
|
||||
+var EXPANSION_MAX = 100000
|
||||
+
|
||||
+// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An
|
||||
+// input like `'{a,b}'.repeat(1500)` stays under that count - its output is
|
||||
+// truncated to 100k results - while making every result ~1500 characters
|
||||
+// long. The result set, and the intermediate arrays built while combining
|
||||
+// brace sets, then grow large enough to exhaust memory and crash the process
|
||||
+// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of
|
||||
+// characters the accumulator may hold at any point, so memory stays flat no
|
||||
+// matter how many brace groups are chained. The limit sits well above any
|
||||
+// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M
|
||||
+// characters) so legitimate input is unaffected.
|
||||
+var EXPANSION_MAX_LENGTH = 4000000
|
||||
+
|
||||
function numeric(str) {
|
||||
return parseInt(str, 10) == str
|
||||
? parseInt(str, 10)
|
||||
@@ -61,10 +75,14 @@
|
||||
return parts;
|
||||
}
|
||||
|
||||
-function expandTop(str) {
|
||||
+function expandTop(str, options) {
|
||||
if (!str)
|
||||
return [];
|
||||
|
||||
+ options = options || {};
|
||||
+ var max = options.max == null ? EXPANSION_MAX : options.max;
|
||||
+ var maxLength = options.maxLength == null ? EXPANSION_MAX_LENGTH : options.maxLength;
|
||||
+
|
||||
// I don't know why Bash 4.3 does this, but it does.
|
||||
// Anything starting with {} will have the first two bytes preserved
|
||||
// but *only* at the top level, so {},a}b will not expand to anything,
|
||||
@@ -75,7 +93,7 @@
|
||||
str = '\\{\\}' + str.substr(2);
|
||||
}
|
||||
|
||||
- return expand(escapeBraces(str), true).map(unescapeBraces);
|
||||
+ return expand(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
|
||||
}
|
||||
|
||||
function embrace(str) {
|
||||
@@ -92,24 +110,144 @@
|
||||
return i >= y;
|
||||
}
|
||||
|
||||
-function expand(str, isTop) {
|
||||
- var expansions = [];
|
||||
+// Build `{ acc[a] + pre + values[v] }` for every combination, capping the
|
||||
+// number of results at `max` and the total number of characters at `maxLength`.
|
||||
+// This is the one place output grows, so bounding it here keeps the single
|
||||
+// accumulator - and therefore memory - flat regardless of how many brace groups
|
||||
+// are combined (CVE-2026-14257).
|
||||
+function combine(
|
||||
+ acc,
|
||||
+ pre,
|
||||
+ values,
|
||||
+ max,
|
||||
+ maxLength,
|
||||
+ dropEmpties
|
||||
+) {
|
||||
+ var out = []
|
||||
+ var length = 0
|
||||
+ for (var a = 0; a < acc.length; a++) {
|
||||
+ for (var v = 0; v < values.length; v++) {
|
||||
+ if (out.length >= max) return out
|
||||
+ var expansion = acc[a] + pre + values[v]
|
||||
+ // Bash drops empty results at the top level. Skip them before they count
|
||||
+ // against `max`, so `max` bounds the number of *kept* results.
|
||||
+ if (dropEmpties && !expansion) continue
|
||||
+ if (length + expansion.length > maxLength) return out
|
||||
+ out.push(expansion)
|
||||
+ length += expansion.length
|
||||
+ }
|
||||
+ }
|
||||
+ return out
|
||||
+}
|
||||
|
||||
- var m = balanced('{', '}', str);
|
||||
- if (!m) return [str];
|
||||
+// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)
|
||||
+// sequence body.
|
||||
+function expandSequence(
|
||||
+ body,
|
||||
+ isAlphaSequence,
|
||||
+ max,
|
||||
+ maxLength
|
||||
+) {
|
||||
+ var n = body.split(/\.\./)
|
||||
+ var N = []
|
||||
+ // A sequence body always splits into two or three parts, but the compiler
|
||||
+ // can't know that.
|
||||
+ /* c8 ignore start */
|
||||
+ if (n[0] === undefined || n[1] === undefined) {
|
||||
+ return N
|
||||
+ }
|
||||
+ /* c8 ignore stop */
|
||||
+ var x = numeric(n[0])
|
||||
+ var y = numeric(n[1])
|
||||
+ var width = Math.max(n[0].length, n[1].length)
|
||||
+ var incr =
|
||||
+ n.length === 3 && n[2] !== undefined ?
|
||||
+ Math.max(Math.abs(numeric(n[2])), 1)
|
||||
+ : 1
|
||||
+ var test = lte
|
||||
+ var reverse = y < x
|
||||
+ if (reverse) {
|
||||
+ incr *= -1
|
||||
+ test = gte
|
||||
+ }
|
||||
+ var pad = n.some(isPadded)
|
||||
|
||||
- // no need to expand pre, since it is guaranteed to be free of brace-sets
|
||||
- var pre = m.pre;
|
||||
- var post = m.post.length
|
||||
- ? expand(m.post, false)
|
||||
- : [''];
|
||||
-
|
||||
- if (/\$$/.test(m.pre)) {
|
||||
- for (var k = 0; k < post.length; k++) {
|
||||
- var expansion = pre+ '{' + m.body + '}' + post[k];
|
||||
- expansions.push(expansion);
|
||||
+ var length = 0
|
||||
+ for (var i = x; test(i, y) && N.length < max; i += incr) {
|
||||
+ var c
|
||||
+ if (isAlphaSequence) {
|
||||
+ c = String.fromCharCode(i)
|
||||
+ if (c === '\\') {
|
||||
+ c = ''
|
||||
+ }
|
||||
+ } else {
|
||||
+ c = String(i)
|
||||
+ if (pad) {
|
||||
+ var need = width - c.length
|
||||
+ if (need > 0) {
|
||||
+ var z = new Array(need + 1).join('0')
|
||||
+ if (i < 0) {
|
||||
+ c = '-' + z + c.slice(1)
|
||||
+ } else {
|
||||
+ c = z + c
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
- } else {
|
||||
+ if (length + c.length > maxLength) break
|
||||
+ N.push(c)
|
||||
+ length += c.length
|
||||
+ }
|
||||
+ return N
|
||||
+}
|
||||
+
|
||||
+function expand(
|
||||
+ str,
|
||||
+ max,
|
||||
+ maxLength,
|
||||
+ isTop
|
||||
+) {
|
||||
+ // Consume the string's top-level brace groups left to right, threading a
|
||||
+ // running set of combined prefixes (`acc`). Expanding the tail iteratively -
|
||||
+ // rather than recursing on `m.post` once per group - keeps the native stack
|
||||
+ // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no
|
||||
+ // longer overflow the stack, and leaves a single accumulator whose size
|
||||
+ // `maxLength` bounds directly (CVE-2026-14257).
|
||||
+ var acc = ['']
|
||||
+
|
||||
+ // Bash drops empty results, but only when the *first* top-level group is a
|
||||
+ // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop
|
||||
+ // is on the final strings, so it is applied to whichever `combine` produces
|
||||
+ // them (the one with no brace set left in the tail).
|
||||
+ var dropEmpties = false
|
||||
+ var firstGroup = true
|
||||
+
|
||||
+ for (;;) {
|
||||
+ const m = balanced('{', '}', str)
|
||||
+
|
||||
+ // No brace set left: the rest of the string is literal.
|
||||
+ if (!m) {
|
||||
+ return combine(acc, str, [''], max, maxLength, dropEmpties)
|
||||
+ }
|
||||
+
|
||||
+ // no need to expand pre, since it is guaranteed to be free of brace-sets
|
||||
+ const pre = m.pre
|
||||
+
|
||||
+ if (/\$$/.test(pre)) {
|
||||
+ acc = combine(
|
||||
+ acc,
|
||||
+ pre + '{' + m.body + '}',
|
||||
+ [''],
|
||||
+ max,
|
||||
+ maxLength,
|
||||
+ dropEmpties && !m.post.length
|
||||
+ )
|
||||
+ firstGroup = false
|
||||
+ if (!m.post.length) break
|
||||
+ str = m.post
|
||||
+ continue
|
||||
+ }
|
||||
+
|
||||
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
|
||||
var isSequence = isNumericSequence || isAlphaSequence;
|
||||
@@ -118,86 +256,83 @@
|
||||
// {a},b}
|
||||
if (m.post.match(/,(?!,).*\}/)) {
|
||||
str = m.pre + '{' + m.body + escClose + m.post;
|
||||
- return expand(str);
|
||||
+ isTop = true;
|
||||
+ continue;
|
||||
}
|
||||
- return [str];
|
||||
+ // Nothing here expands, so the whole remaining string is literal.
|
||||
+ return combine(
|
||||
+ acc,
|
||||
+ pre + '{' + m.body + '}' + m.post,
|
||||
+ [''],
|
||||
+ max,
|
||||
+ maxLength,
|
||||
+ dropEmpties
|
||||
+ )
|
||||
}
|
||||
|
||||
- var n;
|
||||
+ if (firstGroup) {
|
||||
+ dropEmpties = isTop && !isSequence
|
||||
+ firstGroup = false
|
||||
+ }
|
||||
+
|
||||
+ var values;
|
||||
if (isSequence) {
|
||||
- n = m.body.split(/\.\./);
|
||||
+ values = expandSequence(m.body, isAlphaSequence, max, maxLength);
|
||||
} else {
|
||||
- n = parseCommaParts(m.body);
|
||||
- if (n.length === 1) {
|
||||
+ var n = parseCommaParts(m.body);
|
||||
+ if (n.length === 1 && n[0] !== undefined) {
|
||||
// x{{a,b}}y ==> x{a}y x{b}y
|
||||
- n = expand(n[0], false).map(embrace);
|
||||
+ n = expand(n[0], max, maxLength, false).map(embrace);
|
||||
+ //XXX is this necessary? Can't seem to hit it in tests.
|
||||
+ /* c8 ignore start */
|
||||
if (n.length === 1) {
|
||||
- return post.map(function(p) {
|
||||
- return m.pre + n[0] + p;
|
||||
- });
|
||||
+ acc = combine(
|
||||
+ acc,
|
||||
+ pre + n[0],
|
||||
+ [''],
|
||||
+ max,
|
||||
+ maxLength,
|
||||
+ dropEmpties && !m.post.length
|
||||
+ )
|
||||
+ if (!m.post.length) break
|
||||
+ str = m.post
|
||||
+ continue
|
||||
}
|
||||
+ /* c8 ignore stop */
|
||||
}
|
||||
- }
|
||||
-
|
||||
- // at this point, n is the parts, and we know it's not a comma set
|
||||
- // with a single entry.
|
||||
- var N;
|
||||
|
||||
- if (isSequence) {
|
||||
- var x = numeric(n[0]);
|
||||
- var y = numeric(n[1]);
|
||||
- var width = Math.max(n[0].length, n[1].length)
|
||||
- var incr = n.length == 3
|
||||
- ? Math.abs(numeric(n[2]))
|
||||
- : 1;
|
||||
- var test = lte;
|
||||
- var reverse = y < x;
|
||||
- if (reverse) {
|
||||
- incr *= -1;
|
||||
- test = gte;
|
||||
- }
|
||||
- var pad = n.some(isPadded);
|
||||
-
|
||||
- N = [];
|
||||
-
|
||||
- for (var i = x; test(i, y); i += incr) {
|
||||
- var c;
|
||||
- if (isAlphaSequence) {
|
||||
- c = String.fromCharCode(i);
|
||||
- if (c === '\\')
|
||||
- c = '';
|
||||
- } else {
|
||||
- c = String(i);
|
||||
- if (pad) {
|
||||
- var need = width - c.length;
|
||||
- if (need > 0) {
|
||||
- var z = new Array(need + 1).join('0');
|
||||
- if (i < 0)
|
||||
- c = '-' + z + c.slice(1);
|
||||
- else
|
||||
- c = z + c;
|
||||
- }
|
||||
- }
|
||||
+ // Values that `combine` is going to drop as empty produce no result, so
|
||||
+ // they must not count against `max` - otherwise `{a,,b}` with `max: 2`
|
||||
+ // would stop at `['a', '']` and yield one result instead of two. Skipping
|
||||
+ // them outright keeps `values` bounded while leaving `max` a bound on
|
||||
+ // *kept* results.
|
||||
+ var dropsEmpties = dropEmpties && !m.post.length && !pre
|
||||
+ for (var d = 0; dropsEmpties && d < acc.length; d++) {
|
||||
+ if (acc[d]) {
|
||||
+ dropsEmpties = false
|
||||
}
|
||||
- N.push(c);
|
||||
}
|
||||
- } else {
|
||||
- N = [];
|
||||
|
||||
- for (var j = 0; j < n.length; j++) {
|
||||
- N.push.apply(N, expand(n[j], false));
|
||||
+ values = []
|
||||
+ var valuesLength = 0
|
||||
+ outer: for (var j = 0; j < n.length; j++) {
|
||||
+ var expanded = expand(n[j], max, maxLength, false)
|
||||
+ for (var k = 0; k < expanded.length; k++) {
|
||||
+ var v = expanded[k]
|
||||
+ if (dropsEmpties && !v) continue
|
||||
+ if (values.length >= max || valuesLength + v.length > maxLength) {
|
||||
+ break outer
|
||||
+ }
|
||||
+ values.push(v)
|
||||
+ valuesLength += v.length
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
- for (var j = 0; j < N.length; j++) {
|
||||
- for (var k = 0; k < post.length; k++) {
|
||||
- var expansion = pre + N[j] + post[k];
|
||||
- if (!isTop || isSequence || expansion)
|
||||
- expansions.push(expansion);
|
||||
- }
|
||||
- }
|
||||
+ acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length)
|
||||
+ if (!m.post.length) break
|
||||
+ str = m.post
|
||||
}
|
||||
|
||||
- return expansions;
|
||||
+ return acc
|
||||
}
|
||||
-
|
||||
|
||||
diff --git a/deps/npm/node_modules/brace-expansion/package.json b/deps/npm/node_modules/brace-expansion/package.json
|
||||
--- a/deps/npm/node_modules/brace-expansion/package.json
|
||||
+++ b/deps/npm/node_modules/brace-expansion/package.json
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "brace-expansion",
|
||||
"description": "Brace expansion as known from sh/bash",
|
||||
- "version": "2.0.2",
|
||||
+ "version": "2.1.4",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/juliangruber/brace-expansion.git"
|
||||
|
||||
1994
SOURCES/0001-CVE-2026-69192-CVE-2026-54272-ip-address-10.4.0.patch
Normal file
1994
SOURCES/0001-CVE-2026-69192-CVE-2026-54272-ip-address-10.4.0.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,31 +0,0 @@
|
||||
From 2cd4c12776af3da588231d3eb498e6451c30eae5 Mon Sep 17 00:00:00 2001
|
||||
From: Zuzana Svetlikova <zsvetlik@redhat.com>
|
||||
Date: Thu, 27 Apr 2017 14:25:42 +0200
|
||||
Subject: [PATCH] Disable running gyp on shared deps
|
||||
|
||||
Signed-off-by: rpm-build <rpm-build>
|
||||
---
|
||||
Makefile | 7 +++----
|
||||
1 file changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 73feb4c..45bbceb 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -123,10 +123,9 @@ with-code-cache:
|
||||
test-code-cache: with-code-cache
|
||||
$(PYTHON) tools/test.py $(PARALLEL_ARGS) --mode=$(BUILDTYPE_LOWER) code-cache
|
||||
|
||||
-out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \
|
||||
- deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \
|
||||
- deps/v8/gypfiles/features.gypi deps/v8/gypfiles/v8.gyp node.gyp \
|
||||
- config.gypi
|
||||
+out/Makefile: common.gypi deps/http_parser/http_parser.gyp \
|
||||
+ deps/v8/gypfiles/toolchain.gypi deps/v8/gypfiles/features.gypi \
|
||||
+ deps/v8/gypfiles/v8.gyp node.gyp config.gypi
|
||||
$(PYTHON) tools/gyp_node.py -f make
|
||||
|
||||
config.gypi: configure configure.py
|
||||
--
|
||||
2.26.2
|
||||
|
||||
45
SOURCES/0001-Remove-unused-OpenSSL-config.patch
Normal file
45
SOURCES/0001-Remove-unused-OpenSSL-config.patch
Normal file
@ -0,0 +1,45 @@
|
||||
From 0aaaf4104a1f23f3de105ffdaffc282c4477bb0e Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Gallagher <sgallagh@redhat.com>
|
||||
Date: Fri, 17 Apr 2020 12:59:44 +0200
|
||||
Subject: [PATCH] Remove unused OpenSSL config
|
||||
|
||||
The build process will try to create these config files, even when
|
||||
using the system OpenSSL and will thus fail since we strip this path
|
||||
from the tarball.
|
||||
|
||||
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
|
||||
---
|
||||
node.gyp | 17 -----------------
|
||||
1 file changed, 17 deletions(-)
|
||||
|
||||
diff --git a/node.gyp b/node.gyp
|
||||
index dc4d77330a811d3448d84318c065a3447b159906..e1824d462ec876a66146092aab4dba3d085f4658 100644
|
||||
--- a/node.gyp
|
||||
+++ b/node.gyp
|
||||
@@ -808,23 +808,6 @@
|
||||
],
|
||||
},
|
||||
],
|
||||
- }, {
|
||||
- 'variables': {
|
||||
- 'opensslconfig_internal': '<(obj_dir)/deps/openssl/openssl.cnf',
|
||||
- 'opensslconfig': './deps/openssl/nodejs-openssl.cnf',
|
||||
- },
|
||||
- 'actions': [
|
||||
- {
|
||||
- 'action_name': 'reset_openssl_cnf',
|
||||
- 'inputs': [ '<(opensslconfig)', ],
|
||||
- 'outputs': [ '<(opensslconfig_internal)', ],
|
||||
- 'action': [
|
||||
- '<(python)', 'tools/copyfile.py',
|
||||
- '<(opensslconfig)',
|
||||
- '<(opensslconfig_internal)',
|
||||
- ],
|
||||
- },
|
||||
- ],
|
||||
}],
|
||||
],
|
||||
}, # node_core_target_name
|
||||
--
|
||||
2.44.0
|
||||
|
||||
21461
SOURCES/0001-update-sqlite-to-3.53.4.patch
Normal file
21461
SOURCES/0001-update-sqlite-to-3.53.4.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,84 +0,0 @@
|
||||
From e7afb2d6e2a6c8f9c9c32e12a10c3c5c4902a251 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Gallagher <sgallagh@redhat.com>
|
||||
Date: Tue, 1 May 2018 08:05:30 -0400
|
||||
Subject: [PATCH] Suppress NPM message to run global update
|
||||
|
||||
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
|
||||
Signed-off-by: rpm-build <rpm-build>
|
||||
---
|
||||
deps/npm/bin/npm-cli.js | 54 -----------------------------------------
|
||||
1 file changed, 54 deletions(-)
|
||||
|
||||
diff --git a/deps/npm/bin/npm-cli.js b/deps/npm/bin/npm-cli.js
|
||||
index c0d9be0..0f0892e 100755
|
||||
--- a/deps/npm/bin/npm-cli.js
|
||||
+++ b/deps/npm/bin/npm-cli.js
|
||||
@@ -71,65 +71,11 @@
|
||||
npm.command = 'help'
|
||||
}
|
||||
|
||||
- var isGlobalNpmUpdate = conf.global && ['install', 'update'].includes(npm.command) && npm.argv.includes('npm')
|
||||
-
|
||||
// now actually fire up npm and run the command.
|
||||
// this is how to use npm programmatically:
|
||||
conf._exit = true
|
||||
npm.load(conf, function (er) {
|
||||
if (er) return errorHandler(er)
|
||||
- if (
|
||||
- !isGlobalNpmUpdate &&
|
||||
- npm.config.get('update-notifier') &&
|
||||
- !unsupported.checkVersion(process.version).unsupported
|
||||
- ) {
|
||||
- const pkg = require('../package.json')
|
||||
- let notifier = require('update-notifier')({pkg})
|
||||
- const isCI = require('ci-info').isCI
|
||||
- if (
|
||||
- notifier.update &&
|
||||
- notifier.update.latest !== pkg.version &&
|
||||
- !isCI
|
||||
- ) {
|
||||
- const color = require('ansicolors')
|
||||
- const useColor = npm.config.get('color')
|
||||
- const useUnicode = npm.config.get('unicode')
|
||||
- const old = notifier.update.current
|
||||
- const latest = notifier.update.latest
|
||||
- let type = notifier.update.type
|
||||
- if (useColor) {
|
||||
- switch (type) {
|
||||
- case 'major':
|
||||
- type = color.red(type)
|
||||
- break
|
||||
- case 'minor':
|
||||
- type = color.yellow(type)
|
||||
- break
|
||||
- case 'patch':
|
||||
- type = color.green(type)
|
||||
- break
|
||||
- }
|
||||
- }
|
||||
- const changelog = `https://github.com/npm/cli/releases/tag/v${latest}`
|
||||
- notifier.notify({
|
||||
- message: `New ${type} version of ${pkg.name} available! ${
|
||||
- useColor ? color.red(old) : old
|
||||
- } ${useUnicode ? '→' : '->'} ${
|
||||
- useColor ? color.green(latest) : latest
|
||||
- }\n` +
|
||||
- `${
|
||||
- useColor ? color.yellow('Changelog:') : 'Changelog:'
|
||||
- } ${
|
||||
- useColor ? color.cyan(changelog) : changelog
|
||||
- }\n` +
|
||||
- `Run ${
|
||||
- useColor
|
||||
- ? color.green(`npm install -g ${pkg.name}`)
|
||||
- : `npm i -g ${pkg.name}`
|
||||
- } to update!`
|
||||
- })
|
||||
- }
|
||||
- }
|
||||
npm.commands[npm.command](npm.argv, function (err) {
|
||||
// https://genius.com/Lin-manuel-miranda-your-obedient-servant-lyrics
|
||||
if (
|
||||
--
|
||||
2.26.2
|
||||
|
||||
84
SOURCES/0002-fips-disable-options.patch
Normal file
84
SOURCES/0002-fips-disable-options.patch
Normal file
@ -0,0 +1,84 @@
|
||||
From 98738d27288bd9ca634e29181ef665e812e7bbd3 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Dawson <midawson@redhat.com>
|
||||
Date: Fri, 23 Feb 2024 13:43:56 +0100
|
||||
Subject: [PATCH] Disable FIPS options
|
||||
|
||||
On RHEL, FIPS should be configured only on system level.
|
||||
Additionally, the related options may cause segfault when used on RHEL.
|
||||
|
||||
This patch causes the option processing to end sooner
|
||||
than the problematic code gets executed.
|
||||
Additionally, the JS-level options to mess with FIPS settings
|
||||
are similarly disabled.
|
||||
|
||||
Upstream report: https://github.com/nodejs/node/pull/48950
|
||||
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2226726
|
||||
---
|
||||
lib/crypto.js | 10 ++++++++++
|
||||
lib/internal/errors.js | 6 ++++++
|
||||
src/crypto/crypto_util.cc | 2 ++
|
||||
3 files changed, 18 insertions(+)
|
||||
|
||||
diff --git a/lib/crypto.js b/lib/crypto.js
|
||||
index 41adecc..b2627ac 100644
|
||||
--- a/lib/crypto.js
|
||||
+++ b/lib/crypto.js
|
||||
@@ -36,7 +36,10 @@ const {
|
||||
assertCrypto();
|
||||
|
||||
const {
|
||||
+ // RHEL specific error
|
||||
+ ERR_CRYPTO_FIPS_SYSTEM_CONTROLLED,
|
||||
+
|
||||
ERR_CRYPTO_FIPS_FORCED,
|
||||
ERR_WORKER_UNSUPPORTED_OPERATION,
|
||||
} = require('internal/errors').codes;
|
||||
const constants = internalBinding('constants').crypto;
|
||||
@@ -251,6 +254,13 @@ function getFips() {
|
||||
}
|
||||
|
||||
function setFips(val) {
|
||||
+ // in RHEL FIPS enable/disable should only be done at system level
|
||||
+ if (getFips() != val) {
|
||||
+ throw new ERR_CRYPTO_FIPS_SYSTEM_CONTROLLED();
|
||||
+ } else {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
if (getOptionValue('--force-fips')) {
|
||||
if (val) return;
|
||||
throw new ERR_CRYPTO_FIPS_FORCED();
|
||||
diff --git a/lib/internal/errors.js b/lib/internal/errors.js
|
||||
index a722360..04d8a53 100644
|
||||
--- a/lib/internal/errors.js
|
||||
+++ b/lib/internal/errors.js
|
||||
@@ -1111,6 +1111,12 @@ module.exports = {
|
||||
//
|
||||
// Note: Node.js specific errors must begin with the prefix ERR_
|
||||
|
||||
+// insert RHEL specific erro
|
||||
+E('ERR_CRYPTO_FIPS_SYSTEM_CONTROLLED',
|
||||
+ 'Cannot set FIPS mode. FIPS should be enabled/disabled at system level. See' +
|
||||
+ 'https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/security_hardening/assembly_installing-the-system-in-fips-mode_security-hardening for more details.\n',
|
||||
+ Error);
|
||||
+
|
||||
E('ERR_ACCESS_DENIED',
|
||||
function(msg, permission = '', resource = '') {
|
||||
this.permission = permission;
|
||||
diff --git a/src/crypto/crypto_util.cc b/src/crypto/crypto_util.cc
|
||||
index 5734d8f..ef9d1b1 100644
|
||||
--- a/src/crypto/crypto_util.cc
|
||||
+++ b/src/crypto/crypto_util.cc
|
||||
@@ -121,6 +121,8 @@ bool ProcessFipsOptions() {
|
||||
/* Override FIPS settings in configuration file, if needed. */
|
||||
if (per_process::cli_options->enable_fips_crypto ||
|
||||
per_process::cli_options->force_fips_crypto) {
|
||||
+ fprintf(stderr, "ERROR: Using options related to FIPS is not recommended, configure FIPS in openssl instead. See https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/security_hardening/assembly_installing-the-system-in-fips-mode_security-hardening for more details.\n");
|
||||
+ return false;
|
||||
#if OPENSSL_VERSION_MAJOR >= 3
|
||||
OSSL_PROVIDER* fips_provider = OSSL_PROVIDER_load(nullptr, "fips");
|
||||
if (fips_provider == nullptr)
|
||||
--
|
||||
2.43.2
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,122 +0,0 @@
|
||||
From 0028cc74dac4dd24b8599ade85cb49fdafa9f559 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Gallagher <sgallagh@redhat.com>
|
||||
Date: Fri, 6 Dec 2019 16:40:25 -0500
|
||||
Subject: [PATCH] build: auto-load ICU data from --with-icu-default-data-dir
|
||||
|
||||
When compiled with `--with-intl=small` and
|
||||
`--with-icu-default-data-dir=PATH`, Node.js will use PATH as a
|
||||
fallback location for the ICU data.
|
||||
|
||||
We will first perform an access check using fopen(PATH, 'r') to
|
||||
ensure that the file is readable. If it is, we'll set the
|
||||
icu_data_directory and proceed. There's a slight overhead for the
|
||||
fopen() check, but it should be barely measurable.
|
||||
|
||||
This will be useful for Linux distribution packagers who want to
|
||||
be able to ship a minimal node binary in a container image but
|
||||
also be able to add on the full i18n support where needed. With
|
||||
this patch, it becomes possible to ship the interpreter as
|
||||
/usr/bin/node in one package for the distribution and to ship the
|
||||
data files in another package (without a strict dependency
|
||||
between the two). This means that users of the distribution will
|
||||
not need to explicitly direct Node.js to locate the ICU data. It
|
||||
also means that in environments where full internationalization is
|
||||
not required, they do not need to carry the extra content (with
|
||||
the associated storage costs).
|
||||
|
||||
Refs: https://github.com/nodejs/node/issues/3460
|
||||
|
||||
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
|
||||
Signed-off-by: rpm-build <rpm-build>
|
||||
---
|
||||
configure.py | 9 +++++++++
|
||||
node.gypi | 7 +++++++
|
||||
src/node.cc | 20 ++++++++++++++++++++
|
||||
3 files changed, 36 insertions(+)
|
||||
|
||||
diff --git a/configure.py b/configure.py
|
||||
index 89f7bf5..d611a88 100755
|
||||
--- a/configure.py
|
||||
+++ b/configure.py
|
||||
@@ -433,6 +433,14 @@ intl_optgroup.add_option('--with-icu-source',
|
||||
'the icu4c source archive. '
|
||||
'v%d.x or later recommended.' % icu_versions['minimum_icu'])
|
||||
|
||||
+intl_optgroup.add_option('--with-icu-default-data-dir',
|
||||
+ action='store',
|
||||
+ dest='with_icu_default_data_dir',
|
||||
+ help='Path to the icuXXdt{lb}.dat file. If unspecified, ICU data will '
|
||||
+ 'only be read if the NODE_ICU_DATA environment variable or the '
|
||||
+ '--icu-data-dir runtime argument is used. This option has effect '
|
||||
+ 'only when Node.js is built with --with-intl=small-icu.')
|
||||
+
|
||||
parser.add_option('--with-ltcg',
|
||||
action='store_true',
|
||||
dest='with_ltcg',
|
||||
@@ -1359,6 +1367,7 @@ def configure_intl(o):
|
||||
locs.add('root') # must have root
|
||||
o['variables']['icu_locales'] = string.join(locs,',')
|
||||
# We will check a bit later if we can use the canned deps/icu-small
|
||||
+ o['variables']['icu_default_data'] = options.with_icu_default_data_dir or ''
|
||||
elif with_intl == 'full-icu':
|
||||
# full ICU
|
||||
o['variables']['v8_enable_i18n_support'] = 1
|
||||
diff --git a/node.gypi b/node.gypi
|
||||
index 466a174..65b97d6 100644
|
||||
--- a/node.gypi
|
||||
+++ b/node.gypi
|
||||
@@ -113,6 +113,13 @@
|
||||
'conditions': [
|
||||
[ 'icu_small=="true"', {
|
||||
'defines': [ 'NODE_HAVE_SMALL_ICU=1' ],
|
||||
+ 'conditions': [
|
||||
+ [ 'icu_default_data!=""', {
|
||||
+ 'defines': [
|
||||
+ 'NODE_ICU_DEFAULT_DATA_DIR="<(icu_default_data)"',
|
||||
+ ],
|
||||
+ }],
|
||||
+ ],
|
||||
}]],
|
||||
}],
|
||||
[ 'node_use_bundled_v8=="true" and \
|
||||
diff --git a/src/node.cc b/src/node.cc
|
||||
index 7c01187..c9840e3 100644
|
||||
--- a/src/node.cc
|
||||
+++ b/src/node.cc
|
||||
@@ -92,6 +92,7 @@
|
||||
|
||||
#if defined(NODE_HAVE_I18N_SUPPORT)
|
||||
#include <unicode/uvernum.h>
|
||||
+#include <unicode/utypes.h>
|
||||
#endif
|
||||
|
||||
#if defined(LEAK_SANITIZER)
|
||||
@@ -2643,6 +2644,25 @@ void Init(std::vector<std::string>* argv,
|
||||
// If the parameter isn't given, use the env variable.
|
||||
if (per_process_opts->icu_data_dir.empty())
|
||||
SafeGetenv("NODE_ICU_DATA", &per_process_opts->icu_data_dir);
|
||||
+
|
||||
+#ifdef NODE_ICU_DEFAULT_DATA_DIR
|
||||
+ // If neither the CLI option nor the environment variable was specified,
|
||||
+ // fall back to the configured default
|
||||
+ if (per_process_opts->icu_data_dir.empty()) {
|
||||
+ // Check whether the NODE_ICU_DEFAULT_DATA_DIR contains the right data
|
||||
+ // file and can be read.
|
||||
+ static const char full_path[] =
|
||||
+ NODE_ICU_DEFAULT_DATA_DIR "/" U_ICUDATA_NAME ".dat";
|
||||
+
|
||||
+ FILE* f = fopen(full_path, "rb");
|
||||
+
|
||||
+ if (f != nullptr) {
|
||||
+ fclose(f);
|
||||
+ per_process_opts->icu_data_dir = NODE_ICU_DEFAULT_DATA_DIR;
|
||||
+ }
|
||||
+ }
|
||||
+#endif // NODE_ICU_DEFAULT_DATA_DIR
|
||||
+
|
||||
// Initialize ICU.
|
||||
// If icu_data_dir is empty here, it will load the 'minimal' data.
|
||||
if (!i18n::InitializeICUDirectory(per_process_opts->icu_data_dir)) {
|
||||
--
|
||||
2.26.2
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
diff --git a/deps/npm/node_modules/y18n/index.js b/deps/npm/node_modules/y18n/index.js
|
||||
index d720681628..727362aac0 100644
|
||||
--- a/deps/npm/node_modules/y18n/index.js
|
||||
+++ b/deps/npm/node_modules/y18n/index.js
|
||||
@@ -11,7 +11,7 @@ function Y18N (opts) {
|
||||
this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true
|
||||
|
||||
// internal stuff.
|
||||
- this.cache = {}
|
||||
+ this.cache = Object.create(null)
|
||||
this.writeQueue = []
|
||||
}
|
||||
|
||||
248
SOURCES/nodejs-sources.sh
Executable file
248
SOURCES/nodejs-sources.sh
Executable file
@ -0,0 +1,248 @@
|
||||
#!/bin/sh
|
||||
# Uses Argbash to generate command argument parsing. To update
|
||||
# arguments, make sure to call
|
||||
# `argbash nodejs-tarball.sh -o nodejs-tarball.sh`
|
||||
|
||||
# ARG_POSITIONAL_SINGLE([version],[Node.js release version],[""])
|
||||
# ARG_DEFAULTS_POS([])
|
||||
# ARG_HELP([Tool to aid in Node.js packaging of new releases])
|
||||
# ARGBASH_GO()
|
||||
# needed because of Argbash --> m4_ignore([
|
||||
### START OF CODE GENERATED BY Argbash v2.8.1 one line above ###
|
||||
# Argbash is a bash code generator used to get arguments parsing right.
|
||||
# Argbash is FREE SOFTWARE, see https://argbash.io for more info
|
||||
|
||||
|
||||
die()
|
||||
{
|
||||
local _ret=$2
|
||||
test -n "$_ret" || _ret=1
|
||||
test "$_PRINT_HELP" = yes && print_help >&2
|
||||
echo "$1" >&2
|
||||
exit ${_ret}
|
||||
}
|
||||
|
||||
|
||||
begins_with_short_option()
|
||||
{
|
||||
local first_option all_short_options='h'
|
||||
first_option="${1:0:1}"
|
||||
test "$all_short_options" = "${all_short_options/$first_option/}" && return 1 || return 0
|
||||
}
|
||||
|
||||
# THE DEFAULTS INITIALIZATION - POSITIONALS
|
||||
_positionals=()
|
||||
_arg_version=""
|
||||
# THE DEFAULTS INITIALIZATION - OPTIONALS
|
||||
|
||||
|
||||
print_help()
|
||||
{
|
||||
printf '%s\n' "Tool to aid in Node.js packaging of new releases"
|
||||
printf 'Usage: %s [-h|--help] [<version>]\n' "$0"
|
||||
printf '\t%s\n' "<version>: Node.js release version (default: '""')"
|
||||
printf '\t%s\n' "-h, --help: Prints help"
|
||||
}
|
||||
|
||||
|
||||
parse_commandline()
|
||||
{
|
||||
_positionals_count=0
|
||||
while test $# -gt 0
|
||||
do
|
||||
_key="$1"
|
||||
case "$_key" in
|
||||
-h|--help)
|
||||
print_help
|
||||
exit 0
|
||||
;;
|
||||
-h*)
|
||||
print_help
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
_last_positional="$1"
|
||||
_positionals+=("$_last_positional")
|
||||
_positionals_count=$((_positionals_count + 1))
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
handle_passed_args_count()
|
||||
{
|
||||
test "${_positionals_count}" -le 1 || _PRINT_HELP=yes die "FATAL ERROR: There were spurious positional arguments --- we expect between 0 and 1, but got ${_positionals_count} (the last one was: '${_last_positional}')." 1
|
||||
}
|
||||
|
||||
|
||||
assign_positional_args()
|
||||
{
|
||||
local _positional_name _shift_for=$1
|
||||
_positional_names="_arg_version "
|
||||
|
||||
shift "$_shift_for"
|
||||
for _positional_name in ${_positional_names}
|
||||
do
|
||||
test $# -gt 0 || break
|
||||
eval "$_positional_name=\${1}" || die "Error during argument parsing, possibly an Argbash bug." 1
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
parse_commandline "$@"
|
||||
handle_passed_args_count
|
||||
assign_positional_args 1 "${_positionals[@]}"
|
||||
|
||||
# OTHER STUFF GENERATED BY Argbash
|
||||
|
||||
### END OF CODE GENERATED BY Argbash (sortof) ### ])
|
||||
# [ <-- needed because of Argbash
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
echo $_arg_version
|
||||
|
||||
if [ x$_arg_version != x ]; then
|
||||
version=$_arg_version
|
||||
else
|
||||
version=$(rpm -q --specfile --qf='%{version}\n' nodejs.spec | head -n1)
|
||||
fi
|
||||
|
||||
rm -f node-v${version}.tar.gz node-v${version}-stripped.tar.gz
|
||||
wget http://nodejs.org/dist/v${version}/node-v${version}.tar.gz \
|
||||
http://nodejs.org/dist/v${version}/SHASUMS256.txt
|
||||
sha256sum -c SHASUMS256.txt --ignore-missing
|
||||
tar -zxf node-v${version}.tar.gz
|
||||
rm -rf node-v${version}/deps/openssl
|
||||
tar -zcf node-v${version}-stripped.tar.gz node-v${version}
|
||||
|
||||
# Download the ICU binary data files
|
||||
ICU_MAJOR=$(jq -r '.[0].url' node-v${version}/tools/icu/current_ver.dep | sed --expression='s/.*release-\([[:digit:]]\+\).\([[:digit:]]\+\).*/\1/g')
|
||||
ICU_MINOR=$(jq -r '.[0].url' node-v${version}/tools/icu/current_ver.dep | sed --expression='s/.*release-\([[:digit:]]\+\).\([[:digit:]]\+\).*/\2/g')
|
||||
rm -Rf icu4c-${ICU_MAJOR}.${ICU_MINOR}-data-bin-*.zip
|
||||
wget $(grep -w 'Source3' nodejs.spec | sed --expression="s/.*http/http/g" --expression="s/\(\%{icu_major}\)/${ICU_MAJOR}/g" --expression="s/\(\%{icu_minor}\)/${ICU_MINOR}/g")
|
||||
wget $(grep -w 'Source4' nodejs.spec | sed --expression="s/.*http/http/g" --expression="s/\(\%{icu_major}\)/${ICU_MAJOR}/g" --expression="s/\(\%{icu_minor}\)/${ICU_MINOR}/g")
|
||||
|
||||
#fedpkg new-sources node-v${version}-stripped.tar.gz icu4c*-src.tgz
|
||||
|
||||
rm -f node-v${version}.tar.gz
|
||||
|
||||
set +e
|
||||
|
||||
# Determine the bundled versions of the various packages
|
||||
echo "Included software versions"
|
||||
echo "-------------------------"
|
||||
echo
|
||||
echo "Node.js version"
|
||||
echo "========================="
|
||||
echo "${version}"
|
||||
echo
|
||||
echo "Bundled software versions"
|
||||
echo "-------------------------"
|
||||
echo
|
||||
echo "libnode shared object version (nodejs_soversion)"
|
||||
echo "========================="
|
||||
NODE_SOVERSION=$(grep -oP '(?<=#define NODE_MODULE_VERSION )\d+' node-v${version}/src/node_version.h)
|
||||
echo "${NODE_SOVERSION}"
|
||||
echo
|
||||
echo "V8"
|
||||
echo "========================="
|
||||
V8_MAJOR=$(grep -oP '(?<=#define V8_MAJOR_VERSION )\d+' node-v${version}/deps/v8/include/v8-version.h)
|
||||
V8_MINOR=$(grep -oP '(?<=#define V8_MINOR_VERSION )\d+' node-v${version}/deps/v8/include/v8-version.h)
|
||||
V8_BUILD=$(grep -oP '(?<=#define V8_BUILD_NUMBER )\d+' node-v${version}/deps/v8/include/v8-version.h)
|
||||
V8_PATCH=$(grep -oP '(?<=#define V8_PATCH_LEVEL )\d+' node-v${version}/deps/v8/include/v8-version.h)
|
||||
echo "${V8_MAJOR}.${V8_MINOR}.${V8_BUILD}.${V8_PATCH}"
|
||||
echo
|
||||
echo "c-ares"
|
||||
echo "========================="
|
||||
C_ARES_VERSION=$(grep -oP '(?<=#define ARES_VERSION_STR ).*\"' node-v${version}/deps/cares/include/ares_version.h |sed -e 's/^"//' -e 's/"$//')
|
||||
echo $C_ARES_VERSION
|
||||
echo
|
||||
echo "llhttp"
|
||||
echo "========================="
|
||||
LLHTTP_MAJOR=$(grep -oP '(?<=#define LLHTTP_VERSION_MAJOR )\d+' node-v${version}/deps/llhttp/include/llhttp.h)
|
||||
LLHTTP_MINOR=$(grep -oP '(?<=#define LLHTTP_VERSION_MINOR )\d+' node-v${version}/deps/llhttp/include/llhttp.h)
|
||||
LLHTTP_PATCH=$(grep -oP '(?<=#define LLHTTP_VERSION_PATCH )\d+' node-v${version}/deps/llhttp/include/llhttp.h)
|
||||
LLHTTP_VERSION="${LLHTTP_MAJOR}.${LLHTTP_MINOR}.${LLHTTP_PATCH}"
|
||||
echo $LLHTTP_VERSION
|
||||
echo
|
||||
echo "libuv"
|
||||
echo "========================="
|
||||
UV_MAJOR=$(grep -oP '(?<=#define UV_VERSION_MAJOR )\d+' node-v${version}/deps/uv/include/uv/version.h)
|
||||
UV_MINOR=$(grep -oP '(?<=#define UV_VERSION_MINOR )\d+' node-v${version}/deps/uv/include/uv/version.h)
|
||||
UV_PATCH=$(grep -oP '(?<=#define UV_VERSION_PATCH )\d+' node-v${version}/deps/uv/include/uv/version.h)
|
||||
LIBUV_VERSION="${UV_MAJOR}.${UV_MINOR}.${UV_PATCH}"
|
||||
echo $LIBUV_VERSION
|
||||
echo
|
||||
echo "nghttp2"
|
||||
echo "========================="
|
||||
NGHTTP2_VERSION=$(grep -oP '(?<=#define NGHTTP2_VERSION ).*\"' node-v${version}/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h |sed -e 's/^"//' -e 's/"$//')
|
||||
echo $NGHTTP2_VERSION
|
||||
echo
|
||||
echo "nghttp3"
|
||||
echo "========================="
|
||||
NGHTTP3_VERSION=$(grep -oP '(?<=#define NGHTTP3_VERSION ).*\"' node-v${version}/deps/ngtcp2/nghttp3/lib/includes/nghttp3/version.h |sed -e 's/^"//' -e 's/"$//')
|
||||
echo $NGHTTP3_VERSION
|
||||
echo
|
||||
echo "ngtcp2"
|
||||
echo "========================="
|
||||
NGTCP2_VERSION=$(grep -oP '(?<=#define NGTCP2_VERSION ).*\"' node-v${version}/deps/ngtcp2/ngtcp2/lib/includes/ngtcp2/version.h |sed -e 's/^"//' -e 's/"$//')
|
||||
echo $NGTCP2_VERSION
|
||||
echo
|
||||
echo "ICU"
|
||||
echo "========================="
|
||||
ICU_MAJOR=$(jq -r '.[0].url' node-v${version}/tools/icu/current_ver.dep | sed --expression='s/.*release-\([[:digit:]]\+\).\([[:digit:]]\+\).*/\1/g')
|
||||
ICU_MINOR=$(jq -r '.[0].url' node-v${version}/tools/icu/current_ver.dep | sed --expression='s/.*release-\([[:digit:]]\+\).\([[:digit:]]\+\).*/\2/g')
|
||||
echo "${ICU_MAJOR}.${ICU_MINOR}"
|
||||
echo
|
||||
echo "simdutf"
|
||||
echo "========================="
|
||||
SIMDUTF_VERSION=$(grep -oP '(?<=#define SIMDUTF_VERSION ).*\"' node-v${version}/deps/simdutf/simdutf.h |sed -e 's/^"//' -e 's/"$//')
|
||||
echo $SIMDUTF_VERSION
|
||||
echo
|
||||
echo "ada"
|
||||
echo "========================="
|
||||
ADA_VERSION=$(grep -osP '(?<=#define ADA_VERSION ).*\"' node-v${version}/deps/ada/ada.h |sed -e 's/^"//' -e 's/"$//')
|
||||
ADA_VERSION=${ADA_VERSION:-0}
|
||||
echo "${ADA_VERSION}"
|
||||
echo
|
||||
echo "punycode"
|
||||
echo "========================="
|
||||
PUNYCODE_VERSION=$(grep -oP "'version': '\K[^']+" ./node-v${version}/lib/punycode.js)
|
||||
echo $PUNYCODE_VERSION
|
||||
echo
|
||||
echo "npm"
|
||||
echo "========================="
|
||||
NPM_VERSION=$(jq -r .version ./node-v${version}/deps/npm/package.json)
|
||||
echo $NPM_VERSION
|
||||
echo
|
||||
echo "corepack"
|
||||
echo "========================="
|
||||
COREPACK_VERSION=$(jq -r .version ./node-v${version}/deps/corepack/package.json)
|
||||
echo $COREPACK_VERSION
|
||||
echo
|
||||
echo "uvwasi"
|
||||
echo "========================="
|
||||
UVWASI_MAJOR=$(grep -oP '(?<=#define UVWASI_VERSION_MAJOR )\d+' node-v${version}/deps/uvwasi/include/uvwasi.h)
|
||||
UVWASI_MINOR=$(grep -oP '(?<=#define UVWASI_VERSION_MINOR )\d+' node-v${version}/deps/uvwasi/include/uvwasi.h)
|
||||
UVWASI_PATCH=$(grep -oP '(?<=#define UVWASI_VERSION_PATCH )\d+' node-v${version}/deps/uvwasi/include/uvwasi.h)
|
||||
UVWASI_VERSION="${UVWASI_MAJOR}.${UVWASI_MINOR}.${UVWASI_PATCH}"
|
||||
echo $UVWASI_VERSION
|
||||
echo
|
||||
echo "histogram_c"
|
||||
echo "========================="
|
||||
HISTOGRAM_VERSION=$(grep -oP '(?<=#define HDR_HISTOGRAM_VERSION ).*\"' node-v${version}/deps/histogram/include/hdr/hdr_histogram_version.h|sed -e 's/^"//' -e 's/"$//')
|
||||
echo $HISTOGRAM_VERSION
|
||||
echo
|
||||
echo "sqlite"
|
||||
echo "========================="
|
||||
SQLITE_VERSION="$(grep -osP '(?<=#define SQLITE_VERSION ).*\"' node-v${version}/deps/sqlite/sqlite3.h |sed -e 's/^\s*"//' -e 's/"\s*$//')"
|
||||
echo "${SQLITE_VERSION}"
|
||||
echo
|
||||
echo "Make sure these versions match what is in the RPM spec file"
|
||||
|
||||
rm -rf node-v${version}
|
||||
# ] <-- needed because of Argbash
|
||||
@ -1,189 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Uses Argbash to generate command argument parsing. To update
|
||||
# arguments, make sure to call
|
||||
# `argbash nodejs-tarball.sh -o nodejs-tarball.sh`
|
||||
|
||||
# ARG_POSITIONAL_SINGLE([version],[Node.js release version],[""])
|
||||
# ARG_DEFAULTS_POS([])
|
||||
# ARG_HELP([Tool to aid in Node.js packaging of new releases])
|
||||
# ARGBASH_GO()
|
||||
# needed because of Argbash --> m4_ignore([
|
||||
### START OF CODE GENERATED BY Argbash v2.8.1 one line above ###
|
||||
# Argbash is a bash code generator used to get arguments parsing right.
|
||||
# Argbash is FREE SOFTWARE, see https://argbash.io for more info
|
||||
|
||||
|
||||
die()
|
||||
{
|
||||
local _ret=$2
|
||||
test -n "$_ret" || _ret=1
|
||||
test "$_PRINT_HELP" = yes && print_help >&2
|
||||
echo "$1" >&2
|
||||
exit ${_ret}
|
||||
}
|
||||
|
||||
|
||||
begins_with_short_option()
|
||||
{
|
||||
local first_option all_short_options='h'
|
||||
first_option="${1:0:1}"
|
||||
test "$all_short_options" = "${all_short_options/$first_option/}" && return 1 || return 0
|
||||
}
|
||||
|
||||
# THE DEFAULTS INITIALIZATION - POSITIONALS
|
||||
_positionals=()
|
||||
_arg_version=""
|
||||
# THE DEFAULTS INITIALIZATION - OPTIONALS
|
||||
|
||||
|
||||
print_help()
|
||||
{
|
||||
printf '%s\n' "Tool to aid in Node.js packaging of new releases"
|
||||
printf 'Usage: %s [-h|--help] [<version>]\n' "$0"
|
||||
printf '\t%s\n' "<version>: Node.js release version (default: '""')"
|
||||
printf '\t%s\n' "-h, --help: Prints help"
|
||||
}
|
||||
|
||||
|
||||
parse_commandline()
|
||||
{
|
||||
_positionals_count=0
|
||||
while test $# -gt 0
|
||||
do
|
||||
_key="$1"
|
||||
case "$_key" in
|
||||
-h|--help)
|
||||
print_help
|
||||
exit 0
|
||||
;;
|
||||
-h*)
|
||||
print_help
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
_last_positional="$1"
|
||||
_positionals+=("$_last_positional")
|
||||
_positionals_count=$((_positionals_count + 1))
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
handle_passed_args_count()
|
||||
{
|
||||
test "${_positionals_count}" -le 1 || _PRINT_HELP=yes die "FATAL ERROR: There were spurious positional arguments --- we expect between 0 and 1, but got ${_positionals_count} (the last one was: '${_last_positional}')." 1
|
||||
}
|
||||
|
||||
|
||||
assign_positional_args()
|
||||
{
|
||||
local _positional_name _shift_for=$1
|
||||
_positional_names="_arg_version "
|
||||
|
||||
shift "$_shift_for"
|
||||
for _positional_name in ${_positional_names}
|
||||
do
|
||||
test $# -gt 0 || break
|
||||
eval "$_positional_name=\${1}" || die "Error during argument parsing, possibly an Argbash bug." 1
|
||||
shift
|
||||
done
|
||||
}
|
||||
|
||||
parse_commandline "$@"
|
||||
handle_passed_args_count
|
||||
assign_positional_args 1 "${_positionals[@]}"
|
||||
|
||||
# OTHER STUFF GENERATED BY Argbash
|
||||
|
||||
### END OF CODE GENERATED BY Argbash (sortof) ### ])
|
||||
# [ <-- needed because of Argbash
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
echo $_arg_version
|
||||
|
||||
if [ x$_arg_version != x ]; then
|
||||
version=$_arg_version
|
||||
else
|
||||
version=$(rpm -q --specfile --qf='%{version}\n' nodejs.spec | head -n1)
|
||||
fi
|
||||
|
||||
rm -f node-v${version}.tar.gz node-v${version}-stripped.tar.gz
|
||||
wget http://nodejs.org/dist/v${version}/node-v${version}.tar.gz \
|
||||
http://nodejs.org/dist/v${version}/SHASUMS256.txt
|
||||
sha256sum -c SHASUMS256.txt --ignore-missing
|
||||
tar -zxf node-v${version}.tar.gz
|
||||
rm -rf node-v${version}/deps/openssl
|
||||
tar -zcf node-v${version}-stripped.tar.gz node-v${version}
|
||||
|
||||
# Download the matching version of ICU
|
||||
rm -f icu4c*-src.tgz icu.md5
|
||||
ICUMD5=$(cat node-v${version}/tools/icu/current_ver.dep |jq -r '.[0].md5')
|
||||
wget $(cat node-v${version}/tools/icu/current_ver.dep |jq -r '.[0].url')
|
||||
ICUTARBALL=$(ls -1 icu4c*-src.tgz)
|
||||
echo "$ICUMD5 $ICUTARBALL" > icu.md5
|
||||
md5sum -c icu.md5
|
||||
rm -f icu.md5 SHASUMS256.txt
|
||||
|
||||
rhpkg new-sources node-v${version}-stripped.tar.gz icu4c*-src.tgz
|
||||
|
||||
rm -f node-v${version}.tar.gz
|
||||
|
||||
set +e
|
||||
|
||||
# Determine the bundled versions of the various packages
|
||||
echo "Bundled software versions"
|
||||
echo "-------------------------"
|
||||
echo
|
||||
echo "libnode shared object version"
|
||||
echo "========================="
|
||||
grep "define NODE_MODULE_VERSION" node-v${version}/src/node_version.h
|
||||
echo
|
||||
echo "V8"
|
||||
echo "========================="
|
||||
grep "define V8_MAJOR_VERSION" node-v${version}/deps/v8/include/v8-version.h
|
||||
grep "define V8_MINOR_VERSION" node-v${version}/deps/v8/include/v8-version.h
|
||||
grep "define V8_BUILD_NUMBER" node-v${version}/deps/v8/include/v8-version.h
|
||||
grep "define V8_PATCH_LEVEL" node-v${version}/deps/v8/include/v8-version.h
|
||||
echo
|
||||
echo "c-ares"
|
||||
echo "========================="
|
||||
grep "define ARES_VERSION_MAJOR" node-v${version}/deps/cares/include/ares_version.h
|
||||
grep "define ARES_VERSION_MINOR" node-v${version}/deps/cares/include/ares_version.h
|
||||
grep "define ARES_VERSION_PATCH" node-v${version}/deps/cares/include/ares_version.h
|
||||
echo
|
||||
echo "http-parser"
|
||||
echo "========================="
|
||||
grep "define HTTP_PARSER_VERSION_MAJOR" node-v${version}/deps/http_parser/http_parser.h
|
||||
grep "define HTTP_PARSER_VERSION_MINOR" node-v${version}/deps/http_parser/http_parser.h
|
||||
grep "define HTTP_PARSER_VERSION_PATCH" node-v${version}/deps/http_parser/http_parser.h
|
||||
echo
|
||||
echo "libuv"
|
||||
echo "========================="
|
||||
grep "define UV_VERSION_MAJOR" node-v${version}/deps/uv/include/uv/version.h
|
||||
grep "define UV_VERSION_MINOR" node-v${version}/deps/uv/include/uv/version.h
|
||||
grep "define UV_VERSION_PATCH" node-v${version}/deps/uv/include/uv/version.h
|
||||
echo
|
||||
echo "nghttp2"
|
||||
echo "========================="
|
||||
grep "define NGHTTP2_VERSION " node-v${version}/deps/nghttp2/lib/includes/nghttp2/nghttp2ver.h
|
||||
echo
|
||||
echo "ICU"
|
||||
echo "========================="
|
||||
grep "url" node-v${version}/tools/icu/current_ver.dep
|
||||
echo
|
||||
echo "punycode"
|
||||
echo "========================="
|
||||
grep "'version'" node-v${version}/lib/punycode.js
|
||||
echo
|
||||
echo "npm"
|
||||
echo "========================="
|
||||
grep "\"version\":" node-v${version}/deps/npm/package.json
|
||||
echo
|
||||
echo "Make sure these versions match what is in the RPM spec file"
|
||||
|
||||
rm -rf node-v${version}
|
||||
# ] <-- needed because of Argbash
|
||||
9
SOURCES/nodejs.pc.in
Normal file
9
SOURCES/nodejs.pc.in
Normal file
@ -0,0 +1,9 @@
|
||||
prefix=@PREFIX@
|
||||
includedir=@INCLUDEDIR@
|
||||
libdir=@LIBDIR@
|
||||
|
||||
Name: @PKGCONFNAME@
|
||||
Description: JavaScript Runtime
|
||||
Version: @NODEJS_VERSION@
|
||||
Libs: -L${libdir} -lnodejs
|
||||
Cflags: -I${includedir}/node
|
||||
@ -1,2 +0,0 @@
|
||||
%__nodejs_native_requires %{_rpmconfigdir}/nodejs_native.req
|
||||
%__nodejs_native_path ^/usr/lib.*/node_modules/.*\\.node$
|
||||
@ -1 +1,4 @@
|
||||
prefix=/usr/local
|
||||
python=/usr/bin/python3
|
||||
update-notifier=false
|
||||
|
||||
|
||||
5
SOURCES/npmrc.builtin.in
Normal file
5
SOURCES/npmrc.builtin.in
Normal file
@ -0,0 +1,5 @@
|
||||
# This is the distibution-level configuration file for npm.
|
||||
# To configure NPM on a system level, use the globalconfig below (defaults to @SYSCONFDIR@/npmrc).
|
||||
# vim:set filetype=dosini:
|
||||
|
||||
globalconfig=@SYSCONFDIR@/npmrc
|
||||
60
SOURCES/test-runner.sh
Executable file
60
SOURCES/test-runner.sh
Executable file
@ -0,0 +1,60 @@
|
||||
#!/bin/bash
|
||||
|
||||
NODE_BIN="$1"
|
||||
PARENT_TEST_FOLDER="$2"
|
||||
TEST_LIST_FILE="$3"
|
||||
|
||||
# At most 10 min per test
|
||||
TIMEOUT_DURATION=600
|
||||
# Exit code
|
||||
FINAL_RESULT=0
|
||||
ARCH=$(uname -m)
|
||||
|
||||
echo "Started test run:"
|
||||
# Run the list of test
|
||||
while IFS= read -r test_line; do
|
||||
# ignore commented lines
|
||||
if [[ "$test_line" =~ ^# ]]; then
|
||||
continue
|
||||
fi
|
||||
# If test has specified ARCH which it should be skipped
|
||||
# Extract it
|
||||
TEST_PATH=$(echo "$test_line" | awk '{print $1}')
|
||||
IGNORE_ARCHES=$(echo "$test_line" |\
|
||||
awk '{for (i=2; i<=NF; i++) printf "%s ", $i; print ""}')
|
||||
|
||||
# Skip test for specified ARCH
|
||||
for ARCH_IGNORE in $IGNORE_ARCHES; do
|
||||
if [[ "$ARCH_IGNORE" == "$ARCH" ]]; then
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
|
||||
# Construct test path
|
||||
TEST_SCRIPT="$PARENT_TEST_FOLDER/$TEST_PATH"
|
||||
|
||||
if [ ! -f "$TEST_SCRIPT" ]; then
|
||||
echo "Test script not found: $TEST_SCRIPT"
|
||||
continue
|
||||
fi
|
||||
|
||||
TEST_OUTPUT=$(timeout "$TIMEOUT_DURATION" "$NODE_BIN" "$TEST_SCRIPT" 2>&1)
|
||||
TEST_RESULT=$?
|
||||
|
||||
# Handle test result
|
||||
if [ $TEST_RESULT -ne 0 ]; then
|
||||
FINAL_RESULT=1
|
||||
if [ $TEST_RESULT -eq 124 ]; then
|
||||
echo "Test timed out: $TEST_SCRIPT"
|
||||
else
|
||||
echo "Test failed: $TEST_SCRIPT"
|
||||
fi
|
||||
echo "Test failure message:"
|
||||
echo "$TEST_OUTPUT"
|
||||
fi
|
||||
done < "$TEST_LIST_FILE"
|
||||
|
||||
if [ $FINAL_RESULT -eq 0 ]; then
|
||||
echo "All tests succesfully passed."
|
||||
fi
|
||||
exit $FINAL_RESULT
|
||||
3844
SOURCES/test-should-pass.txt
Normal file
3844
SOURCES/test-should-pass.txt
Normal file
File diff suppressed because it is too large
Load Diff
9
SOURCES/v8.pc.in
Normal file
9
SOURCES/v8.pc.in
Normal file
@ -0,0 +1,9 @@
|
||||
prefix=@PREFIX@
|
||||
includedir=@INCLUDEDIR@
|
||||
libdir=@LIBDIR@
|
||||
|
||||
Name: v8-@PKGCONFVERSION@
|
||||
Description: JavaScript Runtime
|
||||
Version: @V8_VERSION@
|
||||
Libs: -L${libdir} -lv8
|
||||
Cflags: -I${includedir}
|
||||
1279
SPECS/nodejs.spec
1279
SPECS/nodejs.spec
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user