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 processor support #348

Open
AlexanderDankin opened this issue Apr 25, 2024 · 10 comments
Open

Apple silicon processor support #348

AlexanderDankin opened this issue Apr 25, 2024 · 10 comments
Labels
enhancement New feature or request

Comments

@AlexanderDankin
Copy link

I really wish there was support for “M” series processors.

@AlexanderDankin AlexanderDankin added the enhancement New feature or request label Apr 25, 2024
@undergroundwires
Copy link
Owner

Hi @AlexanderDankin,

I guess you mean the desktop application. It works fine on M processors for me. What issue did you have?

@AlexanderDankin
Copy link
Author

There are no problems as such, except for the application taking too long to start up.
I can only speculate, but maybe it's because the application is optimized for
intel processors.

@plantindesk
Copy link

plantindesk commented Apr 27, 2024

There are no problems as such, except for the application taking too long to start up. I can only speculate, but maybe it's because the application is optimized for intel processors.

The app is build using ElectronJS which is a framework that utilize web technologies and therefore are not native in the traditional sense. So it lacks performance and is resource intensive

undergroundwires added a commit that referenced this issue Apr 28, 2024
- Create system requirements documentation for desktop versions,
  addressing issue #134.
- Reorganize related documents into `docs/desktop` for improved
  structure and accessibility.
- Update references to address ARM chip emulation issues noted in user
  feedback, issue #348.
  in user feedback, issue #348.
undergroundwires added a commit that referenced this issue Apr 28, 2024
- Create system requirements documentation for desktop versions,
  addressing issue #134.
- Reorganize related documents into `docs/desktop` for improved
  structure and accessibility.
- Update references to address ARM chip emulation issues noted in user
  feedback, issue #348.
@undergroundwires
Copy link
Owner

The binary for macOS is x64, but this gets emulated on Apple that has performance impact:

Native apps run more efficiently than translated apps because the compiler is able to optimize your code for the target architecture. An app that supports only the x86_64 architecture must run under Rosetta translation on Apple silicon
Apple Documentation

🚀 I just added System Requirements docs to clarify this: system-requirements.md.


Solution suggestion 1: Universal packages

So changing macOS releases to universal packages may help with the issue. This seems to be basically packaging ARM and x64 versions together in same file.

@plantindesk is right. Here is the electron-builder configuration. Luckily electron-builder supports universal packages:


Solution suggestion 2: Do not show the white blank page

Another think we can do is to avoid showing white blank page while application is loading, see this blog post or this for visual examples.


What do you think?

@plantindesk
Copy link

I think building both arm64 and x64 build for MacOS

@undergroundwires
Copy link
Owner

How about hiding the window until HTML/CSS/JS is loaded? I guess this should not be only macOS only but also be part of Windows/Linux versions. Do you see any side-effect having this on Windows/Linux?

I demonstrate this on Linux:

Now (with initial blank page) After (window hidden until loaded)
with-flash without-flash

@plantindesk
Copy link

Thats best idea

undergroundwires added a commit that referenced this issue Apr 28, 2024
- Create system requirements documentation for desktop versions,
  addressing issue #134.
- Reorganize related documents into `docs/desktop` for improved
  structure and accessibility.
- Update references to address ARM chip emulation issues noted in user
  feedback, issue #348.
undergroundwires added a commit that referenced this issue Apr 28, 2024
- Create system requirements documentation for desktop versions,
  addressing issue #134.
- Reorganize related documents into `docs/desktop` for improved
  structure and accessibility.
- Update references to address ARM chip emulation issues noted in user
  feedback, issue #348.
@plantindesk
Copy link

plantindesk commented Apr 29, 2024

Off topic: Also you use Ubuntu 🫤 cause see this https://prism-break.org

image

undergroundwires added a commit that referenced this issue May 3, 2024
This commit updates the application startup behavior to prevent showing
a blank window until it's fully loaded on all platforms. This enhancement
improves the user experience by ensuring the UI only becomes visible
when it is ready to interact with.

