Google really wants anything arm-related to be cross-compiled
instead of built on the ARM device. A pity, because @groundwater
found a really awesome and cheap service
that rents out 96-core arm64 servers.
The current Electron build infrastructure is designed to make it
quick for end-user developers to put together their apps. Many
pieces that are built at the same time are packaged separately,
because some or all of them may be unnecessary most of the time.
This makes bootstrapping new architectures a little tricky,
because it's difficult to make compatible one-off builds of those
tools. For example, mksnapshot is necessary to build the
snapshot that is, by default, required for the core Atom UI
modules to be loaded into the editor, and because it generates
partially-compiled code meant to be consumed directly by a
specific version of V8, is difficult to build without knowing the
settings after the fact.
We used gn to build arm64-native and cross-targeted linux-x64 builds
of mksnapshot (that could be built using ninja instead of dealing with
gyp). Neither produced a blob for V8 that worked, even though I'm pretty
sure we had matching versions of V8. Using a mksnapshot built from the same
tree as the rest of libchromiumcontent and v8 would probably solve this
problem.
electronis built locally instead of pulled from the GH releases page, and requires patches to be made to the installed copies ofelectron-packagerandelectron-download.dump_syms, which is used byminidump, and is a part ofbreakpad, depends on a set of macros that need to have support for whatever ARM64 compiler pragma indicates the platform added to the include files.mksnapshotis hosted onatom/atom; isn't built forarm64.chromedriveris hosted onatom/atom; isn't built forarm64.
- Need a newer version of
electron-packagerthat knows aboutarm64; updatepackage.jsonto[email protected]. chromedriveris only used for tests, and isn't available from theelectron/electronReleases page forarm64(yet). Remove it frompackage.json.- Until the
dump_symsissue is resolved, all of the crash reporter infrastrucure needs to be disabled (andminidumpneeds to be removed frompackage.json). mksnapshotneeds to be commented out; it's possible to build a natively- hosted version for arm that can be used in the build process, but until we can figure out how to get it to work, it just slows down the build without doing anything useful.electron-mksnapshotalso needs to be removed frompackage.json.- The Atom ASAR needs to be built by hand to include the assets that would otherwise be compiled into the snapshot. Without this, Atom is a sad panda. All credit to Cheng for figuring this out.