pallotron / yubiswitch

OSX status bar application to enable/disable Yubikey Nano
Other
883 stars 65 forks source link

Release new binaries for Apple Silicon #106

Closed larstobi closed 2 years ago

larstobi commented 3 years ago

The last released binary is from 2015 and runs on Intel architecture. I now have an M1 laptop. It would be great if new binaries could be released. :-)

pallotron commented 2 years ago

hello, the code is accessible to the world, you can build your own binary with Xcode, I do not own a M1 laptop, and I don't want to pay 90EUR license to just build and sign the binary. :) I am probably getting a M1 laptop in January and I can try to do that but no guarantees :)

larstobi commented 2 years ago

Thanks, mate! I have tried building it with Xcode myself, but I have not been able to, even after spending some time. I completely agree with the license. Also, if you are able to cross compile in Xcode and publish here, it does not need to be signed, we can still allow unsigned binaries to run. I will try further to build it myself when I get some time.

ThomasWaldmann commented 2 years ago

Preferably new releases could be universal binaries, supporting both intel and apple silicon in a single binary.

reaperhulk commented 2 years ago

There are a few obstacles here for people who want to build it themselves:

1) The submodule for ShortcutRecorder points to a commit no longer available on GitHub. You can check out the submodule and switch to the 2.17.2 tag to work around this. 2) You'll need to update the code signing to point at your own certificates (free developer will work but you can't leave it unsigned) and then additionally modify the yubiswitch/yubiswitch-Info.plist and yubiswitch.helper/yubiswitch-helper-Info.plist to match on your certificate. Failure to properly do this will result in helper tool installation failure. 3) The resulting binary needs to be granted the accessibility permission under System Preferences -> Security & Privacy or else you will get tccd errors or IOHIDDeviceOpen will fail in the helper tool.

I've also fixed a few other things in my local branch, but I am not typically a macOS dev so it's not clear to me how you would make the project generic enough for users to do this on their own (or even set up GHA with the right certificates to be able to automatically build and release). That said, it can work and my personal copy is now a universal build.

reaperhulk commented 2 years ago

Oh, one other item I forgot to note: the new image assets for the menu item don't appear to scale properly. I'm not sure if this is because there hasn't been a release since they were upgraded a few years ago or if there's some unusual Xcode bug, but to make everything scale properly I had to rescale all the 1x images to 22px high, 2x to 44px, and 3x to 66px.

pallotron commented 2 years ago

I've also fixed a few other things in my local branch

@reaperhulk care to share the diff on a pastebin or something? I haven't been able to invest any time in this project in the last few years but I might have some time to look into all this in 2022 as I get a new M1 laptop.

reaperhulk commented 2 years ago

@pallotron I can push it to a fork so you can look at the diff at your leisure (here: https://github.com/pallotron/yubiswitch/compare/master...reaperhulk:updates?expand=1) Some of the things I've changed I'm not confident are fully correct, which is why I've hesitated to send a PR. 😄

ThomasWaldmann commented 2 years ago

For many FOSS projects, one can just do a PR. As long it is not ready or if one wants to avoid it getting merged too early, one can do a draft PR.

Doing that early is usually a good and comfortable way to get feedback and for the project maintainers it is much better to review a PR than stuff on pastebins or so.

larstobi commented 2 years ago

@pallotron Did you get your new M1 laptop? 😄

likethesky commented 2 years ago

@pallotron Did you get your new M1 laptop? 😄

Friendly ping, any chance to look over @reaperhulk 's PR and build new binaries on an M1?

pallotron commented 2 years ago

I did get it but I don't have much time. I will try to compile a new release when I am back from holidays (mid July)

davidrothera commented 2 years ago

This should now be fixed as of the latest release. Please comment if you are still having issues.

larstobi commented 2 years ago

Just tested it and it works just fine! Thanks!