dfinity / examples

Example applications, microservices, and code samples for the Internet Computer
https://dfinity.org
Apache License 2.0
546 stars 393 forks source link

error could not compile `typenum` due to 160 previous errors #413

Closed troublesprouter closed 1 year ago

troublesprouter commented 1 year ago

When running

dfx deploy basic_bitcoin --argument '(variant { Regtest })'

at https://internetcomputer.org/docs/current/developer-docs/integrations/bitcoin/local-development

I'm getting

Some errors have detailed explanations: E0405, E0412, E0425, E0432, E0433, E0463.
For more information about an error, try rustc --explain E0405.
error: could not compile typenum due to 160 previous errors
warning: build failed, waiting for other jobs to finish...
Error: Failed while trying to deploy canisters.
Caused by: Failed while trying to deploy canisters.
  Failed to build call canisters.
    Failed while trying to build all canisters.
      The build step failed for canister 'rkp4c-7iaaa-aaaaa-aaaca-cai' (basic_bitcoin) with an embedded error: Failed to build custom canister basic_bitcoin.: Failed to run src/basic_bitcoin/build.sh.: The custom tool failed.
troublesprouter commented 1 year ago

@manudrijvers @sesi200

troublesprouter commented 1 year ago

The problem is only present for the Rust example.

sesi200 commented 1 year ago

error: could not compile typenum due to 160 previous errors

This looks to me like a problem with your Rust installation. Typenum is a rust crate that we don't control and that's simply a dependency for the code. It compiles without any problems on my machine

troublesprouter commented 1 year ago

I tried uninstalling Rust and installing it again from scratch but the problem persists.

I wonder if the problem is one step before, when running dfx start here: https://internetcomputer.org/docs/current/developer-docs/integrations/bitcoin/local-development

because instead of getting what you see here: https://youtu.be/H6Wu9n9Qwa8?t=283

I see instead

Running dfx start for version 0.12.1
Using the default definition for the 'local' shared network because /Users/user/.config/dfx/networks.json does not exist.

Do you know what may be going on? The local bitcoin network seems to be running. I see

2022-12-09T18:50:17Z opencon thread start
2022-12-09T18:50:17Z 0 addresses found from DNS seeds
2022-12-09T18:50:17Z dnsseed thread exit
2022-12-09T18:50:17Z init message: Done loading
2022-12-09T18:50:17Z msghand thread start
2022-12-09T18:51:18Z Adding fixed seeds as 60 seconds have passed and addrman is empty
2022-12-09T19:22:32Z Potential stale tip detected, will try using extra outbound peer (last tip update: 1890 seconds ago)
2022-12-09T19:33:02Z Potential stale tip detected, will try using extra outbound peer (last tip update: 2520 seconds ago)

on that terminal.

and dfx.json says

"bitcoin": {
      "enabled": true,
      "nodes": [
        "127.0.0.1:1844"
      ],
sesi200 commented 1 year ago

Answered here: https://forum.dfinity.org/t/error-in-deploying-your-first-bitcoin-dapp/14851/6