[Pkg-javascript-devel] Bug#1028404: nodejs: ftbfs on riscv64

Bo YU tsu.yubo at gmail.com
Tue Jan 10 15:56:48 GMT 2023


Source: nodejs
Version: 18.13.0+dfsg-1
Severity: important
Tags: ftbfs, patch
User: debian-riscv at lists.debian.org
Usertags: riscv64
X-Debbugs-Cc: debian-riscv at lists.debian.org

Dear Maintainer,

Although #1026065 was closed, but unfortunately the build still fails on riscv64 on
new release:

```
...
ar crsT /<<PKGBUILDDIR>>/out/Release/obj.target/tools/v8_gypfiles/libv8_compiler.a @/<<PKGBUILDDIR>>/out/Release/obj.target/tools/v8_gypfiles/libv8_compiler.a.ar-file-list
  g++-11 -o /<<PKGBUILDDIR>>/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/api/api-arguments.o ../deps/v8/src/api/api-arguments.cc '-D_GLIBCXX_USE_CXX11_ABI=1' '-DNODE_OPENSSL_CONF_NAME=nodejs_conf' '-DNODE_OPENSSL_CERT_STORE' '-DNODE_SHARED_BUILTIN_CJS_MODULE_LEXER_LEXER_PATH=/usr/share/nodejs/cjs-module-lexer/lexer.js' '-DNODE_SHARED_BUILTIN_CJS_MODULE_LEXER_DIST_LEXER_PATH=/usr/share/nodejs/cjs-module-lexer/dist/lexer.js' '-DNODE_SHARED_BUILTIN_UNDICI_UNDICI_PATH=/usr/share/nodejs/undici/undici-fetch.js' '-DNODE_SHARED_BUILTIN_ACORN_PATH=/usr/share/nodejs/acorn/dist/acorn.js' '-DNODE_SHARED_BUILTIN_ACORN_WALK_PATH=/usr/share/nodejs/acorn-walk/dist/walk.js' '-DV8_GYP_BUILD' '-DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64' '-D__STDC_FORMAT_MACROS' '-DV8_TARGET_ARCH_RISCV64' '-D__riscv_xlen=64' '-DCAN_USE_FPU_INSTRUCTIONS' '-DV8_HAVE_TARGET_OS' '-DV8_TARGET_OS_LINUX' '-DV8_EMBEDDER_STRING="-node.21"' '-DENABLE_DISASSEMBLER' '-DV8_PROMISE_INTERNAL_FIELD_COUNT=1' '-DOBJECT_PRINT' '-DV8_INTL_SUPPORT' '-DV8_ATOMIC_OBJECT_FIELD_WRITES' '-DV8_ENABLE_LAZY_SOURCE_POSITIONS' '-DV8_USE_SIPHASH' '-DV8_SHARED_RO_HEAP' '-DV8_WIN64_UNWINDING_INFO' '-DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH' '-DV8_ENABLE_WEBASSEMBLY' '-DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS' '-DV8_ALLOCATION_FOLDING' '-DV8_ALLOCATION_SITE_TRACKING' '-DV8_SCRIPTORMODULE_LEGACY_LIFETIME' '-DV8_ADVANCED_BIGINT_ALGORITHMS' '-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC' -I../deps/v8 -I../deps/v8/include -I/<<PKGBUILDDIR>>/out/Release/obj/gen/inspector-generated-output-root -I../deps/v8/third_party/inspector_protocol -I/<<PKGBUILDDIR>>/out/Release/obj/gen -I/<<PKGBUILDDIR>>/out/Release/obj/gen/generate-bytecode-output-root -I../deps/v8/third_party/zlib -I../deps/v8/third_party/zlib/google  -pthread -Wno-unused-parameter -fPIC -Wno-return-type -fno-strict-aliasing -O3 -fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -fno-rtti -fno-exceptions -std=gnu++17 -MMD -MF /<<PKGBUILDDIR>>/out/Release/.deps//<<PKGBUILDDIR>>/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/api/api-arguments.o.d.raw -fPIC -g -fPIC -g -fPIC -g -fPIC -g -fPIC -g -c
  touch /<<PKGBUILDDIR>>/out/Release/obj.target/tools/v8_gypfiles/v8_compiler_for_mksnapshot.stamp
rm -f /<<PKGBUILDDIR>>/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a ar-file-list; mkdir -p `dirname /<<PKGBUILDDIR>>/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a`
ar crsT /<<PKGBUILDDIR>>/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a @/<<PKGBUILDDIR>>/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a.ar-file-list
ar: /<<PKGBUILDDIR>>/out/Release/obj.target/v8_base_without_compiler/deps/v8/src/heap/base/asm/riscv/push_registers_asm.o: No such file or directory
make[3]: *** [tools/v8_gypfiles/v8_base_without_compiler.target.mk:1057: /<<PKGBUILDDIR>>/out/Release/obj.target/tools/v8_gypfiles/libv8_base_without_compiler.a] Error 1
rm eee8578ecd823158ee12ab47c0d976248710b8f6.intermediate 2c15f5d9778bb7d3c456b64354e5e794102f5a4d.intermediate
```

