@yao-pkg/pkg-fetch 3.5.30 → 3.5.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/lib-es5/apply-patches.js +19 -78
- package/lib-es5/bin.js +40 -89
- package/lib-es5/build.js +198 -394
- package/lib-es5/expected-shas.json +32 -32
- package/lib-es5/expected.js +1 -1
- package/lib-es5/generate-expected-shas.js +31 -72
- package/lib-es5/index.js +125 -210
- package/lib-es5/log.js +39 -63
- package/lib-es5/parse-update-shas.js +32 -36
- package/lib-es5/places.js +13 -15
- package/lib-es5/print-hashes.js +4 -5
- package/lib-es5/system.js +17 -19
- package/lib-es5/utils.js +82 -150
- package/lib-es5/verify.js +118 -53
- package/package.json +1 -1
- package/patches/{node.v20.19.5.cpp.patch → node.v20.20.0.cpp.patch} +7 -7
- package/patches/{node.v22.21.1.cpp.patch → node.v22.22.0.cpp.patch} +5 -5
- package/patches/{node.v24.11.0.cpp.patch → node.v24.13.0.cpp.patch} +10 -10
- package/patches/patches.json +3 -3
package/lib-es5/utils.js
CHANGED
|
@@ -1,173 +1,105 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
4
|
};
|
|
41
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
6
|
exports.nodeBinarySortFunction = exports.spawn = exports.plusx = exports.hash = exports.downloadUrl = void 0;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
function downloadUrl(url, file) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
reject((0, log_1.wasReported)("".concat(err.name, ": ").concat(err.message)));
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
log_1.log.showProgress(100);
|
|
100
|
-
log_1.log.disableProgress();
|
|
101
|
-
(0, fs_1.renameSync)(tempFile, file);
|
|
102
|
-
resolve();
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
})];
|
|
7
|
+
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
8
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const promises_1 = require("fs/promises");
|
|
11
|
+
const https_proxy_agent_1 = __importDefault(require("https-proxy-agent"));
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
13
|
+
const child_process_1 = require("child_process");
|
|
14
|
+
const stream_1 = __importDefault(require("stream"));
|
|
15
|
+
const semver_1 = require("semver");
|
|
16
|
+
const log_1 = require("./log");
|
|
17
|
+
async function downloadUrl(url, file) {
|
|
18
|
+
log_1.log.enableProgress(path_1.default.basename(file));
|
|
19
|
+
log_1.log.showProgress(0);
|
|
20
|
+
const proxy = process.env.HTTPS_PROXY ??
|
|
21
|
+
process.env.https_proxy ??
|
|
22
|
+
process.env.HTTP_PROXY ??
|
|
23
|
+
process.env.http_proxy;
|
|
24
|
+
let res;
|
|
25
|
+
try {
|
|
26
|
+
res = await (0, node_fetch_1.default)(url, proxy ? { agent: (0, https_proxy_agent_1.default)(proxy) } : undefined);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
log_1.log.disableProgress();
|
|
30
|
+
throw (0, log_1.wasReported)(`Network error during fetch: ${err.message}`);
|
|
31
|
+
}
|
|
32
|
+
if (!res.ok) {
|
|
33
|
+
log_1.log.disableProgress();
|
|
34
|
+
throw (0, log_1.wasReported)(`${res.status}: ${res.statusText}`);
|
|
35
|
+
}
|
|
36
|
+
const tempFile = `${file}.downloading`;
|
|
37
|
+
(0, fs_1.mkdirSync)(path_1.default.dirname(tempFile), { recursive: true });
|
|
38
|
+
const ws = (0, fs_1.createWriteStream)(tempFile);
|
|
39
|
+
const totalSize = Number(res.headers.get('content-length'));
|
|
40
|
+
let currentSize = 0;
|
|
41
|
+
res.body.on('data', (chunk) => {
|
|
42
|
+
if (totalSize != null && totalSize !== 0) {
|
|
43
|
+
currentSize += chunk.length;
|
|
44
|
+
log_1.log.showProgress((currentSize / totalSize) * 100);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
res.body.pipe(ws);
|
|
48
|
+
return new Promise((resolve, reject) => {
|
|
49
|
+
stream_1.default.finished(ws, (err) => {
|
|
50
|
+
if (err) {
|
|
51
|
+
log_1.log.disableProgress();
|
|
52
|
+
(0, fs_1.rmSync)(tempFile);
|
|
53
|
+
reject((0, log_1.wasReported)(`${err.name}: ${err.message}`));
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
log_1.log.showProgress(100);
|
|
57
|
+
log_1.log.disableProgress();
|
|
58
|
+
(0, fs_1.renameSync)(tempFile, file);
|
|
59
|
+
resolve();
|
|
106
60
|
}
|
|
107
61
|
});
|
|
108
62
|
});
|
|
109
63
|
}
|
|
110
64
|
exports.downloadUrl = downloadUrl;
|
|
111
|
-
function hash(filePath) {
|
|
112
|
-
return
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
input.on('error', function (e) {
|
|
118
|
-
reject(e);
|
|
119
|
-
});
|
|
120
|
-
input.on('readable', function () {
|
|
121
|
-
var data = input.read();
|
|
122
|
-
if (data) {
|
|
123
|
-
resultHash.update(data);
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
resolve(resultHash.digest('hex'));
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
})];
|
|
65
|
+
async function hash(filePath) {
|
|
66
|
+
return new Promise((resolve, reject) => {
|
|
67
|
+
const resultHash = crypto_1.default.createHash('sha256');
|
|
68
|
+
const input = (0, fs_1.createReadStream)(filePath);
|
|
69
|
+
input.on('error', (e) => {
|
|
70
|
+
reject(e);
|
|
130
71
|
});
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
switch (_a.label) {
|
|
139
|
-
case 0: return [4 /*yield*/, (0, promises_1.stat)(file)];
|
|
140
|
-
case 1:
|
|
141
|
-
s = _a.sent();
|
|
142
|
-
newMode = s.mode | 64 | 8 | 1;
|
|
143
|
-
if (s.mode === newMode)
|
|
144
|
-
return [2 /*return*/];
|
|
145
|
-
base8 = newMode.toString(8).slice(-3);
|
|
146
|
-
return [4 /*yield*/, (0, promises_1.chmod)(file, base8)];
|
|
147
|
-
case 2:
|
|
148
|
-
_a.sent();
|
|
149
|
-
return [2 /*return*/];
|
|
72
|
+
input.on('readable', () => {
|
|
73
|
+
const data = input.read();
|
|
74
|
+
if (data) {
|
|
75
|
+
resultHash.update(data);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
resolve(resultHash.digest('hex'));
|
|
150
79
|
}
|
|
151
80
|
});
|
|
152
81
|
});
|
|
153
82
|
}
|
|
83
|
+
exports.hash = hash;
|
|
84
|
+
async function plusx(file) {
|
|
85
|
+
const s = await (0, promises_1.stat)(file);
|
|
86
|
+
const newMode = s.mode | 64 | 8 | 1;
|
|
87
|
+
if (s.mode === newMode)
|
|
88
|
+
return;
|
|
89
|
+
const base8 = newMode.toString(8).slice(-3);
|
|
90
|
+
await (0, promises_1.chmod)(file, base8);
|
|
91
|
+
}
|
|
154
92
|
exports.plusx = plusx;
|
|
155
|
-
function spawn(command, args, options) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
if (error) {
|
|
161
|
-
throw error;
|
|
162
|
-
}
|
|
163
|
-
return [2 /*return*/];
|
|
164
|
-
});
|
|
165
|
-
});
|
|
93
|
+
async function spawn(command, args, options) {
|
|
94
|
+
const { error } = (0, child_process_1.spawnSync)(command, args, options);
|
|
95
|
+
if (error) {
|
|
96
|
+
throw error;
|
|
97
|
+
}
|
|
166
98
|
}
|
|
167
99
|
exports.spawn = spawn;
|
|
168
100
|
function nodeBinarySortFunction(a, b) {
|
|
169
|
-
|
|
170
|
-
|
|
101
|
+
const coercedVersionA = (0, semver_1.coerce)(a);
|
|
102
|
+
const coercedVersionB = (0, semver_1.coerce)(b);
|
|
171
103
|
if (coercedVersionA && coercedVersionB) {
|
|
172
104
|
return coercedVersionA.compare(coercedVersionB);
|
|
173
105
|
}
|
package/lib-es5/verify.js
CHANGED
|
@@ -1,59 +1,124 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
3
|
exports.verify = void 0;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
const script = `
|
|
7
|
+
var vm = require('vm');
|
|
8
|
+
var assert = require('assert');
|
|
9
|
+
var text = '(function () { return 42; })';
|
|
10
|
+
var cd, fn, result;
|
|
11
|
+
var modules = process.versions.modules | 0;
|
|
12
|
+
var v8 = process.versions.v8.split('.').slice(0, 2).join('.');
|
|
13
|
+
|
|
14
|
+
var s1 = new vm.Script(text, { filename: 's1', produceCachedData: true, sourceless: true });
|
|
15
|
+
assert(s1.cachedDataProduced);
|
|
16
|
+
cd = s1.cachedData;
|
|
17
|
+
|
|
18
|
+
var kCpuFeaturesOffset, cpuFeatures;
|
|
19
|
+
|
|
20
|
+
if (modules === 14) {
|
|
21
|
+
} else
|
|
22
|
+
if (modules === 46 || modules === 48 || modules === 51) {
|
|
23
|
+
kCpuFeaturesOffset = 0x0c;
|
|
24
|
+
} else
|
|
25
|
+
if (modules === 57) {
|
|
26
|
+
if (v8 === '6.2') {
|
|
27
|
+
kCpuFeaturesOffset = 0x0c;
|
|
28
|
+
} else
|
|
29
|
+
if (v8 === '5.8') {
|
|
30
|
+
kCpuFeaturesOffset = 0x0c;
|
|
31
|
+
} else {
|
|
32
|
+
kCpuFeaturesOffset = 0x10;
|
|
33
|
+
}
|
|
34
|
+
} else
|
|
35
|
+
if (modules === 59) {
|
|
36
|
+
kCpuFeaturesOffset = 0x0c;
|
|
37
|
+
} else
|
|
38
|
+
if (modules === 64) {
|
|
39
|
+
kCpuFeaturesOffset = 0x0c;
|
|
40
|
+
} else
|
|
41
|
+
if (modules === 72) {
|
|
42
|
+
// no cpu features anymore
|
|
43
|
+
} else
|
|
44
|
+
if (modules === 79) {
|
|
45
|
+
// no cpu features anymore
|
|
46
|
+
} else
|
|
47
|
+
if (modules === 83) {
|
|
48
|
+
// no cpu features anymore
|
|
49
|
+
} else
|
|
50
|
+
if (modules === 93) {
|
|
51
|
+
// no cpu features anymore
|
|
52
|
+
} else
|
|
53
|
+
if (modules === 108) {
|
|
54
|
+
// no cpu features anymore
|
|
55
|
+
} else
|
|
56
|
+
if (modules === 111) {
|
|
57
|
+
// no cpu features anymore
|
|
58
|
+
} else
|
|
59
|
+
if (modules === 115) {
|
|
60
|
+
// no cpu features anymore
|
|
61
|
+
} else {
|
|
62
|
+
assert(false, modules);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (modules >= 46 && // no cpu_features field in 0.12
|
|
66
|
+
process.arch !== 'arm' && // non-zero features even in sourceless mode in arm
|
|
67
|
+
modules < 72) { // no cpu_features field in 12+
|
|
68
|
+
cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);
|
|
69
|
+
assert(cpuFeatures === 0, 'CPU_FEATURES must be zero');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var s2 = new vm.Script(undefined, { filename: 's2', cachedData: cd, sourceless: true });
|
|
73
|
+
fn = s2.runInThisContext();
|
|
74
|
+
result = fn();
|
|
75
|
+
assert.equal(result, 42);
|
|
76
|
+
|
|
77
|
+
if (modules === 14) {
|
|
78
|
+
} else
|
|
79
|
+
if (modules === 46 || modules === 48 ||
|
|
80
|
+
modules === 51 || modules === 57 || modules === 59 || modules === 64) {
|
|
81
|
+
var paddedPayloadOffset = 0x48; // see SerializedCodeData::Payload()
|
|
82
|
+
var index = paddedPayloadOffset + 10;
|
|
83
|
+
cd[index] ^= 0xf0;
|
|
84
|
+
var s3 = new vm.Script(undefined, { filename: 's3', cachedData: cd, sourceless: true });
|
|
85
|
+
assert(s3.cachedDataRejected, 's3.cachedDataRejected must be true');
|
|
86
|
+
} else
|
|
87
|
+
if (modules === 72) {
|
|
88
|
+
} else
|
|
89
|
+
if (modules === 79) {
|
|
90
|
+
} else
|
|
91
|
+
if (modules === 83) {
|
|
92
|
+
} else
|
|
93
|
+
if (modules === 93) {
|
|
94
|
+
} else
|
|
95
|
+
if (modules === 108) {
|
|
96
|
+
} else
|
|
97
|
+
if (modules === 111) {
|
|
98
|
+
} else
|
|
99
|
+
if (modules === 115) {
|
|
100
|
+
} else {
|
|
101
|
+
assert(false, modules);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
var s4 = new vm.Script(text, { filename: 's4', produceCachedData: true });
|
|
105
|
+
assert(s4.cachedDataProduced, 's4.cachedDataProduced must be true');
|
|
106
|
+
cd = s4.cachedData;
|
|
107
|
+
|
|
108
|
+
if (modules >= 46 && // no cpu_features field in 0.12
|
|
109
|
+
process.arch !== 'arm' && // zero features even in non-sourceless mode in arm
|
|
110
|
+
modules < 72) { // no cpu_features field in 12+
|
|
111
|
+
cpuFeatures = cd.readUInt32LE(kCpuFeaturesOffset);
|
|
112
|
+
assert(cpuFeatures !== 0, 'CPU_FEATURES must be non-zero');
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
console.log('ok');
|
|
116
|
+
`;
|
|
117
|
+
async function verify(local) {
|
|
118
|
+
await (0, utils_1.plusx)(local);
|
|
119
|
+
(0, child_process_1.spawnSync)(local, ['-e', script], {
|
|
120
|
+
env: { PKG_EXECPATH: 'PKG_INVOKE_NODEJS' },
|
|
121
|
+
stdio: 'inherit',
|
|
57
122
|
});
|
|
58
123
|
}
|
|
59
124
|
exports.verify = verify;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
diff --git node/common.gypi node/common.gypi
|
|
2
|
-
index
|
|
2
|
+
index 311b203600..b2ee8cb47d 100644
|
|
3
3
|
--- node/common.gypi
|
|
4
4
|
+++ node/common.gypi
|
|
5
5
|
@@ -187,7 +187,7 @@
|
|
@@ -69,7 +69,7 @@ index d3e35d6ec5..6e9bbe3849 100644
|
|
|
69
69
|
static const char* GetVersion();
|
|
70
70
|
|
|
71
71
|
diff --git node/deps/v8/src/api/api.cc node/deps/v8/src/api/api.cc
|
|
72
|
-
index
|
|
72
|
+
index da0c960f99..08af13d77a 100644
|
|
73
73
|
--- node/deps/v8/src/api/api.cc
|
|
74
74
|
+++ node/deps/v8/src/api/api.cc
|
|
75
75
|
@@ -806,6 +806,28 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
|
|
@@ -288,10 +288,10 @@ index 88c079d10d..a7eaca0574 100644
|
|
|
288
288
|
const permission = require('internal/process/permission');
|
|
289
289
|
const { kEmptyObject } = require('internal/util');
|
|
290
290
|
diff --git node/lib/internal/process/pre_execution.js node/lib/internal/process/pre_execution.js
|
|
291
|
-
index
|
|
291
|
+
index 96bbfb4c35..ff50e19a6a 100644
|
|
292
292
|
--- node/lib/internal/process/pre_execution.js
|
|
293
293
|
+++ node/lib/internal/process/pre_execution.js
|
|
294
|
-
@@ -
|
|
294
|
+
@@ -49,7 +49,11 @@ const {
|
|
295
295
|
},
|
|
296
296
|
} = require('internal/v8/startup_snapshot');
|
|
297
297
|
|
|
@@ -303,7 +303,7 @@ index 0bbabb80c2..5dd097b69e 100644
|
|
|
303
303
|
return prepareExecution({
|
|
304
304
|
expandArgv1,
|
|
305
305
|
initializeModules,
|
|
306
|
-
@@ -
|
|
306
|
+
@@ -241,7 +245,12 @@ function patchProcessObject(expandArgv1) {
|
|
307
307
|
let mainEntry;
|
|
308
308
|
// If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
|
|
309
309
|
// the entry point.
|
|
@@ -317,7 +317,7 @@ index 0bbabb80c2..5dd097b69e 100644
|
|
|
317
317
|
// Expand process.argv[1] into a full path.
|
|
318
318
|
const path = require('path');
|
|
319
319
|
try {
|
|
320
|
-
@@ -
|
|
320
|
+
@@ -737,6 +746,7 @@ function loadPreloadModules() {
|
|
321
321
|
// For user code, we preload modules if `-r` is passed
|
|
322
322
|
const preloadModules = getOptionValue('--require');
|
|
323
323
|
if (preloadModules && preloadModules.length > 0) {
|
|
@@ -392,7 +392,7 @@ index 1137dcafcd..482feb65b5 100644
|
|
|
392
392
|
}
|
|
393
393
|
|
|
394
394
|
diff --git node/src/node_contextify.cc node/src/node_contextify.cc
|
|
395
|
-
index
|
|
395
|
+
index 2331579b26..f84681ae02 100644
|
|
396
396
|
--- node/src/node_contextify.cc
|
|
397
397
|
+++ node/src/node_contextify.cc
|
|
398
398
|
@@ -79,6 +79,7 @@ using v8::String;
|
|
@@ -59,7 +59,7 @@ index d3e35d6ec5..6e9bbe3849 100644
|
|
|
59
59
|
static const char* GetVersion();
|
|
60
60
|
|
|
61
61
|
diff --git node/deps/v8/src/api/api.cc node/deps/v8/src/api/api.cc
|
|
62
|
-
index
|
|
62
|
+
index f9ce798dc2..68af88ab13 100644
|
|
63
63
|
--- node/deps/v8/src/api/api.cc
|
|
64
64
|
+++ node/deps/v8/src/api/api.cc
|
|
65
65
|
@@ -624,6 +624,28 @@ void V8::SetFlagsFromCommandLine(int* argc, char** argv, bool remove_flags) {
|
|
@@ -410,10 +410,10 @@ index 0f9442ea7a..e30582b3cc 100644
|
|
|
410
410
|
__proto__: null,
|
|
411
411
|
...result.data,
|
|
412
412
|
diff --git node/lib/internal/process/pre_execution.js node/lib/internal/process/pre_execution.js
|
|
413
|
-
index
|
|
413
|
+
index 15443a710c..da28d36aa8 100644
|
|
414
414
|
--- node/lib/internal/process/pre_execution.js
|
|
415
415
|
+++ node/lib/internal/process/pre_execution.js
|
|
416
|
-
@@ -
|
|
416
|
+
@@ -49,7 +49,11 @@ const {
|
|
417
417
|
runDeserializeCallbacks,
|
|
418
418
|
} = require('internal/v8/startup_snapshot');
|
|
419
419
|
|
|
@@ -425,7 +425,7 @@ index d12d21905c..cf8a5c9096 100644
|
|
|
425
425
|
return prepareExecution({
|
|
426
426
|
expandArgv1,
|
|
427
427
|
initializeModules,
|
|
428
|
-
@@ -
|
|
428
|
+
@@ -263,7 +267,8 @@ function patchProcessObject(expandArgv1) {
|
|
429
429
|
let mainEntry;
|
|
430
430
|
// If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
|
|
431
431
|
// the entry point.
|
|
@@ -435,7 +435,7 @@ index d12d21905c..cf8a5c9096 100644
|
|
|
435
435
|
// Expand process.argv[1] into a full path.
|
|
436
436
|
const path = require('path');
|
|
437
437
|
try {
|
|
438
|
-
@@ -
|
|
438
|
+
@@ -745,6 +750,7 @@ function loadPreloadModules() {
|
|
439
439
|
// For user code, we preload modules if `-r` is passed
|
|
440
440
|
const preloadModules = getOptionValue('--require');
|
|
441
441
|
if (preloadModules && preloadModules.length > 0) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
diff --git node/common.gypi node/common.gypi
|
|
2
|
-
index
|
|
2
|
+
index db16253786..3a381990a3 100644
|
|
3
3
|
--- node/common.gypi
|
|
4
4
|
+++ node/common.gypi
|
|
5
5
|
@@ -192,7 +192,7 @@
|
|
@@ -242,7 +242,7 @@ index 11ced93c08..1f4b534415 100644
|
|
|
242
242
|
}
|
|
243
243
|
uint32_t payload_length = GetHeaderValue(kPayloadLengthOffset);
|
|
244
244
|
diff --git node/deps/v8/src/snapshot/read-only-serializer.cc node/deps/v8/src/snapshot/read-only-serializer.cc
|
|
245
|
-
index
|
|
245
|
+
index 0178607289..88c8c2b852 100644
|
|
246
246
|
--- node/deps/v8/src/snapshot/read-only-serializer.cc
|
|
247
247
|
+++ node/deps/v8/src/snapshot/read-only-serializer.cc
|
|
248
248
|
@@ -12,6 +12,9 @@
|
|
@@ -486,10 +486,10 @@ index 0000000000..a697294fdf
|
|
|
486
486
|
+ }());
|
|
487
487
|
+}());
|
|
488
488
|
diff --git node/lib/internal/modules/cjs/loader.js node/lib/internal/modules/cjs/loader.js
|
|
489
|
-
index
|
|
489
|
+
index 414e450ee3..356cbbaa94 100644
|
|
490
490
|
--- node/lib/internal/modules/cjs/loader.js
|
|
491
491
|
+++ node/lib/internal/modules/cjs/loader.js
|
|
492
|
-
@@ -
|
|
492
|
+
@@ -261,12 +261,15 @@ function stat(filename) {
|
|
493
493
|
// Guard against internal bugs where a non-string filename is passed in by mistake.
|
|
494
494
|
assert(typeof filename === 'string');
|
|
495
495
|
|
|
@@ -543,7 +543,7 @@ index 43a131f57c..6fe7afd784 100644
|
|
|
543
543
|
__proto__: null,
|
|
544
544
|
...result.data,
|
|
545
545
|
diff --git node/lib/internal/process/pre_execution.js node/lib/internal/process/pre_execution.js
|
|
546
|
-
index
|
|
546
|
+
index 8ed8802adc..8152188eb7 100644
|
|
547
547
|
--- node/lib/internal/process/pre_execution.js
|
|
548
548
|
+++ node/lib/internal/process/pre_execution.js
|
|
549
549
|
@@ -42,7 +42,11 @@ const {
|
|
@@ -558,7 +558,7 @@ index c7f86098bd..32eac7d2ee 100644
|
|
|
558
558
|
return prepareExecution({
|
|
559
559
|
expandArgv1,
|
|
560
560
|
initializeModules,
|
|
561
|
-
@@ -
|
|
561
|
+
@@ -274,7 +278,8 @@ function patchProcessObject(expandArgv1) {
|
|
562
562
|
let mainEntry;
|
|
563
563
|
// If requested, update process.argv[1] to replace whatever the user provided with the resolved absolute file path of
|
|
564
564
|
// the entry point.
|
|
@@ -568,7 +568,7 @@ index c7f86098bd..32eac7d2ee 100644
|
|
|
568
568
|
// Expand process.argv[1] into a full path.
|
|
569
569
|
const path = require('path');
|
|
570
570
|
try {
|
|
571
|
-
@@ -
|
|
571
|
+
@@ -690,6 +695,7 @@ function loadPreloadModules() {
|
|
572
572
|
// For user code, we preload modules if `-r` is passed
|
|
573
573
|
const preloadModules = getOptionValue('--require');
|
|
574
574
|
if (preloadModules && preloadModules.length > 0) {
|
|
@@ -615,7 +615,7 @@ index f62eb36b57..8ccc42dbd4 100644
|
|
|
615
615
|
parent_env_->AddCleanupHook([](void* data) {
|
|
616
616
|
Environment* env = static_cast<Environment*>(data);
|
|
617
617
|
diff --git node/src/node.cc node/src/node.cc
|
|
618
|
-
index
|
|
618
|
+
index 31439d0cc1..8dda6dcc8a 100644
|
|
619
619
|
--- node/src/node.cc
|
|
620
620
|
+++ node/src/node.cc
|
|
621
621
|
@@ -355,6 +355,8 @@ MaybeLocal<Value> StartExecution(Environment* env, StartExecutionCallback cb) {
|
|
@@ -837,10 +837,10 @@ index 3295121b87..bfe838b8c1 100644
|
|
|
837
837
|
+ return adjacent(c, nargv);
|
|
838
838
|
+}
|
|
839
839
|
diff --git node/src/node_options.cc node/src/node_options.cc
|
|
840
|
-
index
|
|
840
|
+
index 342bffb00f..1802fbac25 100644
|
|
841
841
|
--- node/src/node_options.cc
|
|
842
842
|
+++ node/src/node_options.cc
|
|
843
|
-
@@ -
|
|
843
|
+
@@ -430,6 +430,7 @@ void Parse(
|
|
844
844
|
// TODO(addaleax): Make that unnecessary.
|
|
845
845
|
|
|
846
846
|
DebugOptionsParser::DebugOptionsParser() {
|
package/patches/patches.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"v24.
|
|
3
|
-
"v22.
|
|
4
|
-
"v20.
|
|
2
|
+
"v24.13.0": ["node.v24.13.0.cpp.patch"],
|
|
3
|
+
"v22.22.0": ["node.v22.22.0.cpp.patch"],
|
|
4
|
+
"v20.20.0": ["node.v20.20.0.cpp.patch"],
|
|
5
5
|
"v18.20.8": ["node.v18.20.8.cpp.patch"],
|
|
6
6
|
"v16.20.2": ["node.v16.20.2.cpp.patch"],
|
|
7
7
|
"v14.21.3": ["node.v14.21.3.cpp.patch"],
|