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

Apple Silicon support #27

Open
tthkbw opened this issue Dec 15, 2020 · 7 comments
Open

Apple Silicon support #27

tthkbw opened this issue Dec 15, 2020 · 7 comments

Comments

@tthkbw
Copy link

tthkbw commented Dec 15, 2020

This is the only Alfred workflow I use daily that doesn't work on Big Sur on my M1 Mac mini.

When run and watching status in the Alfred Debugger, I get a segmentation fault in "Alfred-maestro":

[08:15:58.863] Alfred Maestro[Script Filter] Queuing argument ''
[08:15:58.953] Alfred Maestro[Script Filter] Script with argv '' finished
[08:15:58.957] ERROR: Alfred Maestro[Script Filter] Code 139: /Users/tbrown/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/88A3D907-9F16-491E-86A7-634FC4ACA163: line 1: 39585 Segmentation fault: 11 ./alfred-maestro "$1"
[08:16:10.713] Logging Stopped.
[08:24:56.025] Logging Started...
[08:25:06.217] Alfred Maestro[Script Filter] Queuing argument ''
[08:25:06.309] Alfred Maestro[Script Filter] Script with argv '' finished
[08:25:06.314] ERROR: Alfred Maestro[Script Filter] Code 139: /Users/tbrown/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/8B2B22BA-40FB-48C3-9048-C3A4CE2D8A37: line 1: 40663 Segmentation fault: 11 ./alfred-maestro "$1"
[08:25:07.546] Alfred Maestro[Script Filter] Queuing argument 'd'
[08:25:07.667] Alfred Maestro[Script Filter] Script with argv 'd' finished
[08:25:07.674] ERROR: Alfred Maestro[Script Filter] Code 139: /Users/tbrown/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/8B2B22BA-40FB-48C3-9048-C3A4CE2D8A37: line 1: 40665 Segmentation fault: 11 ./alfred-maestro "$1"

Since Alfred-maestro is an x86 executable, this is running under Rosetta. I have just upgraded to macOS 11.1, which purports to have some upgrades to Rosetta, but it still doesn't work. If I run Alfred-maestro from the command line using arch -x86_64 ./alfred_maestro in Terminal I also get a segmentation fault.

The scripts in the workflow directory work properly and find my Keyboard Maestro macros.

Any help or suggestions?

@iansinnott
Copy link
Owner

Hey @tthkbw did you ever get this working? I realize this is a very late response, but wanted to see if anything came of this.

I'm not sure about the other maintainers, but I do not have apple silicon hardware to test on. My impression was that the binary would simply run as expected via Rosetta emulation.

@tthkbw
Copy link
Author

tthkbw commented Sep 1, 2021

No, I did not. I just tried using it again (now on macOS 11.5.2, still with M1 Mac mini). The error is the same as described in my previous post.

As I recall, I didn't try to go through building this workflow myself as it requires Go (I think) and setting all of that up on an M1 machine back then seemed difficult.

I replaced this workflow with on of my own which seems to work quite well. My workflow uses the same keyword 'km' and then calls the following apple script to get a list of Keyboard Maestro macros:

-- ignoring application responses
tell application "Keyboard Maestro Engine"
	do script "478B5E58-3085-401D-AF42-B2853C817013"
	-- or: do script "Trigger Macro by Name"
	-- or: do script "478B5E58-3085-401D-AF42-B2853C817013" with parameter "Whatever"
end tell
-- end ignoring

I'm not sure where I got that script--but I didn't write it myself.

@tthkbw
Copy link
Author

tthkbw commented Sep 1, 2021

Actually I guess all my apple script does is call a KM macro I wrote that lists all the enable macros. I probably got the form of the apple script off the miasma that is the internet and so I did, sort of, write it.

@tthkbw
Copy link
Author

tthkbw commented Sep 1, 2021 via email

@iansinnott
Copy link
Owner

Ah, damn, well I'm glad to hear you got something working. I wonder if this is an issue with Go, and not with the workflow per se. We migrated to Go well before M1 was available, and Go has undergone quite a bit of change since then.

If you ever feel like giving it another shot it might be fairly quick to compile it locally, assuming you already have brew installed:

brew install go && go build

Of course I didn't run this on an M1 so it might also break. In any event if you continue hacking on your own script maybe the AppleScripts we use here could be of some assistance: https://github.com/iansinnott/alfred-maestro/blob/master/workflow/get_all_km_macros.scpt

@iansinnott
Copy link
Owner

I can confirm this does work on Apple Silicon when compiled on your machine. Unfortunately this is not a very approachable solution for everyone, but it does work on recent apple hardware.

git clone https://github.com/iansinnott/alfred-maestro
cd alfred-maestro
brew install go # In case you don't already have it installed
make pack

At this point the workflow should be in the directory and you can double click it to add it to Alfred.

@davidawad
Copy link

davidawad commented Jan 31, 2022

Tremendous, thanks @iansinnott this was my issue as well when trying to use alfred + km on my M1 mac.
Recompiling the workflow on my machine also worked for me.
Thanks for the awesome tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants