@yao-pkg/pkg-fetch 3.5.23 → 3.5.25

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/lib-es5/build.js CHANGED
@@ -84,7 +84,7 @@ function getMajor(nodeVersion) {
84
84
  var _a = nodeVersion.match(/^v?(\d+)/) || ['', 0], version = _a[1];
85
85
  return Number(version) | 0;
86
86
  }
87
- function getConfigureArgs(major, targetPlatform) {
87
+ function getConfigureArgs(major, targetPlatform, targetArch) {
88
88
  var args = [];
89
89
  // first of all v8_inspector introduces the use
90
90
  // of `prime_rehash_policy` symbol that requires
@@ -116,12 +116,19 @@ function getConfigureArgs(major, targetPlatform) {
116
116
  // bundled npm package manager
117
117
  args.push('--without-npm');
118
118
  // Small ICU
119
- args.push('--with-intl=small-icu');
119
+ if (system_1.hostPlatform !== 'win' || major < 24) {
120
+ args.push('--with-intl=small-icu');
121
+ }
120
122
  // Workaround for nodejs/node#39313
121
123
  // All supported macOS versions have zlib as a system library
122
124
  if (targetPlatform === 'macos') {
123
125
  args.push('--shared-zlib');
124
126
  }
127
+ // macos cross-build from arm64 to x64
128
+ if (targetPlatform === 'macos' && system_1.hostArch === 'arm64' && targetArch === 'x64') {
129
+ args.push('--dest-os=mac');
130
+ args.push('--dest-cpu=x64');
131
+ }
125
132
  return args;
126
133
  }
127
134
  function tarFetch(nodeVersion) {
@@ -199,7 +206,8 @@ function tarExtract(nodeVersion, suppressTarOutput) {
199
206
  strip: 1,
200
207
  map: function (header) {
201
208
  if (!suppressTarOutput) {
202
- log_1.log.info(header.name);
209
+ // disabled for now - can't get cmdline flag to work with all builds
210
+ // log.info(header.name);
203
211
  }
204
212
  return header;
205
213
  },
@@ -270,7 +278,7 @@ function compileOnWindows(nodeVersion, targetArch, targetPlatform) {
270
278
  case 0:
271
279
  args = ['/c', 'vcbuild.bat', targetArch];
272
280
  major = getMajor(nodeVersion);
273
- config_flags = getConfigureArgs(major, targetPlatform);
281
+ config_flags = getConfigureArgs(major, targetPlatform, targetArch);
274
282
  // The dtrace and etw support was removed in https://github.com/nodejs/node/commit/aa3a572e6bee116cde69508dc29478b40f40551a
275
283
  if (major <= 18) {
276
284
  // Event Tracing for Windows
@@ -284,8 +292,15 @@ function compileOnWindows(nodeVersion, targetArch, targetPlatform) {
284
292
  if (major >= 12) {
285
293
  args.push('ltcg');
286
294
  }
295
+ // Node24 builds on Windows crash with small-icu at icudat codegen
296
+ // workaround for now is to enable full-icu
297
+ // TODO check with newer node/tooling/gh-image versions
298
+ if (major >= 24) {
299
+ args.push('full-icu');
300
+ }
287
301
  // Can't cross compile for arm64 with small-icu
288
- if (system_1.hostArch !== targetArch &&
302
+ if (major < 24 &&
303
+ system_1.hostArch !== targetArch &&
289
304
  !config_flags.includes('--with-intl=full-icu')) {
290
305
  config_flags.push('--without-intl');
291
306
  }
@@ -307,9 +322,9 @@ function compileOnWindows(nodeVersion, targetArch, targetPlatform) {
307
322
  var _a = process.env.MAKE_JOB_COUNT, MAKE_JOB_COUNT = _a === void 0 ? os_1.default.cpus().length : _a;
308
323
  function compileOnUnix(nodeVersion, targetArch, targetPlatform) {
309
324
  return __awaiter(this, void 0, void 0, function () {
310
- var args, cpu, _a, _b, CFLAGS, _c, CXXFLAGS, output;
311
- return __generator(this, function (_d) {
312
- switch (_d.label) {
325
+ var args, cpu, _a, _b, CFLAGS, _c, CXXFLAGS, _d, _e, CFLAGS, _f, CXXFLAGS, _g, LDFLAGS, output;
326
+ return __generator(this, function (_h) {
327
+ switch (_h.label) {
313
328
  case 0:
314
329
  args = [];
315
330
  cpu = {
@@ -326,17 +341,25 @@ function compileOnUnix(nodeVersion, targetArch, targetPlatform) {
326
341
  }
327
342
  if (targetArch === 'armv7') {
328
343
  _a = process.env, _b = _a.CFLAGS, CFLAGS = _b === void 0 ? '' : _b, _c = _a.CXXFLAGS, CXXFLAGS = _c === void 0 ? '' : _c;
329
- process.env.CFLAGS = "".concat(CFLAGS, " -marm -mcpu=cortex-a7");
330
- process.env.CXXFLAGS = "".concat(CXXFLAGS, " -marm -mcpu=cortex-a7");
344
+ process.env.CFLAGS = "".concat(CFLAGS, " -marm -mcpu=cortex-a7 -mfpu=vfpv3");
345
+ process.env.CXXFLAGS = "".concat(CXXFLAGS, " -marm -mcpu=cortex-a7 -mfpu=vfpv3");
331
346
  args.push('--with-arm-float-abi=hard');
332
347
  args.push('--with-arm-fpu=vfpv3');
333
348
  }
349
+ // macos cross-build from arm64 to x64
350
+ if (targetPlatform === "macos" && system_1.hostArch === 'arm64' && targetArch === 'x64') {
351
+ _d = process.env, _e = _d.CFLAGS, CFLAGS = _e === void 0 ? '' : _e, _f = _d.CXXFLAGS, CXXFLAGS = _f === void 0 ? '' : _f, _g = _d.LDFLAGS, LDFLAGS = _g === void 0 ? '' : _g;
352
+ process.env.CFLAGS = "".concat(CFLAGS, " -arch x86_64");
353
+ process.env.CXXFLAGS = "".concat(CXXFLAGS, " -arch x86_64");
354
+ process.env.LDFLAGS = "".concat(LDFLAGS, " -arch x86_64");
355
+ }
334
356
  if (system_1.hostArch !== targetArch) {
335
357
  log_1.log.warn('Cross compiling!');
336
358
  log_1.log.warn('You are responsible for appropriate env like CC, CC_host, etc.');
337
359
  args.push('--cross-compiling');
338
360
  }
339
- args.push.apply(args, getConfigureArgs(getMajor(nodeVersion), targetPlatform));
361
+ args.push.apply(args, getConfigureArgs(getMajor(nodeVersion), targetPlatform, targetArch));
362
+ log_1.log.info("Running configure with: ", args.join(" "));
340
363
  // TODO same for windows?
341
364
  return [4 /*yield*/, (0, utils_1.spawn)('/bin/sh', __spreadArray(['./configure'], args, true), {
342
365
  cwd: nodePath,
@@ -344,19 +367,19 @@ function compileOnUnix(nodeVersion, targetArch, targetPlatform) {
344
367
  })];
345
368
  case 1:
346
369
  // TODO same for windows?
347
- _d.sent();
370
+ _h.sent();
348
371
  return [4 /*yield*/, (0, utils_1.spawn)(system_1.hostPlatform === 'freebsd' ? 'gmake' : 'make', ['-j', String(MAKE_JOB_COUNT)], {
349
372
  cwd: nodePath,
350
373
  stdio: 'inherit',
351
374
  })];
352
375
  case 2:
353
- _d.sent();
376
+ _h.sent();
354
377
  output = path_1.default.join(nodePath, 'out/Release/node');
355
378
  return [4 /*yield*/, (0, utils_1.spawn)(process.env.STRIP || 'strip', __spreadArray(__spreadArray([], (targetPlatform === 'macos' ? ['-x'] : []), true), [output], false), {
356
379
  stdio: 'inherit',
357
380
  })];
358
381
  case 3:
359
- _d.sent();
382
+ _h.sent();
360
383
  if (!(targetPlatform === 'macos')) return [3 /*break*/, 5];
361
384
  // Newer versions of Apple Clang automatically ad-hoc sign the compiled executable.
362
385
  // However, for final executable to be signable, base binary MUST NOT have an existing signature.
@@ -366,8 +389,8 @@ function compileOnUnix(nodeVersion, targetArch, targetPlatform) {
366
389
  case 4:
367
390
  // Newer versions of Apple Clang automatically ad-hoc sign the compiled executable.
368
391
  // However, for final executable to be signable, base binary MUST NOT have an existing signature.
369
- _d.sent();
370
- _d.label = 5;
392
+ _h.sent();
393
+ _h.label = 5;
371
394
  case 5: return [2 /*return*/, output];
372
395
  }
373
396
  });
@@ -23,7 +23,7 @@
23
23
  "node-v16.20.2-macos-arm64": "3d04eb7ddd8b614b888eeb1caa6e64a068b665ab4a26dd064051973ae5842a85",
24
24
  "node-v18.20.8-alpine-arm64": "c7f20847fbfd765517612647593c7767331a318d2b229ddac2b4afd7d13b78d0",
25
25
  "node-v18.20.8-alpine-x64": "3b24c6f571681046a6ed1b42752b21a41e10e8c7ac19416b9571927cc10f4a49",
26
- "node-v18.20.8-linux-arm64": "63f58415622e601d0febd4c6278656b6a69022def646cd6d8f3d01e9c32bf928",
26
+ "node-v18.20.8-linux-arm64": "690ed47821dfbf842a1ba40a7cd2e28344e6ad998a89f5d0eb61da3c86fcd29c",
27
27
  "node-v18.20.8-linux-x64": "0121b3c810db3f5e47028f0b1e2294a1a52a2aa20923c037247e39c82be0f789",
28
28
  "node-v18.20.8-linuxstatic-arm64": "ac03e112f9229126e62924f1fefbb44c54f5fbbb4827d5ffa6243d3b8e81dfa4",
29
29
  "node-v18.20.8-linuxstatic-armv7": "4c96d99319e850887d01cb63500e34f5db3b64944b3644f4ed5c94ae2be5b625",
@@ -32,26 +32,36 @@
32
32
  "node-v18.20.8-macos-x64": "f2cf139bfe3501d39d22b48a069f9ceb24942b0cdc001a0bc30ea3a68fbcc6b3",
33
33
  "node-v18.20.8-win-arm64": "dd56454cfc9292f047413657c8b997006f27ecda8cd7f7dd38acf8d22317e743",
34
34
  "node-v18.20.8-win-x64": "4d45cdfbcba3de3f6c0ddcd78251179b9d04dd2fcb2dba2fb052940a2821eb39",
35
- "node-v20.19.1-alpine-arm64": "6d9a7e3756738eb151b145add72e800c14cab784601ad3743a710d8ac7a18c86",
36
- "node-v20.19.1-alpine-x64": "2df209abfd7042e462dc73233bda6e8d13f955fd5ab181eb48b1e03fa87e5bc2",
37
- "node-v20.19.1-linux-arm64": "0cb29189500580da854a2f58f3aa615bf1c70a7cddbcd59c3d8dea68b114d9a0",
38
- "node-v20.19.1-linux-x64": "ccb7f16a71402f20353a493a215fc5d87d7075b500dc1323a5611c32caf4ea6d",
39
- "node-v20.19.1-linuxstatic-arm64": "7d272e82016b7fab749b81c27435f30a79ec0a75b664ce130a721d7850a4d9ef",
40
- "node-v20.19.1-linuxstatic-armv7": "1e3d3c594065d1aa8ebf11ac977bfa1612a59f38242c907a49973c6a36a95d18",
41
- "node-v20.19.1-linuxstatic-x64": "61f93ec572806ab39609e662cfa50d079ee5bf533bcca3f0bd86a5ae39b9f4fa",
42
- "node-v20.19.1-macos-arm64": "67c9e9fdb947104d1d456c1634b3fb2fcfd1e5b963b3b33cadf44c2da995db79",
43
- "node-v20.19.1-macos-x64": "720c48fa02c4fb9a1bec93e9ecaf8d86f555b56e67ce9ac01bf90c566a8b151f",
44
- "node-v20.19.1-win-arm64": "c8bddec0f4dd27b1eab788ffe7aadb63a5513cc49fab34b1b2adf286ce593836",
45
- "node-v20.19.1-win-x64": "0137b69a69bc834694be27ee9317d0ac16bb33aa7c14610252cc85e9d03c756a",
46
- "node-v22.15.1-alpine-arm64": "52197257ff837f306789aaa73257e0e5256829585c4e8e1a4a06385ec1915985",
47
- "node-v22.15.1-alpine-x64": "85d772fdab79994fcc4a34ae5fcb5395bfa07b755d89cf8d32dcbeed6e1cbff2",
48
- "node-v22.15.1-linux-arm64": "94eca862632857b3bab44d50656539e552a7046f41ca3e09103e0d1fc6866f38",
49
- "node-v22.15.1-linux-x64": "bfd5417e798e0aada7c64eadaedca860fc668598646244a7abddb070539070ce",
50
- "node-v22.15.1-linuxstatic-arm64": "00a02201401beb1180135ae9a432733dd9c70a4b8284cf1a3ec5886b9a7f706f",
51
- "node-v22.15.1-linuxstatic-armv7": "516dff8a2aebe784a74e51cb92aa487d45b0652a8aa2a8e351ce026b16416638",
52
- "node-v22.15.1-linuxstatic-x64": "f18cecdaf8c118e5d466de2ac7ccef22aa5bc79f23136c824e203b403b246444",
53
- "node-v22.15.1-macos-arm64": "77187bb631377edafaa666e3f76db4036c050108e64c139d283c4caa72bc9720",
54
- "node-v22.15.1-macos-x64": "f642411e8a87f2127e62a019d0b87fd61aee8cc1c7b5d96119a0437bf031e2dc",
55
- "node-v22.15.1-win-arm64": "7346edd7a1f191c5585f6e20c2e0c4d626b3f636cfda596c40a4189210ae661d",
56
- "node-v22.15.1-win-x64": "fd78dc295241575f07a545385915bdf238d4fa9972679a984c5f82cd8361f005"
35
+ "node-v20.19.5-alpine-arm64": "f2023b3a16be96ccb71367b83ae353dd096b842a05c83d11e0081f4184bc6cf3",
36
+ "node-v20.19.5-alpine-x64": "d0f2fbb3a05a34242b059b575cd30847efa2a8260d733b674753b0c16ca95cbd",
37
+ "node-v20.19.5-linux-arm64": "d6968f394da2ab55be2eaef486e3e04c984e02360e44210c1c69f980f4fe853d",
38
+ "node-v20.19.5-linux-x64": "2d20d84ccd4d39ef0adf0b3a381c0388290e1ce6784fcf22269881bb471842b0",
39
+ "node-v20.19.5-linuxstatic-arm64": "cd61bef96f43fb48c8a7c25caa4900ecb4b1881d8c690f9d6bc4f9c28091b9a6",
40
+ "node-v20.19.5-linuxstatic-armv7": "f237a057650ebbfae6d9dfc82d2ee29885f60e2dedcd983f17910215eb23613f",
41
+ "node-v20.19.5-linuxstatic-x64": "33b2856138af5992fad38e0d72448e5c708ee77e31e8bce77ec03f1a6e7a2d5b",
42
+ "node-v20.19.5-macos-arm64": "bebb13bf501a03fd9bdfdc08ce597e3b082f569effa64ee310252460555ae54b",
43
+ "node-v20.19.5-macos-x64": "592f50151da65550e5a6125aea0aa5b4fa0214389bb4ff0516e9ae14b439d8f5",
44
+ "node-v20.19.5-win-arm64": "0f94e2049deab1c6591626b1d16f1c03a9cd300d857b8030535978c45d8492ca",
45
+ "node-v20.19.5-win-x64": "1dce94ce8d6f625b9129d5e21d795e11c366da77c9c4d400b4561563c5a970cc",
46
+ "node-v22.19.0-alpine-arm64": "64db52d7a1b5e829b5984420968936fc4812d55ccf20885ae7e8602059275d7c",
47
+ "node-v22.19.0-alpine-x64": "ca81f11119eb89e2135024ca294bb25707f2d49bea068d74cc828ff2604c1923",
48
+ "node-v22.19.0-linux-arm64": "cace9e7d7953770be693fe1dba9bdfb3f6f269dd8102c2b3d08b4873531452f6",
49
+ "node-v22.19.0-linux-x64": "7952983e6c637c6cb118143b440936f1038f94547c35901e890bc034be6ced0f",
50
+ "node-v22.19.0-linuxstatic-arm64": "62fcec80e861328d77455173b7815b0cdf3b0c6f0506d9dee79a7231dec31a4b",
51
+ "node-v22.19.0-linuxstatic-armv7": "5d142dc0970b76955b15383a5fc9a9f9f1c7f37fe419ff1d4dd6932ee86dc026",
52
+ "node-v22.19.0-linuxstatic-x64": "fbb16a3b7cb59b05bde92e82af422edcc4c1f43decead6cb452542fc80c2b888",
53
+ "node-v22.19.0-macos-arm64": "99fe232c87f29ec05754f61643a79f85e574dab1632ea1c47a4174cbc72e0501",
54
+ "node-v22.19.0-macos-x64": "53331111f0e3c895ac4a92a03eb9eb1d246e62f594ce8b46b19af6fbf4340dd3",
55
+ "node-v22.19.0-win-arm64": "046d67caaa35b635cd76ebb0089b65a8dcd4395e0c0854e15fb6fe421f02818a",
56
+ "node-v22.19.0-win-x64": "245248067a44ed6ff081bff54d47eb6376fbb64d87de05f8a24a55c179a10ace",
57
+ "node-v24.8.0-alpine-arm64": "7ae38237759d79694c9cee5a1681d6fbf233ed824166cfff0d29184f1fbd3597",
58
+ "node-v24.8.0-alpine-x64": "d38ef253ee541817fc560b80341517cc978752c04218724779f619ba48aedbfa",
59
+ "node-v24.8.0-linux-arm64": "a63f5e287c0771e31c47b7f99f366bbb93b6c7bd4c475d8c538cc551a06cebb5",
60
+ "node-v24.8.0-linux-x64": "681907eb837fe0ad2040fb4c3b1af52382deb469a1e9754cb90b200bf6b01c6f",
61
+ "node-v24.8.0-linuxstatic-arm64": "5e40c9e2533e6a1128372f7207d837b5a835a6d8621f3e9aea3e707aa08a257e",
62
+ "node-v24.8.0-linuxstatic-x64": "81470985de5f268e510e5ed19456663308007c2f0b201907d63b9e2a8e748eee",
63
+ "node-v24.8.0-macos-arm64": "5972af60eef941eaf6d05c42daf221ece63a6b3d94d237625254aa27ddf1017f",
64
+ "node-v24.8.0-macos-x64": "772d2cf0dc68bb3e9e1df59e17ca0e381cff7793bd0dc19edb5acf4e39553c0a",
65
+ "node-v24.8.0-win-arm64": "b9979ee1462e49a50d17e3a05b43caf00cb41043f794aaf6a3af06f5251f6964",
66
+ "node-v24.8.0-win-x64": "386681759a5c115544465cddaa4a9e2346497d51bced084b718e6cac561e688d"
57
67
  }
package/lib-es5/utils.js CHANGED
@@ -53,16 +53,25 @@ var log_1 = require("./log");
53
53
  function downloadUrl(url, file) {
54
54
  var _a, _b, _c;
55
55
  return __awaiter(this, void 0, void 0, function () {
56
- var proxy, res, tempFile, ws, totalSize, currentSize;
56
+ var proxy, res, err_1, tempFile, ws, totalSize, currentSize;
57
57
  return __generator(this, function (_d) {
58
58
  switch (_d.label) {
59
59
  case 0:
60
60
  log_1.log.enableProgress(path_1.default.basename(file));
61
61
  log_1.log.showProgress(0);
62
62
  proxy = (_c = (_b = (_a = process.env.HTTPS_PROXY) !== null && _a !== void 0 ? _a : process.env.https_proxy) !== null && _b !== void 0 ? _b : process.env.HTTP_PROXY) !== null && _c !== void 0 ? _c : process.env.http_proxy;
63
- return [4 /*yield*/, (0, node_fetch_1.default)(url, proxy ? { agent: (0, https_proxy_agent_1.default)(proxy) } : undefined)];
63
+ _d.label = 1;
64
64
  case 1:
65
+ _d.trys.push([1, 3, , 4]);
66
+ return [4 /*yield*/, (0, node_fetch_1.default)(url, proxy ? { agent: (0, https_proxy_agent_1.default)(proxy) } : undefined)];
67
+ case 2:
65
68
  res = _d.sent();
69
+ return [3 /*break*/, 4];
70
+ case 3:
71
+ err_1 = _d.sent();
72
+ log_1.log.disableProgress();
73
+ throw (0, log_1.wasReported)("Network error during fetch: ".concat(err_1.message));
74
+ case 4:
66
75
  if (!res.ok) {
67
76
  log_1.log.disableProgress();
68
77
  throw (0, log_1.wasReported)("".concat(res.status, ": ").concat(res.statusText));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yao-pkg/pkg-fetch",
3
- "version": "3.5.23",
3
+ "version": "3.5.25",
4
4
  "description": "Compiles and stores base binaries for pkg",
5
5
  "main": "lib-es5/index.js",
6
6
  "license": "MIT",
@@ -1,8 +1,8 @@
1
1
  diff --git node/common.gypi node/common.gypi
2
- index d3c17d47bc..7970af6ea4 100644
2
+ index 20e81dea95..3580f7f2e4 100644
3
3
  --- node/common.gypi
4
4
  +++ node/common.gypi
5
- @@ -184,7 +184,7 @@
5
+ @@ -187,7 +187,7 @@
6
6
  ['clang==1', {
7
7
  'lto': ' -flto ', # Clang
8
8
  }, {
@@ -262,10 +262,10 @@ index 0000000000..a697294fdf
262
262
  + }());
263
263
  +}());
264
264
  diff --git node/lib/internal/modules/cjs/loader.js node/lib/internal/modules/cjs/loader.js
265
- index ebccdb2825..178299c752 100644
265
+ index b12594cc36..bc0361d8aa 100644
266
266
  --- node/lib/internal/modules/cjs/loader.js
267
267
  +++ node/lib/internal/modules/cjs/loader.js
268
- @@ -141,7 +141,7 @@ const {
268
+ @@ -144,7 +144,7 @@ const {
269
269
  const assert = require('internal/assert');
270
270
  const fs = require('fs');
271
271
  const path = require('path');
@@ -364,7 +364,7 @@ index bb39a0cb42..5fa6cb65cc 100644
364
364
  parent_env_->AddCleanupHook([](void* data) {
365
365
  Environment* env = static_cast<Environment*>(data);
366
366
  diff --git node/src/node.cc node/src/node.cc
367
- index 4ad2c8b804..ab6174fab6 100644
367
+ index 1137dcafcd..482feb65b5 100644
368
368
  --- node/src/node.cc
369
369
  +++ node/src/node.cc
370
370
  @@ -389,6 +389,8 @@ MaybeLocal<Value> StartExecution(Environment* env, StartExecutionCallback cb) {
@@ -392,7 +392,7 @@ index 4ad2c8b804..ab6174fab6 100644
392
392
  }
393
393
 
394
394
  diff --git node/src/node_contextify.cc node/src/node_contextify.cc
395
- index 7f82bca746..62705f04c5 100644
395
+ index 2b93926a73..9f68232bd4 100644
396
396
  --- node/src/node_contextify.cc
397
397
  +++ node/src/node_contextify.cc
398
398
  @@ -79,6 +79,7 @@ using v8::String;