How to build nns canisters from source - nns canisters out of date with dfx nns install

Is there a way to decouple the dfx nns install version from the version of dfx that I’m using?

There are a few nns canisters whose declarations have changed since the version of dfx that I’m using, and I’d like to use the latest wasm in my dfx setup.

As an alternative I’m looking to build the nns-root from source and then copy that wasm into my project, and am looking at the instructions in ic/rs/nns at master · dfinity/ic · GitHub, but am running into the following error when building the root from source.

Update: Looks like I need to build this on arm64, but I’m running on an M2 Macbook, which should be arm64?

% dfx build root          
Building canisters...
Executing 'cargo build --target wasm32-unknown-unknown --release -p ic-nns-handler-root'
warning: /Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/rosetta-api/icp_ledger/Cargo.toml: file `/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/rosetta-api/icp_ledger/tests/notified.rs` found to be present in multiple build targets:
  * `bin` target `test-notified`
  * `integration-test` target `notified`
warning: /Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/tests/nns/sns/Cargo.toml: file `/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/tests/nns/sns/payment_flow_with_finalization_test.rs` found to be present in multiple build targets:
  * `bin` target `ic-systest-sns-payment-flow-with-finalization-test`
  * `bin` target `ic-systest-sns-one-proposal-payment-flow-with-finalization-test`
   Compiling proc-macro2 v1.0.75
   Compiling unicode-ident v1.0.8
   Compiling syn v1.0.109
   Compiling serde v1.0.194
   Compiling version_check v0.9.4
   Compiling autocfg v1.1.0
   Compiling typenum v1.16.0
   Compiling cfg-if v1.0.0
   Compiling unicode-xid v0.2.4
   Compiling anyhow v1.0.80
   Compiling libm v0.2.6
   Compiling subtle v2.5.0
   Compiling thiserror v1.0.57
   Compiling spin v0.5.2
   Compiling const-oid v0.9.5
   Compiling lazy_static v1.4.0
   Compiling either v1.8.1
   Compiling crc32fast v1.3.2
   Compiling generic-array v0.14.7
   Compiling rustversion v1.0.12
   Compiling paste v1.0.14
   Compiling num-traits v0.2.17
   Compiling num-integer v0.1.45
   Compiling num-bigint v0.4.4
   Compiling convert_case v0.4.0
   Compiling quote v1.0.35
   Compiling syn v2.0.48
   Compiling byteorder v1.5.0
   Compiling data-encoding v2.4.0
   Compiling leb128 v0.2.5
   Compiling libc v0.2.153
   Compiling unicode-segmentation v1.10.1
   Compiling arrayvec v0.5.2
   Compiling typed-arena v2.0.2
   Compiling erased-serde v0.3.25
   Compiling itertools v0.11.0
   Compiling slog v2.7.0
   Compiling itoa v1.0.6
   Compiling pretty v0.12.1
   Compiling bytes v1.6.0
   Compiling ryu v1.0.13
   Compiling serde_json v1.0.108
   Compiling cc v1.0.90
   Compiling convert_case v0.6.0
   Compiling maplit v1.0.2
   Compiling yansi v0.5.1
   Compiling diff v0.1.13
   Compiling utf8-width v0.1.6
   Compiling pretty_assertions v1.4.0
   Compiling heck v0.4.1
   Compiling semver v1.0.17
   Compiling getrandom v0.2.12
   Compiling rand_core v0.6.4
   Compiling half v1.8.2
   Compiling scoped_threadpool v0.1.9
   Compiling pkg-config v0.3.30
   Compiling memchr v2.6.4
   Compiling cpufeatures v0.2.12
   Compiling synstructure v0.12.6
   Compiling camino v1.1.4
   Compiling psm v0.1.21
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling lzma-sys v0.1.20
   Compiling digest v0.10.7
   Compiling base64 v0.13.1
   Compiling stacker v0.1.15
   Compiling sha2 v0.10.8
   Compiling arrayvec v0.7.4
   Compiling glob v0.3.1
   Compiling once_cell v1.19.0
   Compiling ic-constants v0.9.0 (/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/constants)
   Compiling indexmap v1.9.2
   Compiling fnv v1.0.7
   Compiling strsim v0.10.0
   Compiling ident_case v1.0.1
   Compiling darling_core v0.13.4
   Compiling xz2 v0.1.7
   Compiling async-trait v0.1.74
   Compiling assert_matches v1.5.0
   Compiling on_wire v0.9.0 (/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/rust_canisters/on_wire)
   Compiling ppv-lite86 v0.2.17
   Compiling thousands v0.2.0
   Compiling ic0 v0.21.1
   Compiling proc-macro-error-attr v1.0.4
   Compiling rand_chacha v0.3.1
   Compiling proc-macro-error v1.0.4
   Compiling opaque-debug v0.3.0
   Compiling base32 v0.4.0
   Compiling hashbrown v0.12.3
   Compiling rand v0.8.5
   Compiling rust_decimal v1.29.0
   Compiling ucd-trie v0.1.5
   Compiling base64ct v1.6.0
   Compiling aho-corasick v1.1.2
   Compiling ic-metrics-encoder v1.1.1
   Compiling pem-rfc7468 v0.7.0
   Compiling regex-syntax v0.8.2
   Compiling proc-macro-hack v0.5.20+deprecated
   Compiling ff v0.13.0
   Compiling slab v0.4.8
   Compiling predicates-core v1.0.6
   Compiling group v0.13.0
   Compiling itertools v0.10.5
   Compiling float-cmp v0.9.0
   Compiling priority-queue v1.3.1
   Compiling serde_derive v1.0.194
   Compiling thiserror-impl v1.0.57
   Compiling candid_derive v0.6.6
   Compiling zeroize_derive v1.3.3
   Compiling binread_derive v2.1.0
   Compiling prost-derive v0.12.3
   Compiling comparable_derive v0.5.4
   Compiling zeroize v1.7.0
   Compiling comparable_helper v0.5.4
   Compiling strum_macros v0.26.2
   Compiling derive_more v0.99.17
   Compiling darling_macro v0.13.4
   Compiling ic-crypto-internal-sha2 v0.9.0 (/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/crypto/internal/crypto_lib/sha2)
   Compiling ic-crypto-sha2 v0.9.0 (/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/crypto/sha2)
   Compiling darling v0.13.4
   Compiling digest v0.9.0
   Compiling block-buffer v0.9.0
   Compiling serde_with_macros v1.5.2
   Compiling pest v2.5.6
   Compiling sha2 v0.9.9
   Compiling prost v0.12.3
   Compiling binread v2.2.0
   Compiling der v0.7.6
   Compiling regex-automata v0.4.3
   Compiling strum v0.26.2
   Compiling pest_meta v2.5.6
   Compiling futures-sink v0.3.30
   Compiling futures-core v0.3.30
   Compiling normalize-line-endings v0.3.0
   Compiling difflib v0.4.0
   Compiling termtree v0.4.0
   Compiling predicates-tree v1.0.7
   Compiling pest_generator v2.5.6
   Compiling spki v0.7.2
   Compiling pkcs8 v0.10.2
   Compiling futures-channel v0.3.30
   Compiling dfn_protobuf v0.9.0 (/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/rust_canisters/dfn_protobuf)
   Compiling regex v1.10.2
   Compiling build-info-common v0.0.27 (https://github.com/dfinity-lab/build-info?rev=701a696844fba5c87df162fbbc1ccef96f27c9d7#701a6968)
   Compiling pest_derive v2.5.6
   Compiling predicates v2.1.5
   Compiling mockall_derive v0.11.4
   Compiling futures-macro v0.3.30
   Compiling futures-io v0.3.30
   Compiling fragile v2.0.0
   Compiling pin-utils v0.1.0
   Compiling downcast v0.11.0
   Compiling futures-task v0.3.30
   Compiling pin-project-lite v0.2.13
   Compiling powerfmt v0.2.0
   Compiling time-core v0.1.2
   Compiling by_address v1.1.0
   Compiling time-macros v0.2.16
   Compiling deranged v0.3.11
   Compiling platforms v3.3.0
   Compiling rustix v0.38.32
   Compiling hex v0.4.3
   Compiling serde_bytes v0.11.14
   Compiling ic_principal v0.1.1
   Compiling bincode v1.3.3
   Compiling byte-unit v4.0.18
   Compiling comparable v0.5.4
   Compiling ic-utils v0.9.0 (/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/utils)
   Compiling rustc_version v0.4.0
   Compiling serde_cbor v0.11.2
   Compiling cargo-platform v0.1.2
   Compiling serde_tokenstream v0.1.7
   Compiling serde_with v1.14.0
   Compiling candid v0.10.6
   Compiling ic-canister-log v0.2.0 (/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/rust_canisters/canister_log)
   Compiling ic-stable-structures v0.6.4
   Compiling cargo_metadata v0.14.2
   Compiling futures-util v0.3.30
   Compiling json5 v0.4.1
   Compiling mockall v0.11.4
   Compiling build-info-build v0.0.27 (https://github.com/dfinity-lab/build-info?rev=701a696844fba5c87df162fbbc1ccef96f27c9d7#701a6968)
   Compiling build-info-proc v0.0.27 (https://github.com/dfinity-lab/build-info?rev=701a696844fba5c87df162fbbc1ccef96f27c9d7#701a6968)
   Compiling ic-nervous-system-common v0.9.0 (/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/nervous_system/common)
   Compiling cycles-minting-canister v0.9.0 (/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/nns/cmc)
   Compiling ic-protobuf v0.9.0 (/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/rs/protobuf)
error: linking with `cc` failed: exit status: 1
  |
  = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/Users/myspace/Library/Application Support/org.dfinity.dfx/versions/0.16.1:/Users/myspace/google-cloud-sdk/bin:/Users/myspace/.rbenv/shims:/Users/myspace/.rbenv/bin:/usr/local/opt/tcl-tk/bin:/Users/myspace/.nvm/versions/node/v18.12.1/bin:/Users/myspace/opt/anaconda3/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/myspace/google-cloud-sdk/bin:/Users/myspace/.rbenv/shims:/Users/myspace/.rbenv/bin:/usr/local/opt/tcl-tk/bin:/Users/myspace/.nvm/versions/node/v18.12.1/bin:/Users/myspace/opt/anaconda3/bin:/Users/myspace/.cargo/bin:/Users/myspace/Library/Application Support/org.dfinity.dfx/bin" VSLANG="1033" ZERO_AR_DATE="1" "cc" "-arch" "arm64" "/var/folders/lc/ptw97m4j7zg_snmcgx_pj1_40000gn/T/rustcCXnXXp/symbols.o" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/build/ic-nervous-system-common-43024c43db24c6ee/build_script_build-43024c43db24c6ee.build_script_build.ea1fbd3625ed5515-cgu.0.rcgu.o" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/build/ic-nervous-system-common-43024c43db24c6ee/build_script_build-43024c43db24c6ee.2v1xzluwkhon6veh.rcgu.o" "-L" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps" "-L" "/usr/local/Cellar/xz/5.4.3/lib" "-L" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libbuild_info_build-2e381366c17baa33.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libglob-78cdccf79f504091.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libserde_json-c413a2b2b93667fd.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libryu-911676a07069aff6.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libitoa-a2938f122bb2db80.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libbincode-21567a6837ce58b9.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/liblazy_static-fc9688d3d88ac0c8.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libspin-56abbb63af8119f1.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libanyhow-eae80404ecdbf5b8.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/librustc_version-9418f12b96bb0be6.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libxz2-78df795ca783921e.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/liblzma_sys-4668aa56f16d9926.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/liblibc-cb4f5418718202ae.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libbase64-07f9b76e26059784.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libbuild_info_common-3c302fa1034790c1.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libsemver-ace261dfb500bd0f.rlib" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libserde-9b99873922da2877.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd-5a416d22eb834453.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libpanic_unwind-34cbca7d446a7dbe.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libobject-67b28e97c3bccf6f.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libmemchr-65f22f7356ad1bde.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-1dc88d69604ffec4.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-0e0075c91f97c3a7.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-f8d63a9735955de6.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-7775b375d2e86954.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-44e9fde8456f7bc5.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-212481e0bc40a704.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libminiz_oxide-01055f979d05f279.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libadler-e2323f5313814830.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-9c19b78ac041eb7f.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-833ac996cbe25600.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-3401e9c5ee035758.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-a54fcdb9c76f0d03.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-c88d60982dfae036.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-83deb947260652c5.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-75ceb14b5d550d7c.rlib" "-llzma" "-liconv" "-lSystem" "-lc" "-lm" "-L" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/build/ic-nervous-system-common-43024c43db24c6ee/build_script_build-43024c43db24c6ee" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: warning: ignoring file '/usr/local/Cellar/xz/5.4.3/lib/liblzma.5.dylib': found architecture 'x86_64', required architecture 'arm64'
          ld: Undefined symbols:
            _lzma_code, referenced from:
                xz2::stream::Stream::process::h18660e5924af1c3b in libxz2-78df795ca783921e.rlib[3](xz2-78df795ca783921e.xz2.178a314e25eed38a-cgu.0.rcgu.o)
            _lzma_easy_encoder, referenced from:
                xz2::stream::Stream::new_easy_encoder::h404c47138cfc1fd4 in libxz2-78df795ca783921e.rlib[3](xz2-78df795ca783921e.xz2.178a314e25eed38a-cgu.0.rcgu.o)
            _lzma_end, referenced from:
                _$LT$xz2..stream..Stream$u20$as$u20$core..ops..drop..Drop$GT$::drop::h973dac7a8b6953db in libxz2-78df795ca783921e.rlib[3](xz2-78df795ca783921e.xz2.178a314e25eed38a-cgu.0.rcgu.o)
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: linking with `cc` failed: exit status: 1
  |
  = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/Users/myspace/Library/Application Support/org.dfinity.dfx/versions/0.16.1:/Users/myspace/google-cloud-sdk/bin:/Users/myspace/.rbenv/shims:/Users/myspace/.rbenv/bin:/usr/local/opt/tcl-tk/bin:/Users//

...

rustlib/aarch64-apple-darwin/lib/liballoc-a54fcdb9c76f0d03.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-c88d60982dfae036.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-83deb947260652c5.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-75ceb14b5d550d7c.rlib" "-llzma" "-liconv" "-lSystem" "-lc" "-lm" "-L" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/build/cycles-minting-canister-3f87476885ceccaa/build_script_build-3f87476885ceccaa" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: ld: warning: ignoring file '/usr/local/Cellar/xz/5.4.3/lib/liblzma.5.dylib': found architecture 'x86_64', required architecture 'arm64'
          ld: Undefined symbols:
            _lzma_code, referenced from:
                xz2::stream::Stream::process::h18660e5924af1c3b in libxz2-78df795ca783921e.rlib[3](xz2-78df795ca783921e.xz2.178a314e25eed38a-cgu.0.rcgu.o)
            _lzma_easy_encoder, referenced from:
                xz2::stream::Stream::new_easy_encoder::h404c47138cfc1fd4 in libxz2-78df795ca783921e.rlib[3](xz2-78df795ca783921e.xz2.178a314e25eed38a-cgu.0.rcgu.o)
            _lzma_end, referenced from:
                _$LT$xz2..stream..Stream$u20$as$u20$core..ops..drop..Drop$GT$::drop::h973dac7a8b6953db in libxz2-78df795ca783921e.rlib[3](xz2-78df795ca783921e.xz2.178a314e25eed38a-cgu.0.rcgu.o)
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `ic-nervous-system-common` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `cycles-minting-canister` (build script) due to 1 previous error
error: linking with `cc` failed: exit status: 1
  |
  = note: env -u IPHONEOS_DEPLOYMENT_TARGET -u TVOS_DEPLOYMENT_TARGET LC_ALL="C" PATH="/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/bin:/Users/myspace/Library/Application Support/org.dfinity.dfx/versions/0.16.1:/Users/myspace/google-cloud-sdk/bin:/Users/myspace/.rbenv/shims:/Users/myspace/.rbenv/bin:/usr/local/opt/tcl-tk/bin:/Users/


...

libmemchr-65f22f7356ad1bde.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libaddr2line-1dc88d69604ffec4.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libgimli-0e0075c91f97c3a7.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_demangle-f8d63a9735955de6.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libstd_detect-7775b375d2e86954.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libhashbrown-44e9fde8456f7bc5.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_alloc-212481e0bc40a704.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libminiz_oxide-01055f979d05f279.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libadler-e2323f5313814830.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libunwind-9c19b78ac041eb7f.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcfg_if-833ac996cbe25600.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liblibc-3401e9c5ee035758.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/liballoc-a54fcdb9c76f0d03.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/librustc_std_workspace_core-c88d60982dfae036.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcore-83deb947260652c5.rlib" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib/libcompiler_builtins-75ceb14b5d550d7c.rlib" "-llzma" "-liconv" "-lSystem" "-lc" "-lm" "-L" "/Users/myspace/.rustup/toolchains/1.77.1-aarch64-apple-darwin/lib/rustlib/aarch64-apple-darwin/lib" "-o" "/Users/myspace/Workspace/Cloned_Dfinity_Projects/ic/target/release/deps/libbuild_info_proc-655fdfa76d137d39.dylib" "-Wl,-dead_strip" "-dynamiclib" "-Wl,-dylib" "-nodefaultlibs"
  = note: ld: warning: ignoring file '/usr/local/Cellar/xz/5.4.3/lib/liblzma.5.dylib': found architecture 'x86_64', required architecture 'arm64'
          ld: Undefined symbols:
            _lzma_code, referenced from:
                xz2::stream::Stream::process::h18660e5924af1c3b in libxz2-78df795ca783921e.rlib[3](xz2-78df795ca783921e.xz2.178a314e25eed38a-cgu.0.rcgu.o)
            _lzma_end, referenced from:
                _$LT$xz2..stream..Stream$u20$as$u20$core..ops..drop..Drop$GT$::drop::h973dac7a8b6953db in libxz2-78df795ca783921e.rlib[3](xz2-78df795ca783921e.xz2.178a314e25eed38a-cgu.0.rcgu.o)
            _lzma_stream_decoder, referenced from:
                xz2::stream::Stream::new_stream_decoder::h783ab9cd7bff5da0 in libxz2-78df795ca783921e.rlib[3](xz2-78df795ca783921e.xz2.178a314e25eed38a-cgu.0.rcgu.o)
          clang: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `build-info-proc` (lib) due to 1 previous error
Error: Failed while trying to build all canisters.
Caused by: Failed while trying to build all canisters.
  The build step failed for canister 'bkyz2-fmaaa-aaaaa-qaaaq-cai' (root) with an embedded error: Failed to build custom canister root.: Failed to run cargo build --target wasm32-unknown-unknown --release -p ic-nns-handler-root.: The custom tool failed.
2 Likes

Partially. The first way is to use --version <version> when installing the nns extension so you can get a more up-to-date version. The second one is to replace the cached wasms with more current ones (they are located at $(dfx cache show)/wasms, although if init args changed (they rarely do but it can happen) then it may not be able to install the newer wasms anymore

Easier way: download the already built wasms. You can see how the extension does it here, the wasm names are defined here.

1 Like

Just attempted to download the root wasm from this commit chore: early access control in change_canister_controllers of NNS root · dfinity/ic@bcae09b · GitHub

I used this url https://download.dfinity.systems/ic/bcae09b7972235086cd4880e5fa47dc34721b041/canisters/root-canister.wasm.gz

It looks like it’s tagged as a release, but I’m getting an Access Denied response.

I then found @jennifertran 's response here and tried https://download.dfinity.systems/ic/bb76748d1d225c08d88037e99ca9a066f97de496/canisters/root-canister.wasm.gz, and this time the download worked! I guess not every commit is published - is there a directory of all the commits where these nns canister wasms are published?

Maybe you “just” tried to download an old version that isn’t available anymore. If I remember correcty, files older than 6 months are dropped.

This commit is from 3 days ago though?

Ah! Then it’s because the commit has not yet been proposed on mainnet I would guess.

I get this error when trying to install the nns version coupled with dfx 0.19.0 and 0.20.0

% dfx extension install nns --version 0.20.0
Error: Cannot decompress extension archive (downloaded from: 'https://github.com/dfinity/dfx-extensions/releases/download/nns-v0.20.0/nns-x86_64-apple-darwin.tar.gz'): failed to iterate over archive

Another one of the issues with the second option is that the dfx nns import command populates and overwrites the nns canisters in the dfx.json, so if I want to specify a custom wasm for the nns-root that config gets overwritten during our CI process.

I scripted up a solution that overwrites the overwrite :sweat_smile:

All the rc--<date> (rc is for Release Candidate) branches have downloadable files as long as they are not too old. And any elected version especially (see on the dashboard) should have downloadable files, with exception of not yet published hotfixes.

Extension versions don’t correspond to dfx versions. The latest one is 0.4.0. You can check over here what the latest one is

1 Like

@Severin What would this be for the latest SNS release. I can’t seem to find the latest commit hash for a sns_root wasm from
download.dfinity.systems/ic/<which_ic_commit_hash_is_latest_sns_release>/canisters/root-sns-root-canister.wasm.gz

The SNS Root had some declarations change in early April and they aren’t showing up in my candid declaration files when attempting to install this via the sns dfx extension.

dfx extension install sns --version 0.4.0
dfx sns install

For example, this produces a sns_root.did file containing the following:

...
type CanisterIdRecord = record { canister_id : principal };
type CanisterStatusResult = record {
  status : CanisterStatusType;
  memory_size : nat;
  cycles : nat;
  settings : DefiniteCanisterSettings;
  module_hash : opt vec nat8;
};
type CanisterStatusResultV2 = record {
  status : CanisterStatusType;
  memory_size : nat;
  cycles : nat;
  settings : DefiniteCanisterSettingsArgs;
  idle_cycles_burned_per_day : nat;
  module_hash : opt vec nat8;
};
type DefiniteCanisterSettings = record { controllers : vec principal };
type DefiniteCanisterSettingsArgs = record {
  freezing_threshold : nat;
  controllers : vec principal;
  memory_allocation : nat;
  compute_allocation : nat;
};
...
service : (SnsRootCanister) -> {
  canister_status : (CanisterIdRecord) -> (CanisterStatusResult);
  ...
}

As you can see in the candid file above, the CanisterStatusResult has a “V2” type, but it wasn’t updated in the declarations for the canister_status API.

I think you got the wrong wasm name. It is defined here as sns-root-canister.wasm but in your URL it’s root-sns-root-canister.wasm.gz.

https://download.dfinity.systems/ic/b6b2ef469bb00d38b48b789cae91251f27011b82/canister/sns-root-canister.wasm.gz (given the latest hash from Releases - ICP Dashboard) downloaded the wasm for me. It also redirected me to .../root-sns-root-canister.wasm.gz, which I don’t understand. Maybe that’s where you got the invalid URL from?

Ah, yea I must have pasted the redirect. I got the sns-root-canister.wasm.gz from here

I’m getting a 403 at the url you provided. Am I missing something?

Ah, I messed it up again… Here’s the definition of the URL pattern. It’s canisters, not canister.

https://download.dfinity.systems/ic/b6b2ef469bb00d38b48b789cae91251f27011b82/canisters/sns-root-canister.wasm.gz