chore: migrate rust/low_wasm_memory to icp-cli#1393
Merged
Conversation
lwshang
approved these changes
Jun 17, 2026
Member
Author
|
@michael-weigelt switched to bash for the test scripts now. |
This was referenced Jun 17, 2026
cafa279 to
8f077c8
Compare
Replaces dfx.json with icp.yaml, moves canister source from src/low_wasm_memory_hook/ to backend/, adds Makefile with configure+test targets using icp-cli, updates CI to use icp-dev-env-rust:1.0.0, and removes the legacy dfx-based workflow. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
candid-extractor 0.1.4 (in 1.0.0) fails on ic-cdk 0.20 WASMs that import ic0::cost_call. Fixed in 1.0.1 (candid-extractor 0.1.6). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Aligns with the canonical layout used in rust/backend_only and other migrated examples (path = "lib.rs" directly in backend/). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…patibility Convert the Makefile configure+test targets into a single test.sh bash script. No logic changes — same memory limit config and 60s polling loop. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ompatibility Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…st script Move wasm_memory_limit (5mib) and wasm_memory_threshold (2mib) from the icp canister settings update call in test.sh into icp.yaml settings, so the canister is deployed with the correct limits from the start. This makes the configuration self-documenting and removes the separate configure step from both Motoko and Rust test scripts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both READMEs previously described test.sh as configuring memory limits. Now the limits are in icp.yaml (applied at deploy time), so the README explains that, and test.sh is described as just polling. Also adds missing Node.js prerequisite to the Rust README. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… configure step The Motoko runtime temporarily peaks above 5 MiB during canister installation (GC has not yet run), so wasm_memory_limit: 5mib in icp.yaml causes installation to fail with IC0539. The Rust canister starts at ~1.5 MiB and works fine with icp.yaml settings. For Motoko, the settings must be applied post-deployment via icp canister settings update, once memory has settled to ~2.3 MiB. README updated to explain this difference. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… highlight runtime difference Motoko's GC/heap temporarily peaks at ~5.3 MiB during installation, requiring wasm_memory_limit: 8mib (vs 5mib for Rust). Both examples now configure memory limits entirely in icp.yaml; test.sh is a pure polling script. Both READMEs note the difference: Rust starts at ~1.5 MiB (5 MiB limit works), Motoko starts at ~5.3 MiB peak during init (needs 8 MiB). This is a genuine educational insight about the two runtimes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both examples now use wasm_memory_limit: 8mib and wasm_memory_threshold: 2mib. Removed approximations about starting memory sizes from READMEs and test.sh comments — only state what is known for certain from icp.yaml. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
michael-weigelt
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates
rust/low_wasm_memoryfrom dfx to icp-cli, aligned withmotoko/low_wasm_memory. Also converts the Motoko example's Makefile to a bash script for consistency.Removed:
dfx.json, bothMakefilefiles, oldrust-low_wasm_memory-example.ymlChanged:
icp.yaml(Rust): replacesdfx.json; uses@dfinity/rust@v3.3.0backend/lib.rs: source moved fromsrc/low_wasm_memory_hook/; package renamed tobackend; attribute macros updated to modernic_cdk::proc-macro stylerust-toolchain.toml: added withwasm32-unknown-unknowntargetwasm_memory_limit: 8mib,wasm_memory_threshold: 2mib) moved from test scripts intoicp.yamlsettings for both Rust and Motoko — applied at deploy time, no separate configure step neededrust/low_wasm_memory/test.sh(replacesMakefile): pollsget_executed_functions_orderup to 60s forOnLowWasmMemorymotoko/low_wasm_memory/test.sh(replacesMakefile): same structure, Motoko naming (getExecutedFunctionsOrder/onLowWasmMemory)README.md(both): updated tobash test.sh; documents the configured limitslow_wasm_memory.yml— both jobs usebash test.sh; imagesicp-dev-env-rust:1.0.1andicp-dev-env-motoko:1.0.1Alignment with motoko/low_wasm_memory: Both examples use identical memory limits and the same polling test structure. Naming differences are idiomatic per language (snake_case Rust vs camelCase Motoko).
Test plan
icp network start -d && icp deploy && bash test.shpasses locally (Rust)icp network start -d && icp deploy && bash test.shpasses locally (Motoko)rust-low_wasm_memoryandmotoko-low_wasm_memorypass🤖 Generated with Claude Code