#1054259 nodejs: cannot bootstrapped nodejs

#1054259#5
Date:
2023-10-19 23:21:49 UTC
From:
To:
Dear Maintainer,

Bootstrapping nodejs version 18 FTBFS for me. There seems to be a couple
of different issues when bootstrapping:

1) The created node binary fails with an error about the externalized
builtins not being found. This renders the binary useless. This also
causes an error in the bootstrap process, override_dh_auto_build-arch
fails with:

    Cannot load externalized builtin: "internal/deps/cjs-module-lexer/lexer:/usr/share/nodejs/cjs-module-lexer/lexer.js".
     1: 0x7f06454026cc node::Abort() [/mnt/_build/nodejs-18.13.0+dfsg1/out/Release/libnode.so.108]
     2: 0x7f06453e1f1d  [/mnt/_build/nodejs-18.13.0+dfsg1/out/Release/libnode.so.108]
     3: 0x7f06453e2069 node::builtins::BuiltinLoader::BuiltinLoader() [/mnt/_build/nodejs-18.13.0+dfsg1/out/Release/libnode.so.108]
     4: 0x7f064531db83  [/mnt/_build/nodejs-18.13.0+dfsg1/out/Release/libnode.so.108]
     5: 0x7f064782947e  [/lib64/ld-linux-x86-64.so.2]
     6: 0x7f0647829568  [/lib64/ld-linux-x86-64.so.2]
     7: 0x7f06478432ca  [/lib64/ld-linux-x86-64.so.2]
    Aborted (core dumped)


2) dh_install fails with:

    dh_install: warning: Cannot find (any matches for) "./<@(node_builtin_shareable_builtins)" (tried in ., debian/tmp)
    dh_install: warning: nodejs missing files: ./<@(node_builtin_shareable_builtins)
    dh_install: error: missing files, aborting


I have a couple of patches which works around these issues and can create
a bootstrapped nodejs (I can share my patches if that is useful); but the
created binary is useless due to the "Cannot load externalized builtin"
error.

Thanks!

#1054259#10
Date:
2023-10-20 00:25:43 UTC
From:
To:
https://salsa.debian.org/js-team/nodejs/-/blob/master-18.x/debian/README.source


Le ven. 20 oct. 2023 à 01:27, Christopher Obbard <chris.obbard@collabora.com>
a écrit :

#1054259#15
Date:
2023-10-20 08:31:08 UTC
From:
To:
Hi Jérémy,

Thanks for your suggestion. I actually did follow those instructions to
attempt to build nodejs 18.13.0+dfsg1-1.

For nodejs 16.15.1+dfsg-1 following those instructions bootstraps the package
just fine, I think because the "externalized builtin" JS files are present in
the packaging.

I have attached the three patches to debian/ to get _something_ bootstrap for
18x but it still fails with the error "Cannot load externalized builtin" when
trying to launch bootstrapped node.

I build the package using debuild --no-lintian in a chroot. In the build
system I have no ability to build arch:all packages, just architecture
dependant packages.

Thanks!

Thanks!

Chris

#1054259#22
Date:
2023-10-20 08:42:58 UTC
From:
To:
Le ven. 20 oct. 2023 à 10:33, Christopher Obbard <chris.obbard@collabora.com>
a écrit :

Maybe the README.source isn't clear enough.
The node package built at first stage is just good enough to build the
second stage.
It is not feature-complete. Typically you can't run node REPL with it.
Once you have first stage, you install the resulting deb, and use that as a
build-dependency
to build second stage (which is a normal build).

#1054259#27
Date:
2023-10-20 14:04:26 UTC
From:
To:
Quoting Jérémy Lal (2023-10-20 10:42:58)

Perhaps updating that text to point the the Debian wiki page on staged
builds would be a helpful hint.

(on weak internet right now, so haven't checked if that is already done)


 - Jonas

#1054259#32
Date:
2023-12-09 13:08:14 UTC
From:
To:
Le sam. 9 déc. 2023 à 04:12, Bo YU <tsu.yubo@gmail.com> a écrit :


Right, I overlooked those patches - because I only read the first one,
which was very wrong.
The actual fixes those patches were proposing are now applied.

However now I'm a bit worried that this is all in vain, because nodejs
unconditionally requires cjs-module-lexer,
so one cannot execute anything without it (that wasn't the case when only
acorn was an external builtin).

Jérémy