Building Desktop on M1-based Mac fails

Steps to reproduce the bug:

Follow the instructions in /docs/getting-started.md to build Desktop version.

Issue command to build backend for Desktop version:

$ npm run build-backend-desktop

Expected behavior:

The backend builds and we can proceed with the rest of the steps to build Manyverse Desktop.

Actual behavior:

Failure upon reaching the neon related steps of the build-backend-desktop. Neon can't be fetch from online repository, probably because the factory is not building aarch64 artefacts. Building locally fails as well. Full log below:

npm ERR! code 1
npm ERR! path /Users/agarzia/ssbc/manyverse/desktop/node_modules/ssb-keys-mnemonic-neon
npm ERR! command failed
npm ERR! command sh -c neon-load-or-build
npm ERR! neon info forcing rebuild for new build settings
npm ERR! neon info running cargo
npm ERR! /Users/agarzia/ssbc/manyverse/desktop/node_modules/neon-load-or-build/index.js:62
npm ERR!   throw new Error('No native build was found for ' + target + '\n    loaded from: ' + dir + '\n')
npm ERR!   ^
npm ERR!
npm ERR! Error: No native build was found for platform=darwin arch=arm64 runtime=node abi=93 uv=1 armv=8 libc=glibc node=16.7.0
npm ERR!     loaded from: /Users/agarzia/ssbc/manyverse/desktop/node_modules/ssb-keys-mnemonic-neon
npm ERR!
npm ERR!     at Function.load.path (/Users/agarzia/ssbc/manyverse/desktop/node_modules/neon-load-or-build/index.js:62:9)
npm ERR!     at load (/Users/agarzia/ssbc/manyverse/desktop/node_modules/neon-load-or-build/index.js:27:30)
npm ERR!     at Object.<anonymous> (/Users/agarzia/ssbc/manyverse/desktop/node_modules/neon-load-or-build/build-test.js:19:19)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1101:14)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:981:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
npm ERR!     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
npm ERR!     at node:internal/main/run_main_module:17:47
npm ERR!
npm ERR!     Blocking waiting for file lock on package cache
npm ERR!    Compiling version_check v0.9.2
npm ERR!    Compiling typenum v1.12.0
npm ERR!    Compiling memchr v2.3.0
npm ERR!    Compiling proc-macro2 v1.0.21
npm ERR!    Compiling lazy_static v1.4.0
npm ERR!    Compiling regex-syntax v0.6.13
npm ERR!    Compiling unicode-xid v0.2.0
npm ERR!    Compiling cc v1.0.69
npm ERR!    Compiling syn v1.0.41
npm ERR!    Compiling libc v0.2.99
npm ERR!    Compiling cfg-if v0.1.10
npm ERR!    Compiling subtle v2.4.1
npm ERR!    Compiling getrandom v0.1.15
npm ERR!    Compiling byteorder v1.3.4
npm ERR!    Compiling maybe-uninit v2.0.0
npm ERR!    Compiling ppv-lite86 v0.2.9
npm ERR!    Compiling cfg-if v1.0.0
npm ERR!    Compiling serde v1.0.127
npm ERR!    Compiling signature v1.2.2
npm ERR!    Compiling opaque-debug v0.3.0
npm ERR!    Compiling semver-parser v0.7.0
npm ERR!    Compiling cslice v0.2.0
npm ERR!    Compiling base64 v0.13.0
npm ERR!    Compiling bitcoin_hashes v0.9.7
npm ERR!    Compiling rand_core v0.4.2
npm ERR!    Compiling smallvec v1.4.2
npm ERR!    Compiling thread_local v1.0.1
npm ERR!    Compiling generic-array v0.14.4
npm ERR!    Compiling neon-build v0.5.1
npm ERR!    Compiling ed25519 v1.0.2
npm ERR!    Compiling semver v0.9.0
npm ERR!    Compiling aho-corasick v0.7.6
npm ERR!    Compiling smallvec v0.6.13
npm ERR!    Compiling cpufeatures v0.1.5
npm ERR!    Compiling quote v1.0.2
npm ERR!    Compiling rand_core v0.5.1
npm ERR!    Compiling unicode-normalization v0.1.9
npm ERR!    Compiling rand_chacha v0.2.2
npm ERR!    Compiling rand v0.7.3
npm ERR!    Compiling digest v0.9.0
npm ERR!    Compiling cipher v0.2.5
npm ERR!    Compiling universal-hash v0.4.0
npm ERR!    Compiling block-buffer v0.9.0
npm ERR!    Compiling crypto-mac v0.10.1
npm ERR!    Compiling aead v0.3.2
npm ERR!    Compiling poly1305 v0.6.0
npm ERR!    Compiling sha2 v0.9.5
npm ERR!    Compiling hmac v0.10.1
npm ERR!    Compiling regex v1.3.3
npm ERR!    Compiling neon-sys v0.5.1
npm ERR!    Compiling synstructure v0.12.4
npm ERR!    Compiling zeroize_derive v1.0.1
npm ERR!    Compiling zerocopy-derive v0.2.0
npm ERR!    Compiling bip39 v1.0.1
npm ERR!    Compiling zeroize v1.4.1
npm ERR!    Compiling curve25519-dalek v3.0.0
npm ERR!    Compiling salsa20 v0.7.2
npm ERR!    Compiling xsalsa20poly1305 v0.6.0
npm ERR!    Compiling zerocopy v0.3.0
npm ERR!    Compiling x25519-dalek v1.1.0
npm ERR!    Compiling ed25519-dalek v1.0.1
npm ERR!    Compiling ssb-crypto v0.2.3
npm ERR! The following warnings were emitted during compilation:
npm ERR!
npm ERR! warning: ar: /Users/agarzia/ssbc/manyverse/desktop/node_modules/ssb-keys-mnemonic-neon/native/target/release/build/neon-sys-10fdbfd258d7d6e2/out/native/build/Release/obj.target/neon/src/neon.o: No such file or directory
npm ERR!
npm ERR! error: failed to run custom build command for `neon-sys v0.5.1`
npm ERR!
npm ERR! Caused by:
npm ERR!   process didn't exit successfully: `/Users/agarzia/ssbc/manyverse/desktop/node_modules/ssb-keys-mnemonic-neon/native/target/release/build/neon-sys-7cb0846f62d1e155/build-script-build` (exit status: 1)
npm ERR!   --- stdout
npm ERR!   Skipping node-gyp installation as part of npm install.
npm ERR!   cargo:node_arch=arm
npm ERR!   TARGET = Some("aarch64-apple-darwin")
npm ERR!   HOST = Some("aarch64-apple-darwin")
npm ERR!   AR_aarch64-apple-darwin = None
npm ERR!   AR_aarch64_apple_darwin = None
npm ERR!   HOST_AR = None
npm ERR!   AR = None
npm ERR!   running: "ar" "cq" "/Users/agarzia/ssbc/manyverse/desktop/node_modules/ssb-keys-mnemonic-neon/native/target/release/build/neon-sys-10fdbfd258d7d6e2/out/libneon.a" "/Users/agarzia/ssbc/manyverse/desktop/node_modules/ssb-keys-mnemonic-neon/native/target/release/build/neon-sys-10fdbfd258d7d6e2/out/native/build/Release/obj.target/neon/src/neon.o"
npm ERR!   cargo:warning=ar: /Users/agarzia/ssbc/manyverse/desktop/node_modules/ssb-keys-mnemonic-neon/native/target/release/build/neon-sys-10fdbfd258d7d6e2/out/native/build/Release/obj.target/neon/src/neon.o: No such file or directory
npm ERR!   exit status: 1
npm ERR!
npm ERR!   --- stderr
npm ERR!
npm ERR!
npm ERR!   error occurred: Command "ar" "cq" "/Users/agarzia/ssbc/manyverse/desktop/node_modules/ssb-keys-mnemonic-neon/native/target/release/build/neon-sys-10fdbfd258d7d6e2/out/libneon.a" "/Users/agarzia/ssbc/manyverse/desktop/node_modules/ssb-keys-mnemonic-neon/native/target/release/build/neon-sys-10fdbfd258d7d6e2/out/native/build/Release/obj.target/neon/src/neon.o" with args "ar" did not execute successfully (status code exit status: 1).
npm ERR!
npm ERR!
npm ERR! warning: build failed, waiting for other jobs to finish...
npm ERR! The following warnings were emitted during compilation:
npm ERR!
npm ERR! warning: ar: /Users/agarzia/ssbc/manyverse/desktop/node_modules/ssb-keys-mnemonic-neon/native/target/release/build/neon-sys-f30fce666b4471ab/out/native/build/Release/obj.target/neon/src/neon.o: No such file or directory
npm ERR!
npm ERR! error: build failed
npm ERR! neon ERR! cargo build failed
npm ERR!
npm ERR! Error: cargo build failed
npm ERR!     at Target.<anonymous> (/Users/agarzia/ssbc/manyverse/desktop/node_modules/neon-cli/lib/target.js:98:27)
npm ERR!     at Generator.next (<anonymous>)
npm ERR!     at fulfilled (/Users/agarzia/ssbc/manyverse/desktop/node_modules/neon-cli/lib/target.js:24:58)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:96:5)

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/agarzia/.npm/_logs/2022-01-10T15_56_28_438Z-debug.log

    at ChildProcess.exithandler (node:child_process:397:12)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)

Technical details

  • Manyverse app version: fresh clone of main branch.
  • Device/phone model: MacBook Air M1 running macOS 12.1