nodejs / unofficial-builds

Unofficial binaries for Node.js
https://unofficial-builds.nodejs.org
221 stars 45 forks source link

`riscv64` build failed for `v20.11.0` #106

Open ehoogeveen-medweb opened 5 months ago

ehoogeveen-medweb commented 5 months ago

I noticed that v20.11.0 isn't listed as an LTS build in index.json. That's probably because the riscv64 build failed, since it means not all platforms would be able to update. I don't use the riscv64 build myself, but our automation looks for the latest LTS and that means it's still stuck on v20.10.0 :)

Build log: https://unofficial-builds.nodejs.org/logs/202401101543-v20.11.0/riscv64.log

The errors look like this:

In file included from ../deps/v8/src/codegen/assembler-arch.h:27,
                 from ../deps/v8/src/wasm/baseline/liftoff-assembler-defs.h:8,
                 from ../deps/v8/src/execution/riscv/frame-constants-riscv.h:11,
                 from ../deps/v8/src/execution/frame-constants.h:426,
                 from ../deps/v8/src/builtins/builtins-utils.h:11,
                 from ../deps/v8/src/api/api-arguments.h:9,
                 from ../deps/v8/src/ic/call-optimization.h:8,
                 from ../deps/v8/src/compiler/heap-refs.h:11,
                 from ../deps/v8/src/compiler/types.h:10,
                 from ../deps/v8/src/compiler/node.h:12,
                 from ../deps/v8/src/compiler/all-nodes.h:8,
                 from ../deps/v8/src/compiler/all-nodes.cc:5:
../deps/v8/src/codegen/riscv/assembler-riscv.h:289:60: error: 'Tagged' has not been declared
  289 |                                                            Tagged<Code> code,
      |                                                            ^~~~~~
../deps/v8/src/codegen/riscv/assembler-riscv.h:289:66: error: expected ',' or '...' before '<' token
  289 |                                                            Tagged<Code> code,
      |                                                                  ^
make[2]: *** [tools/v8_gypfiles/v8_compiler.target.mk:297: /home/node/node-v20.11.0/out/Release/obj.target/v8_compiler/deps/v8/src/compiler/all-nodes.o] Error 1

There are some other errors, but I think they're all a consequence of the above.

Unfortunately I don't know where to go to fix it, where to go to submit a fix or how to test it even if I did, so I hope someone else can have a look!

richardlau commented 5 months ago

This should be fixed now.

From logs/202401101543-v20.11.0/build.log we can see we had some ECONNRESET errors trying to read from GitHub while running the indexer:

