soroban-cli
soroban-cli copied to clipboard
`contract init` is broken and test coverage needed
What version are you using?
Latest (aba5bdd)
What did you do?
Run contract init
and then try to build all contracts
What did you see instead?
- "Broken" examples hierarchy. When cloning multi-dir contracts (e.g. cross_contract) it results into error message on init
Error reading Cargo.toml file in: "test-dir/contracts/cross_contract"error: Io error: No such file or directory (os error 2)
(trying to readCargo.toml
from parent instead of children) - Trying to build multi-dir contracts will also fail, because in template we have members defined as
members = [
"contracts/*", # Should be contracts/cross_contract/contract_a
]
- Links to dependent contracts are also broken. If I clone
atomic_swap
+amotic_mulsitwap
I need to buildatomic_swap
first (which is not an issue) and it workscargo run contract build --manifest-path test_2/contracts/atomic_swap/Cargo.toml --out-dir ~/wasm/
But when I try to buildatomic_multiswap
(which depends on atomic_swap) I get an issue with file not found. It references contract assuming it's located in atomic_swap target's dir, while in fact it's now a multi-workspace environment and target dir is not in a workspace root anymore (it's in parent's WS root) So I need to go into the source code and change it. (../../atomic_swap/target/...
->../../target/...
)
Please add test coverage after fixing this issue