[Pkg-javascript-devel] Bug#1054259: Bug#1054259: nodejs: cannot bootstrap nodejs

2023-10-20 Thread Jérémy Lal
Le ven. 20 oct. 2023 à 10:33, Christopher Obbard 
a écrit :

> Control: retitle -1 nodejs: cannot bootstrap nodejs
>
> Hi Jérémy,
>
> On Fri, 2023-10-20 at 02:25 +0200, Jérémy Lal wrote:
> > https://salsa.debian.org/js-team/nodejs/-/blob/master-
> > 18.x/debian/README.source
>
> 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.
>

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).



>
> 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!
>
> > Le ven. 20 oct. 2023 à 01:27, Christopher Obbard
> >  a écrit :
> > > Source: nodejs
> > > Version: 18.13.0+dfsg1-1
> > > Severity: important
> > > X-Debbugs-Cc: chris.obb...@collabora.com
> > >
> > > 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!
> > >
> > > -- System Information:
> > > Debian Release: trixie/sid
> > >   APT prefers unstable
> > >   APT policy: (500, 'unstable'), (1, 'experimental')
> > > Architecture: amd64 (x86_64)
> > >
> > > Kernel: Linux 6.5.0-2-amd64 (SMP w/16 CPU threads; PREEMPT)
> > > Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8),
> > > LANGUAGE=en_GB:en
> > > Shell: /bin/sh linked to /usr/bin/dash
> > > Init: systemd (via /run/systemd/system)
> > > LSM: AppArmor: enabled
> > >
>
> Thanks!
>
> Chris
>
-- 
Pkg-javascript-devel mailing list
Pkg-javascript-devel@alioth-lists.debian.net
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-javascript-devel


[Pkg-javascript-devel] Bug#1054259: Bug#1054259: nodejs: cannot bootstrap nodejs

2023-10-20 Thread Christopher Obbard
Control: retitle -1 nodejs: cannot bootstrap nodejs

Hi Jérémy,

On Fri, 2023-10-20 at 02:25 +0200, Jérémy Lal wrote:
> https://salsa.debian.org/js-team/nodejs/-/blob/master-
> 18.x/debian/README.source

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!

> Le ven. 20 oct. 2023 à 01:27, Christopher Obbard
>  a écrit :
> > Source: nodejs
> > Version: 18.13.0+dfsg1-1
> > Severity: important
> > X-Debbugs-Cc: chris.obb...@collabora.com
> > 
> > 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!
> > 
> > -- System Information:
> > Debian Release: trixie/sid
> >   APT prefers unstable
> >   APT policy: (500, 'unstable'), (1, 'experimental')
> > Architecture: amd64 (x86_64)
> > 
> > Kernel: Linux 6.5.0-2-amd64 (SMP w/16 CPU threads; PREEMPT)
> > Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8),
> > LANGUAGE=en_GB:en
> > Shell: /bin/sh linked to /usr/bin/dash
> > Init: systemd (via /run/systemd/system)
> > LSM: AppArmor: enabled
> > 

Thanks!

Chris
From 8175c5f66df782c672df5b5a2a8d31eed915021b Mon Sep 17 00:00:00 2001
From: Christopher Obbard 
Date: Thu, 19 Oct 2023 14:38:26 +0100
Subject: [PATCH 1/9] Set build profiles to bootstrap nodejs

Signed-off-by: Christopher Obbard 
---
 debian/control | 74 +-
 debian/rules   |  2 ++
 2 files changed, 39 insertions(+), 37 deletions(-)

diff --git a/debian/control b/debian/control
index d1966836..4f12726c 100644
--- a/debian/control
+++ b/debian/control
@@ -6,13 +6,13 @@ Uploaders: Jérémy Lal ,
  Jonas Smedegaard 
 Build-Depends:
  gcc-11, g++-11,
- sse2-support [i386] ,
- armv6k-support [armel] , vfpv2-support [armel] ,
+# sse2-support [i386] ,
+# armv6k-support [armel] , vfpv2-support [armel] ,
  debhelper-compat (= 13),
  dh-buildinfo,
  bash-completion,
  ca-certificates,
- curl ,
+# curl ,
  gyp (>= 0.1~svn1773),
  jq,
  libbrotli-dev,
@@ -29,21 +29,21 @@ Build-Depends:
  libssl-dev:native,
  libuv1-dev (>= 1.43.0~),
  libuv1-dev:native,
- node-acorn (>= 6.2.1~) ,
- node-cjs-module-lexer (>= 1.2.2~) ,
- node-undici (>= 5.0.0~) ,
- openssl (>= 1.1.1~) ,
+# node-acorn (>= 6.2.1~) ,
+# node-cjs-module-lexer (>= 1.2.2~) ,
+# node-undici (>= 5.0.0~) ,
+# openssl (>= 1.1.1~) ,
  pkg-config,
- pkg-js-tools (>= 0.8.2~) ,
+# pkg-js-tools (>= 0.8.2~) ,
  python3:native,
  python3-distutils,
- procps ,
+# procps ,
  zlib1g-dev,
  zlib1g-dev:native,
 Build-Depends-Indep:
- node-js-yaml (>= 4.1.0+dfsg+~4.0.5-6) ,
- node-marked (>= 4~) ,
- node-highlight.js ,
+# node-js-yaml (>= 4.1.0+dfsg+~4.0.5-6) ,
+# node-marked (>= 4~) ,
+# node-highlight.js ,
 Standards-Version: 4.6.1.0
 Homepage: https://nodejs.org/
 Vcs-Browser: https://salsa.debian.org/js-team/nodejs/tree