Skip to content

chore: migrate build tooling from dfx to icp-cli#236

Merged
marc0olo merged 12 commits intomainfrom
marc0olo/use-icp-cli
Mar 6, 2026
Merged

chore: migrate build tooling from dfx to icp-cli#236
marc0olo merged 12 commits intomainfrom
marc0olo/use-icp-cli

Conversation

@marc0olo
Copy link
Member

@marc0olo marc0olo commented Feb 16, 2026

Summary

  • Migrate build tooling from dfx to icp-cli, @icp-sdk/bindgen, and mops
  • Upgrade all Motoko canisters from mo:base to mo:core@2.0.0 with moc@1.2.0
  • Simplify superheroes superpowers type from linked list to vec text
  • Add Mops and Cargo caching to CI for faster builds

Changes

Build system:

  • Replace dfx.json with icp.yaml (10 canisters: 7 Motoko, 3 Rust)
  • Add mops.toml for Motoko toolchain and package management
  • Use @icp-sdk/bindgen (icp-bindgen) for TypeScript declaration generation
  • Hand-write .did files for all Motoko canisters (previously auto-generated by dfx)
  • Pin Rust recipe to dfinity/icp-cli-recipes@e083017 (fixes gzip compression on Linux)

Motoko upgrades:

  • All imports changed from mo:base/* to mo:core/*
  • phonebook.mo: HashMapMap
  • superheroes.mo: List.List<Text>[Text], TrieMap
  • Add interfaces/ modules for inter-canister calls in the multicanister example

CI (e2e-test-nodejs.yml):

  • Replace dfinity/setup-dfx with icp-cli + ic-wasm + ic-mops
  • Use mops install to pre-cache the Motoko compiler before parallel builds
  • Add actions/cache for Mops (toolchain + packages) and Cargo (registry + build artifacts)

Cleanup:

  • Delete dfx.json and dfx-generated actor wrappers (declarations/index.{js,d.ts})
  • Remove /.dfx/ from .gitignore, add /.icp/cache/ and /.mops/

@marc0olo marc0olo marked this pull request as ready for review February 17, 2026 11:46
@marc0olo marc0olo requested a review from a team as a code owner February 17, 2026 11:46
@marc0olo marc0olo force-pushed the marc0olo/use-icp-cli branch 2 times, most recently from 5165d93 to d432791 Compare March 3, 2026 08:46
@marc0olo marc0olo force-pushed the marc0olo/use-icp-cli branch from d432791 to efc4904 Compare March 3, 2026 09:04
@nikosxenakis
Copy link
Contributor

@marc0olo in general it looks good. Some minor comments to address.

marc0olo added 2 commits March 4, 2026 14:45
- Extract shared CI toolchain setup into composite action
- Replace individual build/generate/test scripts with shell scripts (scripts/build-example.sh, scripts/test-example.sh)
- Move canister configs into per-directory canister.yaml files, use glob patterns in icp.yaml
- Restructure multicanister example (phonebook/superheroes into subdirectories)
- Update all example READMEs with new commands, add missing icp_features entry, fix google_search title
@marc0olo marc0olo requested a review from nikosxenakis March 4, 2026 13:50
@marc0olo
Copy link
Member Author

marc0olo commented Mar 4, 2026

@nikosxenakis I addressed your feedback and made following (additional) changes:

  • Extracted shared CI toolchain setup into a composite action (.github/actions/setup-canister-toolchain/)
  • Consolidated all individual build:*, generate:*, and test:* scripts into scripts/build-example.sh and scripts/test-example.sh
  • Decentralized canister configs into per-directory canister.yaml files, reducing icp.yaml to glob patterns
  • Updated READMEs across all examples

Rename build-example.sh → build-examples.sh and test-example.sh →
test-examples.sh. Run example tests sequentially instead of in parallel
to avoid resource contention on macOS CI runners.
@marc0olo marc0olo added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit d077889 Mar 6, 2026
14 checks passed
@marc0olo marc0olo deleted the marc0olo/use-icp-cli branch March 6, 2026 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants