google / wireit

Wireit upgrades your npm/pnpm/yarn scripts to make them smarter and more efficient.
Apache License 2.0
5.4k stars 95 forks source link

[Feature Request] Support Bun #1002

Open evelant opened 8 months ago

evelant commented 8 months ago

Wireit doesn't currently work when using Bun as a package manager. It usually just hangs with

Wireit could not identify the npm user agent, assuming it behaves like npm. Arguments may not be interpreted correctly.
Waiting for another process which is already running this script
rictic commented 8 months ago

There's two parts to this, one is supporting bun as a script runner, and the other is supporting the bun runtime. The first part is pretty quick and easy, though there was one issue where we can't always unambiguously parse args: https://github.com/oven-sh/bun/issues/4462

When I first tried out getting the bun runtime to work, shortly after it hit 1.0 I hit a number of segfaults. Wireit makes aggressive use of filesystem monitoring APIs, so I suspect the root cause is there, but I haven't yet dug deeper.