node icon indicating copy to clipboard operation
node copied to clipboard

Node 22 node-gyp build fails "Text file busy"

Open kode54 opened this issue 1 month ago • 12 comments

Version

v22.0.0

Platform

Linux laharl 6.9.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 17 May 2024 16:56:38 +0000 x86_64 GNU/Linux

Subsystem

node-gyp

What steps will reproduce the bug?

  1. Attempted to build thelounge from AUR package
  2. sqlite3 submodule fails with two "/usr/bin/env: 'node': Text file busy" errors

How often does it reproduce? Is there a required condition?

It happens every time. It appears to be a race condition with io_uring with kernel 6.9.x on x86_64.

What is the expected behavior? Why is that the expected behavior?

The packages should build properly.

What do you see instead?

Two of the node-gyp build steps fail:

/usr/bin/env: 'node': Text file busy
/usr/bin/env: 'node': Text file busy

Additional information

I am re-reporting this issue because it does not involve use of Docker. Currently, thelounge package has added a workaround to disable io_uring in libuv to allow the build to pass.

Edit 1: Related bug reports have suggested this is only a problem because Arch builds nodejs against the system libuv, which it configures with the defaults, which enable io_uring support.

A kernel fix is slated for 6.9.2 that will likely work around the errors, but will not work around Arch or other distributions which have not disabled io_uring support in libuv like node has for security reasons. However, I am not sure how much of a threat model the io_uring support is, considering it's probably not that wise to be running node suid/sgid in the first place.

kode54 avatar May 18 '24 21:05 kode54