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

FEAT: Apple Silicon support #98

Closed
LinusU opened this issue Apr 23, 2021 · 10 comments
Closed

FEAT: Apple Silicon support #98

LinusU opened this issue Apr 23, 2021 · 10 comments

Comments

@LinusU
Copy link
Contributor

LinusU commented Apr 23, 2021

Is your feature request related to a problem? Please describe.
The app cannot launch on my M1 MacBook Air (without installing Rosetta which I'm trying to avoid).

Describe the solution you'd like
It would be great if there was a build for arm64 in addition to x86_64.

Describe alternatives you've considered
One alternativ is running thru Rosetta, but this has some performance and battery life disadvantages.

Additional context
This should be easy to accomplish, we just need to make sure that we have the necessary versions of some packages:

Dependency Version Requirement
Xcode >=12.2.0
node-gyp >=7.1.0
electron >= 11.0.0-beta.1
electron-rebuild >=1.12.0
electron-packager >=15.1.0

ref: https://www.electronjs.org/blog/apple-silicon

Then it should be as simple as to add arm64 to the list of platforms that we build for 🚀

@LinusU
Copy link
Contributor Author

LinusU commented Apr 23, 2021

Since we are using electron-builder, this should be supported 🚀

ref: electron-userland/electron-builder#5689

@LinusU
Copy link
Contributor Author

LinusU commented Apr 23, 2021

Currently stuck on this one: electron-userland/electron-builder#5816

But I think it's just because I'm on an M1, it probably works to build both builds from an Intel Mac.

@janproch janproch added this to the HN Feedback part 2 milestone Apr 23, 2021
janproch added a commit that referenced this issue Apr 23, 2021
@janproch
Copy link
Member

Merged PR #99, but build failed with error "OSError: [Errno 2] No such file or directory: '/Volumes/dbgate 4.1.10-beta.3/.background/background.tiff'"
https://github.com/dbgate/dbgate/runs/2422470744?check_suite_focus=true

Any idea, what's wrong? Maybe use different electron-builder version?

janproch added a commit that referenced this issue Apr 24, 2021
janproch added a commit that referenced this issue May 20, 2021
janproch added a commit that referenced this issue May 20, 2021
janproch added a commit that referenced this issue May 20, 2021
@ConradSollitt
Copy link

I just installed the latest version from the main site on a new MacBook Air M1 Chip (about 1 month old) so it's current version.

Install was very easy as expected for a Mac user then when I went to open the app finder gave an error "... cannot be opened because the developer cannot be verified". After a quick Google I found the following support link and simply command-clicked "right-click equivalent" and it opened without issue.

https://support.apple.com/guide/mac-help/open-a-mac-app-from-an-unidentified-developer-mh40616/mac

I then docked it and re-opend my two saved SQLite connections and it's working great.

Based on the type of end user (Developer, DBA, etc) I would expect most people to Google or know how to command-click and open the app but a simple alert that appears after the user clicks download on the Mac link from the main site could be helpful for some people.

If needed I'll generate a screenshot of the warning later.

@janproch
Copy link
Member

Thanks very much for info.

It is not ideal solution, but for now info after download would be OK. If you could provider screenshot, it will be great. As I am not Mac user, I don't know details, but I suppose it works in similar way as code signing under Windows.

@ConradSollitt
Copy link

I was able to create the needed screenshots by simply deleting and re-installing from a new download on the main site.

1) Error Alert on first open (by double-clicking on the app)
1-dbgate-mac-cannot-open-error

2) Solution - right-click/command-click (keyboard) then select [Open]
2-dbgate-mac-command-open

3) Click [Open] - after first open the message goes away
3-dbgate-mac-confirm-open

I would image a lot of small developer apps have stuff like this so it won't be a big deal for most people who want to try DbGate. As I mentioned before a quick solution for something like this is to show a hidden section with brief images and screenshots of the error once the user clicks Download on the main site. I did something like that for Windows Desktop App after the installer broke from a Windows Update. It was for a private app of about 200 end-users and when I added the instructions people figured it out on their own quickly.

@ConradSollitt
Copy link

I created a quick demo page to show what I was talking about above. Probably a very low priority but something like could be used until a full developer verified solution is found (seems like it might be OS specific - example - newer more secure versions of Mac).

https://dataformsjs.s3-us-west-1.amazonaws.com/tmp/dbgate/dbgate-mac-download-demo.html

Also related link from Apple that could be included for full details:
https://support.apple.com/en-us/HT202491

I performed a quick Google of how to compile Mac apps to avoid this issue but didn't find it one first few links so it would take more time to figure out the underlying issue.

@janproch
Copy link
Member

@ConradSollitt Thank you for help. I have added dialog with download info for mac exactly as you suggested. I think this should be very helpful for some users

@janproch
Copy link
Member

@LinusU arm64 for Mac build works. It required update of electron-builder and some nasty workround about problems with electorn-builder paralel builds

@LinusU
Copy link
Contributor Author

LinusU commented May 24, 2021

@janproch Awesome! Sorry for not being more helpful during the process...

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