Setup Internet identity locally failed - MacBook M1

HelloHello,

I want to set up the Internet identity locally on my machine, MacBook Pro 13" with Apple Silicon Chip, but the compilation errors out with:

Error: error: failed to add native library /var/folders/c7/v1x0y5p13sb4h4b19sbv8ds40000gn/T/cargo-installXbPkC0/release/build/wabt-sys-0c5d3f90b9057634/out/build/libwabt.a: file too small to be an archive

Steps I did:

  • git clone git@github.com:dfinity/internet-identity.git
  • npm install
  • dfx start [–clean] [–background]

This command fails with the message above:
II_ENV=development dfx deploy --no-wallet --argument ‘(null)’

Does anybody have experience with the internet identity on a MacBook M1

Note: I guess this is already known? Error Compiling on Mac M1 - 'could not compile wabt-sys' · Issue #381 · dfinity/internet-identity · GitHub

Thanks in advance :slightly_smiling_face:

did you ever find a solution? I looked in the link you provided. some one made a branch for a fix to get the build to run, but I tried that fix and it didn’t work for me. I’m curious if anyone found a solution to this. I’m currently stalled by this very problem.

Canonical has a tool called Multipass, and since 1.8 it is supported on M1 Macs. You could use that to install ubuntu as a virtual machine on your M1 mac. It even has a feature called Alias that allows you to run specific apps (think terminal) from your mac environment (like parallels used to do). It’s free and made by canonical, the publishers of Ubuntu.

On the heels of Apple’s announcement of a new line of game-changing M1 MacBooks, Canonical is bringing fast and easy Linux to the M1 platform. Multipass, the quickest way to run Linux cross-platform, received an update last week allowing M1 users to run Ubuntu VMs with minimal set-up. Multipass can download and launch a virtual machine image with one command, and developers on M1 can now get running on Linux in as little as 20 seconds.

Also someone on Discord said they got it to compile using this link: fix: build on Apple M1 chip by plitzenberger · Pull Request #434 · dfinity/internet-identity · GitHub

1 Like

I figured it out. I was able to run it locally by replacing the "build" property on line 7 of the dfx.json file of the Internet-Identity repo.

I changed it from: "src/internet_identity/build.sh"
to: "cargo build --release --target wasm32-unknown-unknown"

after that, I deleted the node_modules file and the package-lock.json file. finally, I ran the following commands in the terminal:

npm i

dfx start

II_ENV=development dfx deploy --no-wallet --argument '(null)'

edit: you’ll have to run the commands with the original build settings first. the build will fail, then you change the settings as I’ve described above, then run the commands again, then it should work.

4 Likes