Wrong canister principals are generated by `dfx generate` and other
Wrong canister principals are generated by dfx generate, if canisters were not created/deployed before calling generate. For more details see here.
The bug seems repeatable by DFX 0.19.0.
The bug also appears in my PR https://github.com/dfinity/sdk/pull/3710. After this PR, the bug appears not only in dfx generate, but also in dfx deploy (and probably dfx build). Meanwhile, if I did testing right, in 0.19.0 it appears only for dfx generate.
I tried the following:
- Start DFX
- run
dfx generatein an ICP software folder.
I expected to see this happen: dfx generate to bail out like dfx build does in this situation.
Instead, this happened: Wrong canister principals are put into .dfx/local/lsp/.
This bug happens not only on dfx generate. The following also caused it:
for i in main order personhood payments pst CanDBIndex NacDBIndex CanDBPartition NacDBPartition ic_eth internet_identity; do dfx deploy -vv $i; done
in https://github.com/vporton/zondirectory2 repo
I determined that this bug happens even without generate in branch build-only-necessary, not the upstream master branch.
The branch build-only-necessary-dev contains the test wrong_ids.bash that seems to reliably reprise this bug.