-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Cannot code-sign compiled executable on macOS #7208
Comments
bun/src/StandaloneModuleGraph.zig Lines 1 to 3 in 9e91e13
👀 If it's possible to only incur the 350ms fixed build time increase when I pass in a |
I agree a flag would be amazing, currently can't ship bun desktop applications without signing |
@Electroid @Jarred-Sumner FWIW, Deno has landed support for codesigning Windows and macOS executables in denoland/deno#24604 and it is expected to land in Deno 1.46. |
cc @Jarred-Sumner - we cannot ship binaries to Mac ecosystem yet. |
We get:
The most we have by way of actual documentation from Apple is from Technical Note TN2206: macOS Code Signing In Depth.
|
ah, It's not just me, gotta try Deno I guess edit: Deno single executable was worse |
This is pretty much a hard requirement for us, and we'd happily take a 350ms hit on build time, especially if it can be toggled only for distribution builds. |
Btw, Bun team, if you can provide some guidance as to what you tried previously (as per your code comment) we could potentially contribute something along the lines of what @YoavCodes suggested. |
for what it's worth in the meantime while building https://www.electrobun.dev I implemented code signing on mac. but it essentially builds a mac application bundle (ie: folder) and code signs/notarizes your bundle which includes the bun binary and separate bundled js and other binaries. so creating an app bundle and code signing/notarizing that is a workaround for distributing a "single" code signed thing. but it'd be nice to be able to compile and sign/notarize a single binary for cli apps and terminal based utilities. |
That's interesting, thanks for sharing @YoavCodes! We'll take a closer look. But still agreed, I think the CLI tool use-case is broadly important for a tool like this. Bun does a lot of stuff super well, not least in the context of CLIs—faster startup times than alternatives and generally very smooth compilation+bundling, among other things—so it'd be a shame to get blocked on a last-mile thing like this. It'd be a bit difficult to work it out from scratch, but any notes on prior attempts from the Bun team would be great to help others contribute. Btw I'd also argue that a fixed 350ms cost is not exactly terrible for binary builds, since a lot of rapid iteration happens without those. At any rate an option to make the binary signable at the expense of marginally slower build time would make a lot of sense. |
Hey guys, just as an update, I’ve talked to Jared about this a few times and everyone is on some page that we gotta be able to sign binaries. build —binary currently breaks whatever metadata block and that’s why it doesn’t work. I expect within a few versions this will be fixed. @YoavCodes I was looking into that, do you have any links or notes on distributing the codesigned app folder? The simplest form is actually just |
Can take a look at the I'm just a guy building an Electron alternative so the code is a bit messy and I probably went further than you'll want to but essentially for distribution it's:
Notes:
|
I am running into the same problem as the author of this issue when signing compiled executables on macos |
I'm running into the same issue on v1.1.37 |
@YoavCodes You are a god damn genius. @Jarred-Sumner have you seen this? |
What version of Bun is running?
1.0.13+f5bf67bd1
What platform is your computer?
Darwin 23.1.0 arm64 arm
What steps can reproduce the bug?
Build a compiled executable by following https://bun.sh/docs/bundler/executables
Create a self-signed certificate with code-signing capabilities by following https://support.apple.com/en-in/guide/keychain-access/kyca8916/mac
Attempt to code-sign the compiled executable with the command –
See the error –
What is the expected behavior?
The executable should be code-signed correctly and runnable on the system without Gatekeeper blocks/prompts.
What do you see instead?
Additional information
FWIW, Deno's compiled binaries face the same issue (although I'm not sure if the root cause is the same) – see denoland/deno#575 and denoland/deno#17753
The text was updated successfully, but these errors were encountered: