Failed to compile `ic-nns-init` binary

I want to run test in local, so i git clone the ic repo, then compiled and built canister sticking on https://github.com/dfinity/ic/blob/master/rs/nns/README.adoc. But i got when i compiled the ic-nns-init binary using cargo install --path ./:

   Compiling jemalloc-ctl v0.3.3
   Compiling ic-icos-sev v0.8.0 (/root/projects/ic/ic/rs/ic_os/sev)
error[E0433]: failed to resolve: could not find `SnpReportReq` in `types`
   --> rs/ic_os/sev/src/linux_amd64.rs:207:42
    |
207 |             sev::firmware::guest::types::SnpReportReq::new(Some(report_data), 0 /* VMPL0 */);
    |                                          ^^^^^^^^^^^^ could not find `SnpReportReq` in `types`

error[E0603]: module `types` is private
  --> rs/ic_os/sev/src/linux_amd64.rs:27:27
   |
27 | use sev::firmware::guest::types::AttestationReport;
   |                           ^^^^^ private module
   |
note: the module `types` is defined here
  --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/sev-1.2.0/src/firmware/guest/mod.rs:9:1
   |
9  | mod types;
   | ^^^^^^^^^

error[E0603]: module `types` is private
   --> rs/ic_os/sev/src/linux_amd64.rs:207:35
    |
207 |             sev::firmware::guest::types::SnpReportReq::new(Some(report_data), 0 /* VMPL0 */);
    |                                   ^^^^^ private module
    |
note: the module `types` is defined here
   --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/sev-1.2.0/src/firmware/guest/mod.rs:9:1
    |
9   | mod types;
    | ^^^^^^^^^

error[E0599]: no method named `snp_get_report` found for struct `sev::firmware::guest::Firmware` in the current scope
   --> rs/ic_os/sev/src/linux_amd64.rs:209:14
    |
209 |             .snp_get_report(None, &mut report_request)
    |              ^^^^^^^^^^^^^^ help: there is a method with a similar name: `get_report`

Some errors have detailed explanations: E0433, E0599, E0603.
For more information about an error, try `rustc --explain E0433`.
error: could not compile `ic-icos-sev` due to 4 previous errors
warning: build failed, waiting for other jobs to finish...
    Building [====================>  ] 1173/1242: ...

using master branch:

(base) root@DESKTOP-D2P8H7D:~/projects/ic/ic/rs/nns/init# git branch -a 
* master
  remotes/origin/HEAD -> origin/master

rustup version:

(base) root@DESKTOP-D2P8H7D:~/projects/ic/ic/rs/nns/init# rustup --version 
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.66.1 (90743e729 2023-01-10)`

How to run a full feature testnet in local to run e2e test?

Is there a specific reason why you want to compile it yourself? If you run dfx nns init it runs this exact binary. You can also find it in dfx cache show

ohhhhhhhh, missed this point. dfx nns * works perfect.

1 Like