Skip to content

Instantly share code, notes, and snippets.

@othiym23
Created October 3, 2017 12:50
Show Gist options
  • Save othiym23/a618e2485b09f057aab6027f271bed76 to your computer and use it in GitHub Desktop.
Save othiym23/a618e2485b09f057aab6027f271bed76 to your computer and use it in GitHub Desktop.

arm64 build notes

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.

from the Google tree

  1. electron is built locally instead of pulled from the GH releases page, and requires patches to be made to the installed copies of electron-packager and electron-download.
  2. dump_syms, which is used by minidump, and is a part of breakpad, depends on a set of macros that need to have support for whatever ARM64 compiler pragma indicates the platform added to the include files.
  3. mksnapshot is hosted on atom/atom; isn't built for arm64.
  4. chromedriver is hosted on atom/atom; isn't built for arm64.

HAX

  1. Need a newer version of electron-packager that knows about arm64; update package.json to electron-packager@9.1.0.
  2. chromedriver is only used for tests, and isn't available from the electron/electron Releases page for arm64 (yet). Remove it from package.json.
  3. Until the dump_syms issue is resolved, all of the crash reporter infrastrucure needs to be disabled (and minidump needs to be removed from package.json).
  4. mksnapshot needs 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-mksnapshot also needs to be removed from package.json.
  5. 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment