Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support codesigning macOS executables in bun build --compile #15525

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Jarred-Sumner
Copy link
Collaborator

What does this PR do?

This does two things:

  1. Support codesigning macOS executables in bun build --compile
  2. Deletes the hack where we read the last 4096 bytes of the currently running executables itself to see if it ends with "-- Bun --\n" . We now add a __BUN,__bun section in the macho executable so all we need to do is a single pointer lookup to find out if the current executable is a standalone executable and to get the data. This will also reduce memory usage because we no longer need to do another memory allocation to read through the standalone executable's code.

Must TODO before merging:

  • Handle > 16 KB right now. It's something to do with the macho section offsetting/rewriting. I'm too sleepy to fix it right now.

How did you verify your code works?

@robobun
Copy link

robobun commented Dec 1, 2024

@Jarred-Sumner, your commit 7c034ac has 17 failures in #7145:

  • test/bundler/cli.test.ts - 2 failing on 🍎 14 x64
  • test/bundler/cli.test.ts - 2 failing on 🍎 13 x64
  • test/js/bun/http/bun-serve-static.test.ts - timeout on 🐧 3.20 x64-baseline
  • test/cli/install/registry/bun-install-registry.test.ts - timeout on 🐧 22.04 x64
  • test/cli/install/registry/bun-install-registry.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 12 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 22.04 x64-baseline
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 aarch64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 22.04 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 12 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64
  • test/js/node/test/parallel/fs-watch-recursive-linux-parallel-remove.test.js - 1 failing on 🐧 3.20 x64-baseline
  • test/js/node/test/parallel/worker-nested-uncaught.test.js - segmentation fault on 🐧 3.20 x64
  • test/js/node/test/parallel/worker-nested-uncaught.test.js - segmentation fault on 🐧 3.20 x64-baseline
  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64
  • test/integration/next-pages/test/dev-server.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 aarch64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64
  • test/js/node/child_process/child_process.test.ts - 1 failing on 🐧 3.20 x64-baseline
  • test/integration/next-pages/test/next-build.test.ts - 1 failing on 🐧 22.04 x64
  • test/cli/hot/hot.test.ts - timeout on 🐧 3.20 aarch64
  • test/cli/hot/hot.test.ts - timeout on 🐧 3.20 x64-baseline
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 aarch64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64
  • test/v8/v8.test.ts - 22 failing on 🐧 3.20 x64-baseline
  • test/js/bun/http/serve.test.ts - SIGTRAP on 🐧 3.20 aarch64
  • test/js/bun/http/serve.test.ts - SIGILL on 🐧 3.20 x64
  • test/js/bun/http/serve.test.ts - SIGILL on 🐧 3.20 x64-baseline
  • test/regression/issue/09041.test.ts - 1 failing on 🐧 20.04 x64-baseline
  • test/napi/napi.test.ts - 2 failing on 🍎 14 aarch64
  • test/napi/napi.test.ts - 2 failing on 🍎 13 aarch64
  • test/napi/napi.test.ts - 2 failing on 🍎 14 x64
  • test/napi/napi.test.ts - 2 failing on 🍎 13 x64
  • test/js/node/fs/fs.test.ts - 1 failing on 🍎 13 aarch64
  • test/js/node/fs/fs.test.ts - timeout on 🪟 2019 x64
  • test/js/third_party/body-parser/express-bun-build-compile.test.ts - 1 failing on 🍎 13 aarch64
  • test/js/third_party/body-parser/express-bun-build-compile.test.ts - 1 failing on 🍎 14 aarch64
  • test/js/third_party/body-parser/express-bun-build-compile.test.ts - 1 failing on 🍎 14 x64
  • test/js/third_party/body-parser/express-bun-build-compile.test.ts - 1 failing on 🍎 13 x64
  • test/integration/next-pages/test/next-build.test.ts - annotation error on 🍎 14 aarch64
  • test/bundler/bundler_compile.test.ts - 6 failing on 🍎 13 aarch64
  • test/bundler/bundler_compile.test.ts - 6 failing on 🍎 14 aarch64
  • test/bundler/bundler_compile.test.ts - 34 failing on 🍎 14 x64
  • test/bundler/bundler_compile.test.ts - 34 failing on 🍎 13 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