Skip to content

Inline process.versions.bun in bun build --compile - #14940

Merged
Jarred-Sumner merged 2 commits into
mainfrom
jarred/process-versions-bun
Nov 1, 2024
Merged

Jarred-Sumner merged 2 commits into
mainfrom
jarred/process-versions-bun

Conversation

@Jarred-Sumner

@Jarred-Sumner Jarred-Sumner commented Nov 1, 2024 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

Inline process.versions.bun in bun build --compile

This makes detecting if the compiled executable is Bun more statically analyzable.

For example, tree-sitter has this line:

const binding = require("node-gyp-build")(__dirname);

This code is very difficult for bun build --compile to support.

Instead, they could do:

const binding = typeof process.versions.bun === "string" ?  
  require(`./prebuilds/${process.platform}-${process.arch}.node`) : 
  require("node-gyp-build")(__dirname);

This allows bun build --compile to work with it.

How did you verify your code works?

There is a test

@robobun

robobun commented Nov 1, 2024 •

Copy link
Copy Markdown
Collaborator

❌ @Jarred-Sumner, your commit 41969fe has 1 failures in #5555:

  • test/js/bun/http/serve.test.ts - 1 failing on 🍎 x64
  • Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Labels

    None yet

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    2 participants