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

add armv7l support to scripts #712

Merged
merged 2 commits into from
May 7, 2022

Conversation

theofficialgman
Copy link

@theofficialgman theofficialgman commented May 7, 2022

Assists with #251

Description

adds armv7l as necessary to buildscripts. There is more work that needs to be done to actually build locally on armv7l systems, as currently the windows electron-winstaller still installs on linux systems. this prevents building as electron-winstaller looks for a windows arm32 binary which does not exist. to test this, I had to fully remove windows building. the package.json. and script/package.ts will need to be reworked to not require these windows only dependencies when run on linux

the changes I made to the package-*.ts scripts will also need to be changed to allow for build time customization (instead of hardcoding them to the new values)

to help with the mapping:

deb requires: armhf or arm64
appimage requires: --armv7l or --arm64
rpm requires: armv7l or aarch64

app/src/lib/get-architecture.ts should also be updated but I'm not sure the correct format for that

you can find my arm64 and armhf manually created test builds here: https://github.com/theofficialgman/testing/releases/tag/github-desktop
(with builds for dugite-native as well)

@theofficialgman theofficialgman marked this pull request as draft May 7, 2022 00:30
@@ -16,7 +16,7 @@ type DebianOptions = {
// required
src: string
dest: string
arch: 'amd64' | 'i386' | 'arm64'
arch: 'amd64' | 'i386' | 'arm64' | 'armhf'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎨 As a first step for this work I'd happily take the API changes required to enable ARM support. I think the changes below this line will impact CI, but seeing this helps me think about how we could make this smoother (detect the environment and then pass this through to the packaging stages).

If you wanted to open a fresh PR with just those API changes let me know, otherwise I'll see if I can make time over the weekend to do the same...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I force pushed removed those changes. making the other api changes isn't too urgent (since dugite-native still needs changes to its buildscripts as well). but this is a start (and means less patching when I go to build)

@shiftkey
Copy link
Owner

shiftkey commented May 7, 2022

app/src/lib/get-architecture.ts should also be updated but I'm not sure the correct format for that

I believe this is just a helper module for inspecting process.arch and handling ARM emulation quirks on Windows. I think this could be extended to support other process.platform values, and if you have a working Electron build you could check what the actual values are for your ARM platforms using the dev tools (accessible from the View menu):

The docs for process.arch suggest arm or arm64 are what you should see:

/**
 * The operating system CPU architecture for which the Node.js binary was compiled.
 * Possible values are: `'arm'`, `'arm64'`, `'ia32'`, `'mips'`,`'mipsel'`, `'ppc'`,`'ppc64'`, `'s390'`, `'s390x'`, `'x32'`, and `'x64'`.
 *
 * ```js
 * import { arch } from 'process';
 *
 * console.log(`This processor architecture is ${arch}`);
 * ```
 * @since v0.5.0
 */
readonly arch: string;

I think adding these values to this type here would help us flush out some unknowns:

export type Architecture = 'x64' | 'arm64' | 'x64-emulated'

@theofficialgman
Copy link
Author

theofficialgman commented May 7, 2022

yes, I see arm (and arm64 on the arm64 build). I'm surprised that the process arch was displayed correctly in the about page already (without editing this script)... now I'm not even sure what app/src/lib/get-architecture.ts is used for in github-desktop
Screenshot from 2022-05-07 10-40-10

oh I see... this function is only used for exception reporting really

@shiftkey
Copy link
Owner

shiftkey commented May 7, 2022

oh I see... this function is only used for exception reporting really

Yep, I don't believe it's critical for our needs but it's a thing to keep in mind (particularly arm vs arm64 and being consistent there)...

@shiftkey
Copy link
Owner

shiftkey commented May 7, 2022

I'm happy to flip this to "Ready for review" here now that CI is passing, unless you had extra you wanted to pull in at this stage @theofficialgman...

@theofficialgman
Copy link
Author

theofficialgman commented May 7, 2022

oh I see... this function is only used for exception reporting really

Yep, I don't believe it's critical for our needs but it's a thing to keep in mind (particularly arm vs arm64 and being consistent there)...

no its consistent, arm referring to armv7l/armhf, and then arm64 referring to aarch64/arm64.
sorry if I was confusing, I get the correct output of arm on my arm32 build, and arm64 on my arm64 build in the about page

@theofficialgman theofficialgman marked this pull request as ready for review May 7, 2022 15:02
@theofficialgman
Copy link
Author

theofficialgman commented May 7, 2022

unless you had extra you wanted to pull in at this stage

no not right now, you can merge. I'm not a professional developer so I don't really know the correct way of doing the things I mentioned in the first post #712 (comment)

ideally I'd like microsoft to host arm32 and arm64 linux github action runners... because until then its a bit harder to make anything with the CI (unless you host a local custom runner)

@shiftkey
Copy link
Owner

shiftkey commented May 7, 2022

ideally I'd like microsoft to host arm32 and arm64 linux github action runners... because until then its a bit harder to make anything with the CI (unless you host a local custom runner)

I don't have access to anything that could serve as a local runner, but let's see if we can make it easier to test things locally in the near term...

@shiftkey shiftkey merged commit 64fab85 into shiftkey:linux May 7, 2022
shiftkey added a commit that referenced this pull request May 25, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jun 11, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jun 11, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jun 11, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jun 25, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jun 25, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jun 25, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jul 6, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jul 6, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jul 6, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jul 6, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jul 26, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jul 26, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jul 26, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Jul 26, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Aug 2, 2022
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Aug 12, 2024
* add armv7l support to scripts

* lint fix new files

Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Aug 12, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Aug 12, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Aug 12, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Aug 12, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Aug 14, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Aug 15, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Aug 17, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Aug 17, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Sep 2, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Sep 2, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Oct 30, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 8, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 8, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 8, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 8, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 8, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 11, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 11, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 11, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 11, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 11, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 11, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 11, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Nov 11, 2024
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Feb 5, 2025
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Feb 5, 2025
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Feb 5, 2025
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Feb 5, 2025
Co-authored-by: Brendan Forster <github@brendanforster.com>
shiftkey added a commit that referenced this pull request Feb 5, 2025
Co-authored-by: Brendan Forster <github@brendanforster.com>
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

Successfully merging this pull request may close these issues.

2 participants