autopkg / MichalMMac-recipes

Recipes for https://github.com/autopkg/autopkg
Apache License 2.0
1 stars 5 forks source link

Draw.io download recipe is pulling ARM64 .dmg #16

Closed fseesink closed 2 years ago

fseesink commented 3 years ago

It should be noted that the drawio-desktop binaries are now broken out as separate Intel and ARM versions: https://github.com/jgraph/drawio-desktop/releases

And due to the recipe's vague RegEx pattern, it's finding the ARM64 binary only. Not sure if this is the intention, but the side effect is that for anyone running on an Intel-based Mac, they're suddenly seeing the usual application logo with red circle with a line through it. In macOS 10.15.x if you try to run it, all you get is a warning that the binary requires macOS 11 "Big Sur". This initially made me think it was compiled so that "Big Sur" was the min. OS supported. But that seemed odd. So I checked my one Mac with "Big Sur". And if you're on an Intel-based macOS 11 "Big Sur" system, you can see that the issue is that it's an ARM64 binary.

Ideally it would be nice if the Draw.io folks create a Universal Binary2 .dmg instead of the separate ones. But as it stands, this is what happens now. The download recipe is not specific enough, and I'm guessing it lands on the first one it finds. If GitHub changes the order of the .DMGs, you'll end up with this flip-flopping and then impacting the A1 based Macs. Just thought you should be aware.

As my systems are all Intel-based at this point, my solution was to tweak my local copy of the download recipe to search for .*x64.*\.dmg$ instead of just .*\.dmg$. But I'm guessing for apps like this where they only offer separate binaries, the real solution is to have 2 recipes: one for the Intel-based version and one for the ARM64-based version.

MichalMMac commented 3 years ago

Thank you for reporting this. Downloading ARM64 version only is not intended.

I am on a vacation for couple of weeks. Could you possibly create a PR expanding the recipe with the new variable containing the regex and documentation on top of that explaining what should be done to obtain desired version?

Default regex should be probably the one matching Intel binary link. Admin can create two local overrides. One with the default variable value (Intel link) and the second with the regex for matching the ARM64 version link (this regex would be provided in the documentation).

WiesBen commented 2 years ago

Hmm how do we proceed here, do we want both variants maybe in a variable which can be overridden?

MichalMMac commented 2 years ago

@WiesBen That sounds great. If you produce a PR I would gladly merge it.

I am not going to look into this on my own for another month or so (personal reasons).

WiesBen commented 2 years ago

I added one, but needs really to be tested: #17

MichalMMac commented 2 years ago

Seems to work just fine. Thank you @WiesBen ! 😄