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

Binary generated from bun build --compile silently exiting #17031

Open
silverbucket opened this issue Feb 4, 2025 · 0 comments
Open

Binary generated from bun build --compile silently exiting #17031

silverbucket opened this issue Feb 4, 2025 · 0 comments
Labels
bug Something isn't working needs triage

Comments

@silverbucket
Copy link

silverbucket commented Feb 4, 2025

What version of Bun is running?

1.2.2+c1708ea6a

What platform is your computer?

Darwin 23.6.0 arm64 arm

What steps can reproduce the bug?

$ cat packages/sockethub/bin/sockethub
#!/usr/bin/env bun
import("@sockethub/server").then((sockethub) => {
    sockethub.server();
});

$ bun build ./packages/sockethub/bin/sockethub --compile --outfile sockethub
   [9ms]  bundle  1 modules
 [193ms] compile  sockethub

$ ls -alh sockethub
-rwxrwxrwx@ 1 njenning  staff    54M Feb  4 00:57 sockethub

$ time ./sockethub
./sockethub  0.01s user 0.01s system 77% cpu 0.020 total

$ echo $?
0

$ time DEBUG=* ./sockethub
DEBUG=* ./sockethub  0.01s user 0.02s system 2% cpu 1.038 total

$ echo $?
0

What is the expected behavior?

When I run packages/sockethub/bin/sockethub directly, it starts up the sockethub service, listening on port 10550

$ DEBUG=* ./packages/sockethub/bin/sockethub
  sockethub:server:bootstrap:config initializing config +0ms
...
  sockethub:server:listener sockethub listening on ws://localhost:10550 +11ms

What do you see instead?

Silent exit with no info

Additional information

You can try this out on my migration branch:
https://github.com/sockethub/sockethub/tree/switch-to-bun

$ git clone [email protected]:sockethub/sockethub.git
$ cd sockethub
$ git checkout switch-to-bun
$ bun install
$ bun run build
$ bun build ./packages/sockethub/bin/sockethub --compile --outfile sockethub
@silverbucket silverbucket added bug Something isn't working needs triage labels Feb 4, 2025
@silverbucket silverbucket changed the title bun build --compile silently exiting Binary generated from bun build --compile silently exiting Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

1 participant