oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.15k stars 2.68k forks source link

Regression: Can no longer `bun install` @napi-rs/canvas on Vercel #8094

Open controversial opened 8 months ago

controversial commented 8 months ago

What version of Bun is running?

bun install v1.0.22 (b400b36c)

What platform is your computer?

Vercel

What steps can reproduce the bug?

bun install with @napi-rs/canvas in package.json

What is the expected behavior?

The package installs successfully, as it does on npm and on older versions of Bun

What do you see instead?

error: install script from "@napi-rs/canvas-linux-x64-musl" exited with 1
Error: Command "bun upgrade && bun install" exited with 1

Additional information

I changed the Vercel install command to bun upgrade && bun install in order to run bun install under Bun 1.0.22, so I have the fix from #8064.

However, the issue persists.

The install script for @napi-rs/canvas looks as follows:

// Node.js < v13.12.0, v12.17.0, ignore
// https://nodejs.org/api/process.html#processreport
if (!process.report || typeof process.report.getReport !== 'function') {
  process.exit(0)
}

// Only GNU system has this field
const { glibcVersionRuntime } = process.report.getReport().header

if (glibcVersionRuntime) {
  process.exit(1)
} else {
  process.exit(0)
}

Note npx bun@1.0.15 install works without issue. I suspect this regression was introduced in 1.0.17, because the install script did not run by default before this version.

It seems like Bun is selecting the wrong “native” package for @napi-rs/canvas such that the expectation in the install script (i.e. “glibcVersionRuntime should be undefined if the linux-x64-musl package is being installed”) is violated

See Discord discussion following this message

Jarred-Sumner commented 1 month ago

@controversial are you still running into this?

controversial commented 1 month ago

I don’t think so