Version icpp 1.5.0 has been released, with these additions: (See the release notes.)
Support for CandidTypePrincipal
This is a big milestone and we had to make some important decisions. Support for the CandidTypePrincipal requires base32 decoding/encoding and CRC32 checksum. We evaluated several C++ libraries for this, and decided to integrate these amazing open source vendor libraries into icpp:
Many thanks to the authors of these two libraries. We decided on them because they are small & dedicated to a single functionality, they are mature, have a great balance of speed vs. readability, and most of all, have great documentation with implementation examples.
Integrating them requires compilation to WASM. The cppcodec library required a small change, replacing a few exceptions with IC’s trap, and hash-library compiled without any changes at all.
I tried following the quickstart guide, and got hung up with cppcodec.
➜ greet dfx deploy
...
/opt/homebrew/lib/python3.11/site-packages/icpp/ic/candid/candid_type_principal.cpp:8:10: fatal error: 'cppcodec/base32_rfc4648.hpp' file not found
#include "cppcodec/base32_rfc4648.hpp"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
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 'rrkah-fqaaa-aaaaa-aaaaq-cai' (greet) with an embedded error: Failed to build custom canister greet.: Failed to run icpp build-wasm.: The custom tool failed.
Time: 0h:00m:24s
For those of you who develop on Windows, we want to let you know that we fully support you with a windows based development environment.
Version 1.5.4 was just released, which fixed this issue related to the icpp install-wasi-sdk command, which detects your OS, downloads the proper wasi-sdk tar file, and install it in your .icpp folder in your home.
TLDR, you can now do the following on Windows in either a Powershell or a CMD window, identical to the way you would do it on Linux or Mac:
# install icpp
conda create --name test python==3.10
conda activate test
pip install icpp
# create the greet project
icpp init
cd greet
# build the wasm
icpp build-wasm
Next, we’re working on a seamless deploy experience to either the local or the main network. The dfx tool is not available on Windows, but we are looking at alternatives.
If you encounter any other issues on Windows or other platforms, please open an issue in the GitHub repo.