This fix contributes to a smoother user experience by aligning the
window display timing with content readiness, thus avoiding the brief
display of an empty screen.

Changes:

- Set window to initially hide until fully loaded using the
  `ready-to-show` event.
- Parametrize the behavior of opening developer tools for easier
  configuration during testing.
undergroundwires added a commit that referenced this issue May 3, 2024
This commit updates the application startup behavior to prevent showing
a blank window until it's fully loaded on all platforms. This enhancement
improves the user experience by ensuring the UI only becomes visible
when it is ready to interact with.

This fix contributes to a smoother user experience by aligning the
window display timing with content readiness, thus avoiding the brief
display of an empty screen.

Changes:

- Set window to initially hide until fully loaded using the
  `ready-to-show` event.
- Show the window, focus on it and bring it front once it is loaded.
  Windows requires additional logic to put Window to front, see
  electron/electron#2867.
- Parametrize the behavior of opening developer tools for easier
  configuration during testing.
@undergroundwires
Copy link
Owner

So hiding window until loaded is released as part of 0.13.3 🎉

The packaged application is now arm64 (Apple Silicon) native. So it should run smoth now, feel free to verify this with 0.13.3 @AlexanderDankin.

It’s weird because I have never configured this arm64 build 😅. I guess this is because macOS GitHub runner (CI/CD) agents have been updated automatically to be ARM-based, and this resulted in ARM-only builds. I verify this by running file /Applications/privacy.sexy.app/Contents/MacOS/privacy.sexy command, which gives me:



/Applications/privacy.sexy.app/Contents/MacOS/privacy.sexy: Mach-O 64-bit executable arm64

This will break desktop application on all other Intel-based macs 🤦. So I will migrate to universal builds for macOS in 0.13.4.

I will also update desktop execution tests (which actually installs the software and ensures it runs OK), to run on both Intel and ARM-based macs to verify that it runs fine on both platforms.

@AlexanderDankin
Copy link
Author

Thank you! Indeed the app started to open much faster.

undergroundwires added a commit that referenced this issue May 16, 2024
This commit introduces a universal binary format in the distributed MDG
files for macOS, improving support for both Apple Silicon (ARM) and
Intel (x64) architectures.

It uses `electron-builder` to package both architectures into a single
executable, ensuring the application can natively on any macOS hardware
without depending on the GitHub runners' architecture. It fixes the
issue related to prior releases that supported only the architecture of
the build environment itself, which is subject to change.

Changes:

- Update DMG distribution to include both ARM64 and x64 architectures.
- Enhance system requirements documentation to reflect support for both
  architectures.
- Modify CI/CD workflows to check desktop runtime errors for both ARM64
  and x64 versions on macOS.

Resolves:

- Issue #348: Initial request for Apple Silicon support.
- Issue #362: Correction of distribution limited to ARM64 in release
  0.13.3.

`electron-builder` support:
- electron-userland/electron-builder#5475
- electron-userland/electron-builder#5689
- electron-userland/electron-builder#5426
undergroundwires added a commit that referenced this issue May 16, 2024
This commit introduces a universal binary format in the distributed MDG
files for macOS, improving support for both Apple Silicon (ARM) and
Intel (x64) architectures.

It uses `electron-builder` to package both architectures into a single
executable, ensuring the application can natively on any macOS hardware
without depending on the GitHub runners' architecture. It fixes the
issue related to prior releases that supported only the architecture of
the build environment itself, which is subject to change.

Changes:

- Update DMG distribution to include both ARM64 and x64 architectures.
- Enhance system requirements documentation to reflect support for both
  architectures.
- Modify CI/CD workflows to check desktop runtime errors for both ARM64
  and x64 versions on macOS.

Resolves:

- Issue #348: Initial request for Apple Silicon support.
- Issue #362: Correction of distribution limited to ARM64 in release
  0.13.3.

`electron-builder` support:
- electron-userland/electron-builder#5475
- electron-userland/electron-builder#5689
- electron-userland/electron-builder#5426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants