Skip to content

docs(AGENTS.md): test.sh over Makefile, ic-cdk 0.20 guidance, Rust env vars#1422

Merged
marc0olo merged 5 commits into
masterfrom
chore/update-agents-md-rust-bash-tests
Jun 17, 2026
Merged

docs(AGENTS.md): test.sh over Makefile, ic-cdk 0.20 guidance, Rust env vars#1422
marc0olo merged 5 commits into
masterfrom
chore/update-agents-md-rust-bash-tests

Conversation

@marc0olo

@marc0olo marc0olo commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

Updates AGENTS.md with lessons learned during the Rust migration wave (PRs #1393#1421).

Changes

test.sh replaces Makefile

  • Rename the ## Makefile section to ## test.sh with a bash script template
  • #!/usr/bin/env bash + set -e; plain $var syntax; no $$/\\/@ overhead
  • Add delta-based balance check pattern (before/after) for idempotency across re-runs
  • Update CI workflow template and README structure template to use bash test.sh
  • Update migration checklist accordingly
  • Topup: no longer a Makefile target — document icp canister top-up --amount 30t backend directly in the README; note that 30t is an example amount, not a fixed requirement

Image versions

  • Pin all three images to 1.0.1 in the CI workflow template (motoko, rust, all)
  • Note that icp-dev-env-rust:1.0.1 is the minimum for ic-cdk ≥ 0.19 (earlier images bundle candid-extractor 0.1.4 which fails on ic0::cost_call)
  • Update the pending items section to show 1.0.1 as the current pinned version

Rust-specific additions

  • Always use ic-cdk = "0.20"; ic-ledger-types 0.16 required for 0.20 compat (0.15 + 0.20 causes ic-cdk-executor links conflict)
  • ic_cdk::export_candid!() is required at the end of every Rust canister lib.rs — without it, candid-extractor cannot find get_candid_pointer and the build fails
  • ic_cdk::api::env_var_value("VAR") for runtime env vars — not env!() (compile-time) or std::env::var() (no OS env in WASM)

🤖 Generated with Claude Code

Makefile → test.sh:
- Rename section and update all templates/checklist references
- Use #!/usr/bin/env bash + set -e; plain $var syntax; no @/$$
- Add delta-based balance check pattern for idempotency
- Update CI workflow template and README structure template

Rust additions:
- Always use ic-cdk 0.20; ic-ledger-types 0.16 required for 0.20 compat
  (0.15 + 0.20 causes ic-cdk-executor links conflict)
- ic_cdk::export_candid!() required at end of every lib.rs
- icp-dev-env-rust:1.0.1+ required (0.1.4 candid-extractor fails on
  ic0::cost_call imported by ic-cdk ≥ 0.19)
- ic_cdk::api::env_var_value for runtime env vars (not env!() or
  std::env::var())

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo requested a review from a team as a code owner June 17, 2026 16:37
@marc0olo marc0olo merged commit d9c1641 into master Jun 17, 2026
5 checks passed
@marc0olo marc0olo deleted the chore/update-agents-md-rust-bash-tests branch June 17, 2026 16:51
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