The root cause maybe here:
https://github.com/nodejs/node/pull/45149/files

But 18.13 branch still contains old code path:
https://github.com/nodejs/node/tree/v18.x-staging/deps/v8/src/heap/base/asm/riscv64

The fix is easy and I tested it on my local machine(qemu). Please apply
the patch attached in next upload.

If I understand correctly, the nodejs build failed since 18.10.0 on
riscv64 so no nodejs package(>18.10.0) on unstable. This caused some
dependency issues like node-esrecurse[0] on debci:

[0]: https://ci.debian.net/packages/n/node-esrecurse/unstable/riscv64/

-- 
Regards,
--
  Bo YU

-------------- next part --------------
diff -Nru nodejs-18.13.0+dfsg/debian/changelog nodejs-18.13.0+dfsg/debian/changelog
--- nodejs-18.13.0+dfsg/debian/changelog	2023-01-07 04:15:20.000000000 +0800
+++ nodejs-18.13.0+dfsg/debian/changelog	2023-01-10 18:41:53.000000000 +0800
@@ -1,3 +1,10 @@
+nodejs (18.13.0+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix ftbfs on riscv64. (Closes: #-1)
+
+ -- Bo YU <tsu.yubo at gmail.com>  Tue, 10 Jan 2023 18:41:53 +0800
+
 nodejs (18.13.0+dfsg-1) unstable; urgency=medium
 
   * New upstream version 18.13.0+dfsg
diff -Nru nodejs-18.13.0+dfsg/debian/patches/fix-ftbfs-riscv64-18-13-0.patch nodejs-18.13.0+dfsg/debian/patches/fix-ftbfs-riscv64-18-13-0.patch
--- nodejs-18.13.0+dfsg/debian/patches/fix-ftbfs-riscv64-18-13-0.patch	1970-01-01 07:30:00.000000000 +0730
+++ nodejs-18.13.0+dfsg/debian/patches/fix-ftbfs-riscv64-18-13-0.patch	2023-01-10 18:41:11.000000000 +0800
@@ -0,0 +1,11 @@
+--- a/tools/v8_gypfiles/v8.gyp
++++ b/tools/v8_gypfiles/v8.gyp
+@@ -1646,7 +1646,7 @@
+               }],
+               ['_toolset == "host" and host_arch == "riscv64" or _toolset == "target" and target_arch=="riscv64"', {
+                 'sources': [
+-                  '<(V8_ROOT)/src/heap/base/asm/riscv/push_registers_asm.cc',
++                  '<(V8_ROOT)/src/heap/base/asm/riscv64/push_registers_asm.cc',
+                 ],
+               }],
+               ['_toolset == "host" and host_arch == "loong64" or _toolset == "target" and target_arch=="loong64"', {
diff -Nru nodejs-18.13.0+dfsg/debian/patches/riscv/fix-ftbfs-riscv64-18-13-0.patch nodejs-18.13.0+dfsg/debian/patches/riscv/fix-ftbfs-riscv64-18-13-0.patch
--- nodejs-18.13.0+dfsg/debian/patches/riscv/fix-ftbfs-riscv64-18-13-0.patch	1970-01-01 07:30:00.000000000 +0730
+++ nodejs-18.13.0+dfsg/debian/patches/riscv/fix-ftbfs-riscv64-18-13-0.patch	2023-01-10 18:41:25.000000000 +0800
@@ -0,0 +1,11 @@
+--- a/tools/v8_gypfiles/v8.gyp
++++ b/tools/v8_gypfiles/v8.gyp
+@@ -1646,7 +1646,7 @@
+               }],
+               ['_toolset == "host" and host_arch == "riscv64" or _toolset == "target" and target_arch=="riscv64"', {
+                 'sources': [
+-                  '<(V8_ROOT)/src/heap/base/asm/riscv/push_registers_asm.cc',
++                  '<(V8_ROOT)/src/heap/base/asm/riscv64/push_registers_asm.cc',
+                 ],
+               }],
+               ['_toolset == "host" and host_arch == "loong64" or _toolset == "target" and target_arch=="loong64"', {
diff -Nru nodejs-18.13.0+dfsg/debian/patches/series nodejs-18.13.0+dfsg/debian/patches/series
--- nodejs-18.13.0+dfsg/debian/patches/series	2023-01-06 21:44:33.000000000 +0800
+++ nodejs-18.13.0+dfsg/debian/patches/series	2023-01-10 18:41:43.000000000 +0800
@@ -17,6 +17,7 @@
 mips/mipsel_even_register_fix.patch
 build/skip-buffer-nan-internal-check.patch
 riscv/flaky_tests.patch
+riscv/fix-ftbfs-riscv64-18-13-0.patch
 armel/configure.patch
 build/openssl_related_test_issues.patch
 build/doc_template_home.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20230110/f126b136/attachment.sig>


More information about the Pkg-javascript-devel mailing list