-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Related issue:
I’m not a Zig user, but I use Bun, which is built on top of Zig (and has recently upgraded to use Zig 0.14), to build applications that is packaged into a Docker image. However, in some environments it gets deployed to, the statx system call caused the application to crash when a file is read. Following is the strace line:
statx(12, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_TYPE|STATX_MODE|STATX_ATIME|STATX_MTIME|STATX_CTIME, 0x7fff8f276b30) = -1 ENOSYS (Function not implemented)
According to issue #23153, Zig requires kernel v4.19+. However, the environment in question is running on kernel version 6.1.0, yet we face the same issue.
This issue seems to be widespread in the Bun community:
- Unexpected reading oven-sh/bun#17629
- Cannot start docker TBosak/mkfd#14
- error: Unexpected reading oven-sh/bun#18823
- failure to build oven-sh/bun#18746
- Cannot Install Prisma on Bun Docker Image v1.2.3+ oven-sh/bun#18495
- With Docker : Error Unexpected reading "/app/src/index.tsx" C4illin/ConvertX#235
- v.1.2.2 is OK with Synology but not v.1.2.3 or 1.2.4 oven-sh/bun#18036
…when the application image is deployed into envionments where developers cannot control the kernel, such as:
- NAS devices stuck with an older kernel
- PaaS services running an older kernel
- Old servers running an old kernel
Our current workaround is to revert back to using an older version of Bun built on top of Zig 0.13, but that means we are stuck with an older Bun runtime for the time being. I reported this issue to the Bun project, and for the time being Bun team intends to patch Zig’s stdlib in their fork.
However, this issue may affect other non-Bun Zig users, so I am filing an issue here as well. It would also be great if we can arrive at a solution where Bun can use Zig without much patching on their side.
Alternatively, is there any way to disable the use of this system call?