dfinity / dfinity/sdk

Cannot compile a non-created canister

Open
#4,085 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

needs-triage
Dominant language
Rust
Stars
204
Forks
98
PR merge metrics
No merged PRs in 30d

Description

Building canister is possible only after it's created. That's wrong, because the user may want for example receive WASM code of canister (e.g. for later installation, as I do in my IC package manager) without actually creating the canister.

This is especially bad on production where creating canister requires to spend funds.

I tried the following:

$ dfx new --no-frontend --type motoko build-bug
$ cd build-bug
$ dfx build build-bug-backend
Error: Cannot find canister id. Please issue 'dfx canister create build-bug-backend'.

I expected to see this happen: building the canister.

Instead, this happened: canister cannot be built.

Meta

dfx --version:

dfx 0.20.0-icsystemtest.0+rev636.dirty-76457e03

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue reproduces the problem with dfx build build-bug-backend after dfx new, and contrasts it with dfx canister create; start by reproducing those commands and tracing where the build requires a canister ID. Done means a canister can be built to obtain its WASM without creation, while the existing create-and-build workflow still works.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
blockchain, build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.