Page MenuHomePhabricator

wikimedia/portals fails CI on Node 20
Closed, ResolvedPublic2 Estimated Story Points

Description

https://integration.wikimedia.org/ci/job/generic-node20-browser/961/console

00:00:42.619 npm error In file included from ../../nan/nan.h:180,
00:00:42.619 npm error                  from ../src/common/allocator.cc:1:
00:00:42.619 npm error ../../nan/nan_callbacks.h:55:23: error: ‘AccessorSignature’ is not a member of ‘v8’
00:00:42.619 npm error    55 | typedef v8::Local<v8::AccessorSignature> Sig;
00:00:42.619 npm error       |                       ^~~~~~~~~~~~~~~~~
00:00:42.619 npm error ../../nan/nan_callbacks.h:55:40: error: template argument 1 is invalid
00:00:42.619 npm error    55 | typedef v8::Local<v8::AccessorSignature> Sig;
00:00:42.619 npm error       |                                        ^
00:00:42.619 npm error make: *** [iltorb.target.mk:144: Release/obj.target/iltorb/src/common/allocator.o] Error 1
00:00:42.619 npm error gyp ERR! build error 
00:00:42.619 npm error gyp ERR! stack Error: `make` failed with exit code: 2
00:00:42.619 npm error gyp ERR! stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)

This is blocking upgrading this repo to Node 20 in CI, and ultimately, dropping Node 18 from CI entirely, T343827.

Event Timeline

Change #1108399 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] Rollback wikimedia-portals-build to Node 18

https://gerrit.wikimedia.org/r/1108399

Change #1108399 merged by jenkins-bot:

[integration/config@master] Rollback wikimedia-portals-build to Node 18

https://gerrit.wikimedia.org/r/1108399

Change #1108401 had a related patch set uploaded (by Hashar; author: Hashar):

[integration/config@master] Use node18-test image for Node 18

https://gerrit.wikimedia.org/r/1108401

Change #1108401 merged by jenkins-bot:

[integration/config@master] Use node18-test image for Node 18

https://gerrit.wikimedia.org/r/1108401

Jdlrobson changed the task status from Open to In Progress.Jan 6 2025, 6:39 PM
Jdlrobson triaged this task as Medium priority.
Jdlrobson-WMF set the point value for this task to 2.Jan 23 2025, 4:12 PM
Jdlrobson-WMF subscribed.

Per team estimation

Jdrewniak subscribed.
Jdlrobson-WMF changed the task status from In Progress to Open.Feb 19 2025, 12:23 AM
ovasileva subscribed.

Moving to the backlog due to other interrupt work

I’ve looked into it, and the build failure happens in the (deprecated) native module iltorb@2.4.5, which is used by brotli-size@0.1.0, which in turn is required by bundlesize@0.18.2 (and bundlesize is directly required in our package.json). brotli-size@3.0.0 dropped the dependency on iltorb, but bundlesize (of which we use the latest version) depends on exactly bundlesize@0.18.2.

Dropping bundlesize would make the project build on Node 20, but we do use this package, so I’m not sure what to do:

  • Drop it without replacement, and hope that we will still not ship too much client-side JavaScript?
  • Use some replacement? Is there any? https://github.com/siddharthkp/bundlesize doesn’t list any, but neither does it admit that it’s abandonware (even though it looks much like that – it hasn’t updated to brotli-size@3.0.0, which was released six years ago). What do we use in MediaWiki, skins and extensions?
  • Somehow force using brotli-size@3.0.0 (or newer) instead of what bundlesize requires? I’m not sure how risky that would be.
  • Stay on Node 18 forever?

Change #1138344 had a related patch set uploaded (by Jforrester; author: Jforrester):

[wikimedia/portals@master] build: Drop bundlesize, not compatible with Node 20+

https://gerrit.wikimedia.org/r/1138344

Change #1138345 had a related patch set uploaded (by Jforrester; author: Jforrester):

[wikimedia/portals@master] build: Raise Node version to 20

https://gerrit.wikimedia.org/r/1138345

Change #1138344 merged by jenkins-bot:

[wikimedia/portals@master] build: Drop bundlesize, not compatible with Node 20+

https://gerrit.wikimedia.org/r/1138344

Change #1138345 merged by jenkins-bot:

[wikimedia/portals@master] build: Raise Node version to 20

https://gerrit.wikimedia.org/r/1138345

Change #1138375 had a related patch set uploaded (by Jforrester; author: Jforrester):

[integration/config@master] jjb: [wikimedia-portals-build] Switch to Node 20

https://gerrit.wikimedia.org/r/1138375

Change #1138376 had a related patch set uploaded (by Jforrester; author: Jforrester):

[integration/config@master] Zuul: [wikimedia/portals] Switch to Node 20

https://gerrit.wikimedia.org/r/1138376

Mentioned in SAL (#wikimedia-releng) [2025-04-23T14:25:53Z] <James_F> Zuul: [wikimedia/portals] Switch to Node 20, for T382179

Change #1138375 merged by jenkins-bot:

[integration/config@master] jjb: [wikimedia-portals-build] Switch to Node 20

https://gerrit.wikimedia.org/r/1138375

Change #1138376 merged by jenkins-bot:

[integration/config@master] Zuul: [wikimedia/portals] Switch to Node 20

https://gerrit.wikimedia.org/r/1138376

OK, I think this can be called Resolved. Leaving to the team for sign-off.

For posterity, there's upstream issue https://github.com/siddharthkp/bundlesize/issues/397. There's also a PR that updates brotli-size to 4.0.0, made in 2021 (!!!) and still open. AIUI, the author recommends using https://github.com/siddharthkp/bundlesize2 instead. But, the description for that project reads

Note: When this package is feature complete, it will be merged back into the original project as bundlesize@2.0.0

and this has been the case for the last 4 years. Nor do I know what prevented the one-liner package upgrade from being merged in the same time period.

Sic transit gloria mundi. ☹ I listed dropping without replacement halfheartedly, and I can only hope nothing bad will happen until T392519: Fix Portals bundlesize checker in CI is done.