kaaveland / eugene

Careful With that Lock, Eugene
MIT License
32 stars 1 forks source link

Can we notarize / sign binaries for macos? #48

Open kaaveland opened 5 months ago

kaaveland commented 5 months ago

The binaries we upload to github right now aren't possible to run on macos without first jumping through hoops and taking them out of quarantine. Maybe there's something we can do with our build or packaging to make that problem go away?

kaaveland commented 5 months ago

Maybe we could do that, and get cargo binstall, mise or brew to work on macos? 🤔

elisabethirgens commented 4 months ago

I have succeeded in jumping though hoops, and can now run eugene help 🎉

But I am not entirely sure if I used the hoops I was supposed to. Or if I found different hoops?! Here’s what I did on my Mac with M1:


I couldn’t get either of these to do what I expected

cargo install

cargo install eugene

fails to buils with a error: failed to compile eugene v0.6.0

but I think this is what you’re describing in this issue?

removing the quarantine attribute

When downloading the binary, I couldn’t get this to fly:

xattr -d com.apple.quarantine eugene

The output I got was:

xattr: No such file: eugene

Which I now kinda understand is probably because I had a eugene-aarch64-apple-darwin and not a eugene. Perhaps I am supposed to rename the downloaded binary? 🤔🤯

kaaveland commented 4 months ago

Yes, those are different hoops for the same thing! I think we should be able to make cargo install work. Any chance you can figure out some more details of why it fails? Have you tried upgrading cargo to the latest version (f ex with rustup)?

kaaveland commented 4 months ago

And yeah, you can rename that file to eugene and put it anywhere on PATH. Maybe that would be more obvious if the download was an archive named eugene-aarch64-apple-darwin that just contained the executable within?

elisabethirgens commented 4 months ago

Wheee, now that I play around again with alternative hoops, it’s already seems obvious to me that it’s my job to name the binary when I download the file from releases. The browser actually asks me for a name when I save the link. And even if I just hit enter and then get the eugene-aarch64-apple-darwin name, it probably would have made sense to move the file with something like sudo mv eugene-aarch64-apple-darwin /usr/local/bin/eugene instead of preserving the full release name. Yes, this is one of those things that suddenly now is obvious even though I confused myself at first. TIL 🎓

elisabethirgens commented 4 months ago

About cargo install! I misunderstood, because I thought cargo install failing on macos was an expected bug, that this was what you were describing in https://github.com/kaaveland/eugene/issues/48#issuecomment-2118985975 So I didn‘t try too hard when I got an initial error — and went looking for hoops to jump though instead.

Now I tried cargo install eugene again and looked properly at the error. I needed to install cmake and now that I have done so with Homebrew, I can also cargo install eugene just fine 🥳

~ ᐅ which eugene
/Users/katla/.cargo/bin/eugene
~ ᐅ eugene -h
Careful with That Lock, Eugene

This was a fun and super useful detour! 🎓 (sry for hijacking the original issue 🤣)

kaaveland commented 4 months ago

I've been investigating the cargo install failure and I have made some discoveries. The dependency to pg_query brings a dependency to prost, which needs a C++ compiler and apparently libclang. I must've accidentally already had those installed on my machine, so I never noticed. On ubuntu, you need:

I'm guessing the same dependencies would be necessary on macos. I think you get clang with xcode-select --install and cmake with brew install cmake and nothing else should be necessary. 🤔

kaaveland commented 4 months ago

This is useful feedback on the documentation (and also releases) and I'm not too worried about the structure in the ticket system yet 😆