-
-
Notifications
You must be signed in to change notification settings - Fork 344
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: add arm64 build support #2344
Conversation
dmg creation bug submitted to upstream: electron-userland/electron-builder#5465 |
@@ -48,13 +46,16 @@ export class ResolutionConfig extends Component { | |||
(this.props.isolateGameWindow ? this.props.webview.windowWidth : this.props.webview.width) * | |||
this.props.zoomLevel, | |||
), | |||
...getMinArea(screen.getAllDisplays()), | |||
...getMinArea(ipcRenderer.sendSync('get-all-displays')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we may change to use async calls here, but this could be done later
I think we still need to wait for the support from electron-builder side |
"start": "electron .", | ||
"start_debug": "electron . --dev --inspect", | ||
"dev": "electron . --dev --inspect", | ||
"clean": "gulp clean", | ||
"lint:js": "eslint . --ext .es --ext .js --ext .ts --ext .tsx --ignore-path .gitignore", | ||
"lint:css": "stylelint views/**/*.css assets/**/*.css --config .stylelintrc.css.js", | ||
"lint:styled": "stylelint views/**/*.es --config .stylelintrc.js", | ||
"lint": "npm run lint:js && npm run lint:css && npm run lint:styled" | ||
"lint": "npm run lint:js && npm run lint:css && npm run lint:styled", | ||
"postinstall": "patch-package" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This npm script will run for each npm install
since we don't always build the app, there's no need to patch every time.I think we can call it before we start to build
Exactly, it's why this is only a draft. I think we should wait until electron-userland/electron-builder#5426 is merged. However, arm64 support for Windows and Linux is merged at least one year ago and still having serious issues. I think patching upstream will be necessary for a long time to enable correct building. |
Now the upstream merged the PR and released a beta version, but that version breaks npm install on non-macOS platforms as it introduced a new dependency that is not compatible with Windows and Linux. The fix is already in master but we have to wait for next release to begin the work to make the arm64 builds as default targets. Two limitations mentioned in this PR are hard to resolve at the moment:
Another side note: I have not tested to build mac-arm64 targets on macOS < 11 yet and I cannot guarantee it will work. It may fail on our CI which is currently on 10.15 |
CI failure is not related to the changes:
|
arch: | ||
- arm64 | ||
nsis: | ||
artifactName: 'poi-setup-${version}-arm64.${ext}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds arm64
suffix to the NSIS file name. But electron-builder
also creates a latest.yml
to use with electron-updater
. The name is latest.yml
for both x64
and arm64
so they end up overwriting each other. Any solution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I managed to patch this. You can apply this patch to poi as well: https://github.com/webcatalog/webcatalog-app/pull/1253/files
seems upstream |
if not possible I'd prefer picking up the electron 11 support first, electron 11 and apple silicon are 2 things IMO |
If the blocker is Linux arm64, I think we can merge it and deliver Windows arm64 &macOS arm64 first |
277793c
to
f504e04
Compare
Seems this could be closed? |
This will enable the build for arm64 via
npm run build:arm64
, fixes #2342Most changes are made for Apple Silicon as upstream hard-coded Mac targets as x86_64, linux_arm64 should just work.
Known issues:
dmg cannot build on Big Sur, got an. Fixed by 10cbf70Operation not permitted
error during file copy. The app itself can be packed, and be zippedc68b392 prevents the packaged app to load becauseFixed by a0ab927babel-register.config
can not be found.Fixed by f1d4222rpm
andpacman
artifacts are having wrong architecture name that will prevent the installation in current release of electron-builder, already fixed in fix(arm64): fix pacman build, pacman & rpm artifact names electron-userland/electron-builder#5304 by upstream, awaiting new release include that commit.arm64 nsis target failed to build on Windows, as upstream set the macro wrong Universal NSIS setup file for x64+arm64 (WoA) is broken electron-userland/electron-builder#5461Fixed by db754b9. We are having different configs for arm64 and x86_64 now.