Trying the build the Internet Identity canister locally on MacOS. Is it possible?

when trying to run the build, I get the following error:

error: failed to add native library /var/folders/30/7j228pcj5gx99lq_qsxxd3xw0000gn/T/cargo-installDsxVth/release/build/wabt-sys-5c97f456420b4626/out/build/libwabt.a: file too small to be an archive

error: aborting due to previous error

error: could not compile `wabt-sys`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `ic-cdk-optimizer v0.3.1`, intermediate artifacts can be found at `/var/folders/30/7j228pcj5gx99lq_qsxxd3xw0000gn/T/cargo-installDsxVth`

Caused by:
  build failed
The build step failed for canister 'rwlgt-iiaaa-aaaaa-aaaaa-cai' with an embedded error: The custom tool failed.

does anyone know how to resolve this error?

1 Like

Are you on a M1 mac? I’ve heard other people having problems with the new Apple silicon. If that’s the case, you could give Multipass 1.8 a try. It’s an emulator that can run Ubuntu, and it’s been confirmed to be compatible with M1 macs.

Have the same issue … on a MacM1 … moving to an ubuntu docker … :slight_smile: Thanks for posting so I could find it and stop chasing it …

It can be done on mac M1 pretty easy. Here’s the link to how I got it to run Setup Internet identity locally failed - MacBook M1 - #5 by Jesse

2 Likes

be sure to pay attention to the “edit” that I left under the solution. You’ll have to try building it the way the “README” file says. it’ll fail, then you make the changes I mention in the link

Coolio, thanks … I had time today to go back and try the local M1 install … basically your steps worked:
Setup Internet identity locally failed - MacBook M1 - #5 by Jesse

with an addition of changing package.json for I got some ERESOLVE errors for some jest packages…
change package.json to:

“ts-jest”: “^27.1.0”,
“@types/jest”: “^27.0.3”,

and it worked as expected at that point…
cloned the repo, ran it once got this:


error: failed to add native library /var/folders/p8/w2kg1md960n_0m8cnvx4sld40000gn/T/cargo-install950Ib6/release/build/wabt-sys-5c97f456420b4626/out/build/libwabt.a: file too small to be an archive

error: aborting due to previous error

error: could not compile `wabt-sys`

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `ic-cdk-optimizer v0.3.1`, intermediate artifacts can be found at `/var/folders/p8/w2kg1md960n_0m8cnvx4sld40000gn/T/cargo-install950Ib6`

Caused by:
  build failed
The build step failed for canister 'rwlgt-iiaaa-aaaaa-aaaaa-cai' with an embedded error: The custom tool failed.

Then made the change to the build step as you suggested:

"build": "cargo build --release --target wasm32-unknown-unknown",

then deleted the package-lock, reran install, restarted dfx server, and it deployed …

Awesome Sauce!
thanks again,
-M

2 Likes

Hey @Jesse I also use the same method, but when I run npm run start prompts me
Unable to load'@webpack-cli/serve' command
Then I modified “webpack-cli”: “4.9.0”
npm run start again but it prompts me

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/addDevice.ts
./src/frontend/src/flows/addDevice.ts 97:18-23
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/addDevice.ts(97,19)
      TS2571: Object is of type 'unknown'.
 @ ./src/frontend/src/index.ts 9:20-48

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/addDeviceUserNumber.ts
./src/frontend/src/flows/addDeviceUserNumber.ts 81:18-23
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/addDeviceUserNumber.ts(81,19)
      TS2571: Object is of type 'unknown'.
 @ ./src/frontend/src/flows/loginUnknown.ts 10:30-62
 @ ./src/frontend/src/flows/login.ts 13:23-48
 @ ./src/frontend/src/index.ts 7:16-40

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/login.ts
./src/frontend/src/flows/login.ts 69:6-12
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/login.ts(69,7)
      TS2322: Type 'unknown' is not assignable to type 'string | undefined'.
  Type 'unknown' is not assignable to type 'string'.
 @ ./src/frontend/src/index.ts 7:16-40

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/manage.ts
./src/frontend/src/flows/manage.ts 205:37-42
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/manage.ts(205,38)
      TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error'.
 @ ./src/frontend/src/index.ts 10:17-42

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/manage.ts
./src/frontend/src/flows/manage.ts 226:38-43
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/manage.ts(226,39)
      TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error'.
 @ ./src/frontend/src/index.ts 10:17-42

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/manage.ts
./src/frontend/src/flows/manage.ts 245:38-43
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/manage.ts(245,39)
      TS2345: Argument of type 'unknown' is not assignable to parameter of type 'Error'.
 @ ./src/frontend/src/index.ts 10:17-42

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/manage.ts
./src/frontend/src/flows/manage.ts 364:16-19
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/manage.ts(364,17)
      TS2571: Object is of type 'unknown'.
 @ ./src/frontend/src/index.ts 10:17-42

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/recovery/setupRecovery.ts
./src/frontend/src/flows/recovery/setupRecovery.ts 38:20-23
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/recovery/setupRecovery.ts(38,21)
      TS2571: Object is of type 'unknown'.
 @ ./src/frontend/src/flows/manage.ts 15:24-59
 @ ./src/frontend/src/index.ts 10:17-42

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/recovery/setupRecovery.ts
./src/frontend/src/flows/recovery/setupRecovery.ts 78:14-17
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/flows/recovery/setupRecovery.ts(78,15)
      TS2571: Object is of type 'unknown'.
 @ ./src/frontend/src/flows/manage.ts 15:24-59
 @ ./src/frontend/src/index.ts 10:17-42

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/utils/iiConnection.ts
./src/frontend/src/utils/iiConnection.ts 87:33-38
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/utils/iiConnection.ts(87,34)
      TS2322: Type 'unknown' is not assignable to type 'Error'.
 @ ./src/frontend/src/flows/manage.ts 5:23-55
 @ ./src/frontend/src/index.ts 10:17-42

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/utils/iiConnection.ts
./src/frontend/src/utils/iiConnection.ts 110:33-38
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/utils/iiConnection.ts(110,34)
      TS2322: Type 'unknown' is not assignable to type 'Error'.
 @ ./src/frontend/src/flows/manage.ts 5:23-55
 @ ./src/frontend/src/index.ts 10:17-42

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/utils/iiConnection.ts
./src/frontend/src/utils/iiConnection.ts 136:8-13
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/utils/iiConnection.ts(136,9)
      TS2322: Type 'unknown' is not assignable to type 'Error'.
 @ ./src/frontend/src/flows/manage.ts 5:23-55
 @ ./src/frontend/src/index.ts 10:17-42

ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/utils/iiConnection.ts
./src/frontend/src/utils/iiConnection.ts 163:33-38
[tsl] ERROR in /Users/liqi/Desktop/dfinity/internet-identity-main/src/frontend/src/utils/iiConnection.ts(163,34)
      TS2322: Type 'unknown' is not assignable to type 'Error'.
 @ ./src/frontend/src/flows/manage.ts 5:23-55
 @ ./src/frontend/src/index.ts 10:17-42

13 errors have detailed information that is not shown.
Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.

webpack 5.45.1 compiled with 13 errors in 2309 ms

Leave my solution, give friends who have the same problem, if you also use MacBook M1.
step1
cargo install ic-cdk-optimizer --version 0.3.1
step2

1 Like