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

Support Windows on ARM (WoS) #9034

Closed
2 of 3 tasks
dennisameling opened this issue Feb 2, 2020 · 23 comments · Fixed by #9691
Closed
2 of 3 tasks

Support Windows on ARM (WoS) #9034

dennisameling opened this issue Feb 2, 2020 · 23 comments · Fixed by #9691
Labels
enhancement windows Issues specific Desktop usage on Windows

Comments

@dennisameling
Copy link
Contributor

dennisameling commented Feb 2, 2020

Describe the feature or problem you’d like to solve

Please add support for Windows on ARM (e.g. Surface Pro X). Currently, only a x64 build of GitHub Desktop is available, because of which GitHub Desktop doesn't boot at all on Windows on ARM. This platform can either emulate 32-bit apps (slower performance and more battery drain) or run native Windows on ARM apps.

Proposed solution

Windows on ARM for Electron is supported in Electron 6.0.8 and later. Therefore, it should be feasible now to offer an ARM build for Windows.

This will allow Windows on ARM users to use GitHub Desktop.

Additional context

#6874 won't really do the trick, as it will only trigger emulation on the ARM platform which causes performance loss and battery drain.

@dennisameling
Copy link
Contributor Author

First attempt to install dependencies (Yarn) by cloning #8967 and using the cross-compilation command prompt results in:

Error: Failed to find Electron v3.0.0 for win32-arm64 at https://github.com/electron/electron/releases/download/v3.0.0/chromedriver-v3.0.0-win32-arm64.zip
    at Request.<anonymous> (C:\Users\denni\repos\desktop\node_modules\nugget\index.js:169:61)
    at Request.emit (events.js:223:5)
    at Request.onRequestResponse (C:\Users\denni\repos\desktop\node_modules\request\request.js:1068:10)
    at ClientRequest.emit (events.js:223:5)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:115:17)
    at TLSSocket.socketOnData (_http_client.js:456:22)
    at TLSSocket.emit (events.js:223:5)

GitHub desktop is using Spectron 5.0.0, which would need to be updated to 9.0.0 to support Electron 7. After I updated to Spectron 9.0.0, yarn dependencies installed correctly. That's a first step :)

@Rexogamer
Copy link
Contributor

Rexogamer commented Feb 2, 2020

(on the topic of upgrading to electron 7, #8967)

@dennisameling
Copy link
Contributor Author

dennisameling commented Feb 3, 2020

Just created a test build. Build succeeded without errors and the app starts. I can even login to GitHub. After logging in, I'm getting errors.

GithubDesktoptest

I guess it's best to wait until #8967 is done and merged, as I don't know whether the errors are related to the Electron 7 upgrade or this ARM-build. But the first steps are taken :)

@Rexogamer
Copy link
Contributor

Rexogamer commented Feb 3, 2020

I’d say once that PR is merged then open a draft PR with any changes you needed to do to add ARM support

@outofambit
Copy link
Contributor

Hi @dennisameling, thanks for opening this issue. I'd love to hear more about how supporting Windows on ARM would help you. Is this because your laptop/tablet is a Surface Pro X? Or is it for something educational? Something else?

Thank you!


For context, this is a decent bit of work and we don't add support for additional platforms lightly. We would also have to add support for Windows on ARM to dugite and dugite-native, but it looks like Windows for Git (which they use for Windows) does not yet support ARM64 (see git-for-windows/git#2346).

GitHub Desktop cannot support Windows on ARM until Git for Windows does, but even then we have to decide if the added maintenance load is sustainable for the core team. The more we can understand about the benefits and impacts of Windows on ARM support, the easier that decision is for the maintainers to make.

@outofambit outofambit added enhancement windows Issues specific Desktop usage on Windows more-info-needed The submitter needs to provide more information about the issue labels Feb 3, 2020
@dennisameling
Copy link
Contributor Author

@outofambit Indeed I'm using a Surface Pro X, on which GitHub Desktop doesn't boot at all.

