cryptoadvance / specter-desktop

A desktop GUI for Bitcoin Core optimised to work with hardware wallets
MIT License
793 stars 237 forks source link

Macos intel build #2446

Closed k9ert closed 4 months ago

k9ert commented 4 months ago

Problem

Since we've moved the MacOS-build-procedure to a arm64 machine, we have an issue as those binaries no longer work on intel based Macs.

Potential solutions

  1. We don't cross compile but use the old existing intel machine build the specterd. This is possible as we're not signing specterd but only the ElectronApp. This could potentially work but has the following known major challenges:
    • we are relying on yet another manual step and have yet another 4th build-machine (apart from MacArm/Linux/windows)
    • we need to pass the sha256 hash somehow into the electronApp.
  2. Cross Compile on the Arm Mac with a "universal2" python build environment. This needs to either be compiled yourself or you need to use the precompiled universal2 binary (e.g. here). Both ways have there own challenges.

Building it yourself is very tricky and difficult as you probably need to have native intel packages which, according to lots of comments on github issues is possible via a whole parallel brew installations for the intel platform That is probably also true for the downloaded universal2 downloader where i already got issues installing pyinstaller itself I tend to continue with the dedicated machine as those cross-compiling stuff contains a lot of unknown unknowns to me.

Chosen solution

We'll create the build on the old intel machine without cross-compilation

For that, we're adjusting the format of the version-data.json, introducing the arch. The old format looks like this:

 {
   "version": "v2.0.0-pre32",
   "sha256": "aa049abf3e75199bad26fbded08ee5911ad48e325b42c43ec195136bd0736785"
 }

The new format looks like this:

  {
   "version": "v2.0.0-pre32",
   "sha256": {
        "arm64": "1204c8e0a87c9de59e49da8030bc368f332db6bcff542f257efd2170ac1931ad",
        "x64": "5b0c3b756910500fcb59ad9c4bd0dba612cdd7a0c63841daec33141f13ad6f3d"
     }
 }

As a result, we now have two specterd-binaries for each release and the DMG is now a "universal" build which means it's now 250 MB big instead of 171 as before.

See the realeas-guide.md for more explanations about the build on OSX.

netlify[bot] commented 4 months ago

Deploy Preview for specter-desktop-docs canceled.

Name Link
Latest commit 496210eaf079ac7d22b6db8b81d10212e89c4f7d
Latest deploy log https://app.netlify.com/sites/specter-desktop-docs/deploys/66562f129d02f70008c1c607