spamwax / alfred-pinboard-rs

Alfred Workflow for Pinboard (Rust)
Other
278 stars 13 forks source link

Using Rusty Pin on multiple machines. #77

Closed JakWolf closed 2 years ago

JakWolf commented 4 years ago

Hello, i really enjoy this workflow. The only issue i have is that i can't use the same Pinbord account on both of my Mac Machines for this workflow...is this a known limitation or is it a bug?

Thanks!

spamwax commented 4 years ago

I don't think this is a known issue. so you have two macOS machines and when you use workflow on one of them you get an error? can post more info please?

JakWolf commented 4 years ago

Thanks for the fast response!

The workflow itself works fine, the problem arises when i want to connect both workflow installations to the same Pinboard account with the pa command. I then get a "Couldn't get user credential!" message. It doesn't dipend on the machine i'm on, it always happens to the second machine that i want to conncet this workflow to pinboard to. I already tried to reset the pinboaed token several times.

spamwax commented 4 years ago

is it "couldn't get" or "couldn't set"?

JakWolf commented 4 years ago

Oh, i'm sorry, it say's "couldn't set".

spamwax commented 4 years ago

on the machine with issue, can you run the following command in Terminal and see what you get? make sure to replace your api token

curl https://api.pinboard.in/v1/posts/all\?format\=json\&auth_token\=your_username:api_token > bookmarks.json
JakWolf commented 4 years ago

I get the following output:

username:(MyAPiToken) > bookmarks.json

% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

Mercurius-Lee commented 4 years ago

I also installed it on 2 machines' alfred 4 , and updated to 0.15.15. One is ok (catalina) , another(10.12) is failed to update image image

spamwax commented 4 years ago

the curl screenshot is from the 10.12 computer? it seems the curl is working, right?

encima commented 3 years ago

Could this be an issue with credentials syncing if alfred preferences are in iCloud?

spamwax commented 3 years ago

I am not sure, user API key is stored under Library folder. Unless you are syncing that I cannot see how iCloud is affecting this

arrelid commented 2 years ago

Hi there,

I might have some pointers re. this one.

Navigating to your workflow folder in my terminal and executing alfred-pinboard-rs, I get the following error:

➤ ./alfred-pinboard-rs 
Failed to execute process './alfred-pinboard-rs'. Reason:
exec: Bad CPU type in executable

My MBP has got the new M1x chipset, so I'm assuming your workflow would need to be rebuilt so that the binary contains executables for all recent architectures, i.e. x86_64 and arm64 - maybe not PPC... ;)

➤ file alfred-pinboard-rs
alfred-pinboard-rs: Mach-O 64-bit executable x86_64

Invoking the same command for e.g. Alfred.app itself, I can see that it contains two executables:

➤ file Alfred 
Alfred: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64]
Alfred (for architecture x86_64):   Mach-O 64-bit executable x86_64
Alfred (for architecture arm64):    Mach-O 64-bit executable arm64

My macOS development skills are a bit rusty but there should be plenty of guides out there outlining how you configure your project/compiler so that you end up with universal binaries. Let me know if you should get stuck.

Also: happy/eager to test a new version!

spamwax commented 2 years ago

Thanks for the report. I need to set my rustc to create universal binaries, which may take some time as I am busy. On the other hand, my current system is getting old, I should start thinking about finding some money to buy a Mac mini or arm based apple

On Tue, Nov 9, 2021, 5:38 PM Mattias Arrelid @.***> wrote:

Hi there,

I might have some pointers re. this one.

  • I got the same error message when trying to set my (Pinboard) credentials in Alfred on my new MBP after doing a fresh install of Alfred + plugins today.
  • Executing your curl snippet above (with my API token) --> I end up with a dump of my bookmarks --> auth seems to work

Navigating to your workflow folder in my terminal and executing alfred-pinboard-rs, I get the following error:

➤ ./alfred-pinboard-rs

Failed to execute process './alfred-pinboard-rs'. Reason:

exec: Bad CPU type in executable

My MBP has got the new M1x chipset, so I'm assuming your workflow would need to be rebuilt so that the binary contains executables for all recent architectures, i.e. x86_64 and arm64 - maybe not PPC... ;)

➤ file alfred-pinboard-rs

alfred-pinboard-rs: Mach-O 64-bit executable x86_64

Invoking the same command for e.g. Alfred.app itself, I can see that it contains two executables:

➤ file Alfred

Alfred: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64]

Alfred (for architecture x86_64): Mach-O 64-bit executable x86_64

Alfred (for architecture arm64): Mach-O 64-bit executable arm64

My macOS development skills are a bit rusty but there should be plenty of guides out there outlining how you configure your project/compiler so that you end up with universal binaries. Let me know if you should get stuck.

Also: happy/eager to test a new version!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/spamwax/alfred-pinboard-rs/issues/77#issuecomment-964609985, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJRPINW7O2TIBTEWKBLJGLULGPFBANCNFSM4NRWT3PA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

spamwax commented 2 years ago

The only CI platform that seems to be offering reliable cross compilation to Apple M1 is github and I am not even sure if I can test/run the compiled binary on their VMs. The workflow seems to be to create two binaries for each architect and then combine them using lipo to create a fat binary. Just curious, can you run this workflow on your new M1 machine using Rosetta?

arrelid commented 2 years ago

@spamwax If you don't need to generate the binaries on GH, you should be able to create binaries for all sorts of various architectures on your local machine. Testing is a different beast though :/

I have not installed Rosetta (or Rosetta 2) on my new machine since I did not run in to anything that I need it for - yet. Well, except this maybe... but it sounds like you'd want to compile for multiple architectures to be future-proof anyways?

spamwax commented 2 years ago

I am aware of multi-arch binary generation in xcode, however this workflow uses Rust which is not supported by it. I managed to build a fat binary. Please download this test workflow and test it

arrelid commented 2 years ago

@spamwax looks good to me:

➤ lipo -info alfred-pinboard-rs
Architectures in the fat file: alfred-pinboard-rs are: x86_64 arm64