+ npx nodejs-dist-indexer --dist /home/nodejs/download/release --indexjson /home/nodejs/download/release/index.json --indextab /home/nodejs/download/release/index.tab
npx: installed 27 in 5.263s
Ignoring directory "v19.8.0" (can't decode dir contents)
Ignoring directory "lost+found" (can't decode ref)
{ Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }
(ignoring error fetching V8 version for node/v20.11.0)
{ Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }
(ignoring error fetching uv version for node/v20.11.0)
{ Error: Client network socket disconnected before secure TLS connection was established
    at TLSSocket.onConnectEnd (_tls_wrap.js:1125:19)
    at Object.onceWrapper (events.js:286:20)
    at TLSSocket.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  code: 'ECONNRESET',
  path: null,
  host: 'raw.githubusercontent.com',
  port: 443,
  localAddress: undefined }
(ignoring error fetching OpenSSL version for node/v20.11.0)
{ Error: Client network socket disconnected before secure TLS connection was established
    at TLSSocket.onConnectEnd (_tls_wrap.js:1125:19)
    at Object.onceWrapper (events.js:286:20)
    at TLSSocket.emit (events.js:203:15)
    at endReadableNT (_stream_readable.js:1145:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  code: 'ECONNRESET',
  path: null,
  host: 'raw.githubusercontent.com',
  port: 443,
  localAddress: undefined }
(ignoring error fetching LTS version for node/v20.11.0)
{ Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }
(ignoring error fetching modules version for node/v20.11.0)
{ Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:111:27) errno: 'ECONNRESET', code: 'ECONNRESET', syscall: 'read' }
(ignoring error fetching npm version for node/v20.11.0)
++ date
+ echo 'Finished build @ Wed Jan 10 20:39:15 UTC 2024'
Finished build @ Wed Jan 10 20:39:15 UTC 2024

I've removed the v20.11.0 entries from .dist-indexer-version-cache on the machine and regenerated the index by rerunning:

npx nodejs-dist-indexer --dist /home/nodejs/download/release --indexjson /home/nodejs/download/release/index.json --indextab /home/nodejs/download/release/index.tab
richardlau commented 5 months ago

This should be fixed now.

To clarify -- the missing "LTS" status has been fixed.

The riscv build failure is unrelated. cc @nodejs/platform-riscv64

ehoogeveen-medweb commented 5 months ago

Thanks! If I understand correctly, the build failure still needs a look, so I'll leave this open for now.

sxa commented 5 months ago

Hmmm I wonder if something has happened between those two versions which means the version of the cross-compiler is no longer suitable for building.

sxa commented 5 months ago

Noting that the master build of v22.0.0 builds ok with the latest (native) compiler on Ubuntu when I build on a real board which would certainly indicate that an older cross-compiler may be the cause of this.

targos commented 5 months ago

I think that's because https://github.com/nodejs/node/pull/50552 was not identified as applying to v21 only.

kxxt commented 5 months ago

I think that's because nodejs/node#50552 was not identified as applying to v21 only.

Yes, it shouldn't be applied to v20.

kxxt commented 5 months ago

I opened a revert PR: https://github.com/nodejs/node/pull/51495

tuler commented 3 months ago

indicate that an older cross-compiler may be the cause of this.

We have a fork that builds with Ubuntu 22.04 cross-compiler. Last one we built was Node.js 20.9.0. I'm not sure it builds 20.11.0. This is basically the change https://github.com/cartesi/unofficial-builds/commit/c25b43a63c11e38a4ed03b03d97b4fb3bf95bf25

We'd love to see this change upstream.

richardlau commented 2 months ago

I opened a revert PR: nodejs/node#51495

The revert was included in Node.js 20.12.0.

tuler commented 1 month ago

Build of v22.1.0 is still failing

/usr/bin/ld: /home/node/node-v22.1.0/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/api/api.o: in function `v8::TryHandleWebAssemblyTrapPosix(int, siginfo_t*, void*)':
api.cc:(.text._ZN2v829TryHandleWebAssemblyTrapPosixEiP9siginfo_tPv+0x5): undefined reference to `v8::internal::trap_handler::TryHandleSignal(int, siginfo_t*, void*)'
/usr/bin/ld: /home/node/node-v22.1.0/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/trap-handler/handler-outside.o: in function `v8::internal::trap_handler::EnableTrapHandler(bool)':
handler-outside.cc:(.text._ZN2v88internal12trap_handler17EnableTrapHandlerEb+0x2d): undefined reference to `v8::internal::trap_handler::RegisterDefaultTrapHandler()'
/usr/bin/ld: /home/node/node-v22.1.0/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/execution/riscv/simulator-riscv.o: in function `v8::internal::Simulator::ProbeMemory(unsigned long, unsigned long)':
simulator-riscv.cc:(.text._ZN2v88internal9Simulator11ProbeMemoryEmm+0x1e): undefined reference to `v8_internal_simulator_ProbeMemory'
/usr/bin/ld: /home/node/node-v22.1.0/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/execution/riscv/simulator-riscv.o: in function `v8::internal::Simulator::DecodeRVRAType()':
simulator-riscv.cc:(.text._ZN2v88internal9Simulator14DecodeRVRATypeEv+0x2d7): undefined reference to `v8_internal_simulator_ProbeMemory'
/usr/bin/ld: simulator-riscv.cc:(.text._ZN2v88internal9Simulator14DecodeRVRATypeEv+0x363): undefined reference to `v8_internal_simulator_ProbeMemory'
/usr/bin/ld: simulator-riscv.cc:(.text._ZN2v88internal9Simulator14DecodeRVRATypeEv+0xa41): undefined reference to `v8_internal_simulator_ProbeMemory'
/usr/bin/ld: simulator-riscv.cc:(.text._ZN2v88internal9Simulator14DecodeRVRATypeEv+0xc74): undefined reference to `v8_internal_simulator_ProbeMemory'
/usr/bin/ld: /home/node/node-v22.1.0/out/Release/obj.host/v8_base_without_compiler/deps/v8/src/execution/riscv/simulator-riscv.o:simulator-riscv.cc:(.text._ZN2v88internal9Simulator14DecodeRVRATypeEv+0x1409): more undefined references to `v8_internal_simulator_ProbeMemory' follow
collect2: error: ld returned 1 exit status

Is this a problem with v8?

ps: I'm trying to build with ubuntu 22.04 gcc-riscv64-linux-gnu.

richardlau commented 1 month ago

https://github.com/nodejs/node/issues/52678 -- may be fixed by https://github.com/nodejs/node/pull/52888.