Skip to content

rust-analyzer fails with ic_cdk_bindgen #442

@letmejustputthishere

Description

@letmejustputthishere

it seems like ic_cdk_bindgen expects an env variable set for the candid path. if you're not building with dfx, the env variables doens't seem to be present and the rust-analyzer VSCode plugin throws the following error:

[ERROR rust_analyzer::main_loop] FetchBuildDataError:
error: failed to run custom build command for `iluvatar_backend v0.1.0 (/Users/moritz/projects/iluvatar/src/iluvatar_backend)`
note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by:
  process didn't exit successfully: `/Users/moritz/projects/iluvatar/target/debug/build/iluvatar_backend-0919ac66e4da000e/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at /Users/moritz/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ic-cdk-bindgen-0.1.1/src/lib.rs:18:58:
  Cannot find candid path: NotPresent
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/std/src/panicking.rs:595:5
     1: core::panicking::panic_fmt
               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/panicking.rs:67:14
     2: core::result::unwrap_failed
               at /rustc/cc66ad468955717ab92600c770da8c1601a4ff33/library/core/src/result.rs:1652:5
     3: core::result::Result<T,E>::expect
     4: ic_cdk_bindgen::Config::new
     5: build_script_build::main
     6: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions