oven-sh / bun

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

Running a compiled binary that includes a worker and a shared library asset doesn't work for Mac, works for Linux and Windows #11959

Open terrablue opened 4 months ago

terrablue commented 4 months ago

What version of Bun is running?

1.1.13+bd6a60512

What platform is your computer?

Linux 6.9.5-arch1-1 x86_64 unknown

What steps can reproduce the bug?

What is the expected behavior?

A webview window should open with the content hi.

What do you see instead?

Nothing happens.

Additional information

This is related to https://github.com/oven-sh/bun/issues/7901. Running a compiled binary which incorporates a worker and a shared library asset works for Linux and Windows, but not for Mac (x64).

For comparison with Linux and Windows, run npm run linux and npm run windows in the same repository and the executables linux/app on Linux and windows/app.exe on Windows. Both work as expected.

ralyodio commented 4 months ago

I'm also having this issue.

paperdave commented 4 months ago

Can you try using --target=bun-darwin-x64-baseline, I was able to cross compile for MacOS x64.

See the note about baseline on this page: https://bun.sh/docs/bundler/executables#cross-compile-to-other-platforms

github-actions[bot] commented 4 months ago

Hello @terrablue. Please provide a minimal reproduction using a GitHub repository, Replit, or CodeSandbox. Issues marked with needs repro will be closed if they have no activity within 3 days.

terrablue commented 4 months ago

Hi. I added the baseline variant to the repo, still doesn't work.

Please note that the problem isn't cross-compilation (as described in the original issue), it's about running the binary on MacOS x64. This doesn't work whether I compile the binary on Linux and copy it to a Mac computer or compile it directly on Mac.

terrablue commented 4 months ago

Hi @paperdave, were you able to reproduce the issue, is the problem clear now?