I saw that a Microsoft engineer is providing help to support ARM64 for Git for Windows (git-for-windows/git#2346), so if we assume there's gonna be a ARM64 build of Git for Windows at some point, do you have a rough idea how much work it would be to add support to dugite and dugite-native?

Another option which might be feasible, is to use the 32-bit Windows version of Dugite native, as Windows on ARM is capable of running Windows 32-bit programs trough emulation (although with lower performance/higher battery usage). Then GitHub Desktop itself would be ARM64, but the dependencies/binaries would run 32-bit versions in the background.

I'm happy to help where possible!

@dennisameling
Copy link
Contributor Author

By the way: just tested 32-bit test build of GitHub desktop (#6874 (comment)) and works without any issues!

@dennisameling
Copy link
Contributor Author

@outofambit I'm trying to create a "hybrid build" now, where GitHub Desktop is compiled for arm64 and dependencies like Git use the 32-bit version. However, I'm trying to create this build on a x64 Windows machine, and Dugite always takes the host OS' architecture while downloading Git dependencies:

const key = `${process.platform}-${os.arch()}

This results in a download of win32-x64 (dugite-native-v2.23.1-c34be54-windows-x64.tar.gz) instead of win32-ia32 (dugite-native-v2.23.1-c34be54-windows-x86.tar.gz).

  • Is there a way to force Dugite to download the x86 build of dugite-native on a x64 machine?
  • If not, I'll try and see if I can set up a 32-bit Windows 10 VM to see how far I can get :)

@anaisbetts
Copy link

I would like to subscribe to this newsletter! Not having a version of GitHub Desktop for my Surface Pro X is like swimming without water!

@dennisameling
Copy link
Contributor Author

dennisameling commented Feb 23, 2020

MAJOR MILESTONE! 🎉 😄

I was able to create a test build for ARM64 that uses 32-bit dependencies (like Git) in the background. This way, GitHub Desktop itself is compiled natively for Windows on ARM, while dependencies like Git benefit from Windows' built-in emulation for 32-bit apps. I just tested cloning a repo and it worked flawlessly 🎉

You can download my test build here: https://github.com/dennisameling/desktop/releases/tag/windows-arm-test
@anaisbetts can you please check if it works for you too?

Steps to create the build yourself (you can also try downloading my test build above):

@dennisameling
Copy link
Contributor Author

dennisameling commented Mar 18, 2020

If desktop/dugite#392 is merged and a new Dugite version is released, things will become very easy:

  • Open a Command Prompt (not PowerShell!) in Windows and go to the GitHub desktop repository
  • Run set npm_config_arch=arm64
  • Run set TARGET_ARCH=arm64
  • Run yarn (setting the npm_config_arch before yarn will ensure you get the correct libraries for arm64)
  • Run yarn build:dev or yarn build:prod

GitHub Desktop will then be natively compiled for arm64, while the 32-bit version of Dugite Native (already available) is used. This will add compatibility for arm64 with a minimal effort needed from the maintainers, as well as provide a relatively good performance on Windows on ARM-based devices.

@dennisameling
Copy link
Contributor Author

Now that desktop/dugite#392 is merged, we can go ahead and build for ARM64. You can track my progress in #9691 👍

@dennisameling
Copy link
Contributor Author

Windows ARM64 build working (#9691), but I need some help with the GitHub Desktop installer. I can create the installer without issues (see #9691 for all details), but it throws an error when trying to install on Windows ARM64.

Especially this part of the debug log seems interesting:

2020-05-03 00:11:27> IEnableLogger: Failed to invoke post-install: System.NotSupportedException: De opgegeven methode wordt niet ondersteund.
   bij Mono.Cecil.PE.ImageReader.ReadArchitecture()
   bij Mono.Cecil.PE.ImageReader.ReadImage()
   bij Mono.Cecil.PE.ImageReader.ReadImageFrom(Stream stream)
   bij Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters)
   bij Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
   bij Squirrel.SquirrelAwareExecutableDetector.GetAssemblySquirrelAwareVersion(String executable)
   bij Squirrel.SquirrelAwareExecutableDetector.<>c__DisplayClass1_0.<GetPESquirrelAwareVersion>b__0()
   bij Squirrel.Utility.Retry[T](Func`1 block, Int32 retries)
   bij Squirrel.SquirrelAwareExecutableDetector.GetPESquirrelAwareVersion(String executable)
   bij Squirrel.SquirrelAwareExecutableDetector.<>c__DisplayClass0_0.<GetAllSquirrelAwareApps>b__2(String x)
   bij System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   bij System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   bij System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   bij Squirrel.SquirrelAwareExecutableDetector.GetAllSquirrelAwareApps(String directory, Int32 minimumVersion)
   bij Squirrel.UpdateManager.ApplyReleasesImpl.<invokePostInstall>d__10.MoveNext()

I have the feeling that Cecil can't work with Windows arm64 yet (erroring at ReadArchitecture()). But that's just an assumption that needs more investigation.

@anaisbetts, given your extensive knowledge of Squirrel (I believe you're the creator, right?), would you have a rough idea whether my assumption could be correct? And would you mind pointing me in the right direction of where to look next in order to troubleshoot the installer on Windows ARM64? Thanks! 😊

@dennisameling
Copy link
Contributor Author

Alright, the last blocker for this one is Squirrel, the installer. Squirrel needs to update one of their dependencies, see Squirrel/Squirrel.Windows#1616. Once that PR is merged, we are pretty much ready to go ahead and create an installer that installs GitHub Desktop for Windows ARM64 🎉 Squirrel/Squirrel.Windows#1616

@midNight-jam
Copy link

amazing looking forward for it, just got my Pro X & the first thing I wanted to have was github desktop. Following this thread now.

@dennisameling
Copy link
Contributor Author

@midNight-jam I created an ARM64 beta build that you can use for the time being: https://github.com/dennisameling/desktop/releases/tag/2.4.4-beta2. Please note that this build doesn't include an installer, but you should be able to use GitHub Desktop like you're used to 😃

@Ivan8R
Copy link

Ivan8R commented May 8, 2020

@dennisameling Thank you. I wait it.

@AndrewCliftonWells
Copy link

Any progress on this?

@dennisameling
Copy link
Contributor Author

@AndrewCliftonWells currently waiting for some dependency updates, please follow #9691 (comment) for updates

@niik niik removed the more-info-needed The submitter needs to provide more information about the issue label Oct 20, 2020
@dennisameling
Copy link
Contributor Author

Just completed the work on the Windows on ARM build - it works now (including the installer) and all tests are passing 🎉 more details here: #9691 (comment)

Example release for anyone who wants to try: https://github.com/dennisameling/desktop/releases/tag/2.6.4-beta99

It uses x86 Git for Windows in the background, but we're working on a native arm64 version of Git for Windows as well 🚀

@milicodes
Copy link

thank you so much!! is working perfectly in my Samsung Book S !! 🎉 (ARM-based 64bit)

@sergiou87
Copy link
Member

@milicodes you can just download the latest official beta from https://github.com/desktop/desktop#beta-channel and always be up to date 😄

@rafaeltoth
Copy link

rafaeltoth commented Jun 3, 2022

Just want to add: The Windows Beta ARM64 works fine in Apple Silicon running Windows 11 ARM via Parallels 17 (MBP14)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement windows Issues specific Desktop usage on Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

13 participants