Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when building contract with XCM. #1

Open
hbulgarini opened this issue Sep 8, 2022 · 4 comments · May be fixed by #8
Open

Error when building contract with XCM. #1

hbulgarini opened this issue Sep 8, 2022 · 4 comments · May be fixed by #8

Comments

@hbulgarini
Copy link

hbulgarini commented Sep 8, 2022

I'm trying to implement this xcm chain extension so we can put a simple contract that sends a XCM call.
The problem i'm facing is when i try to compile the contract with the given Cargo.toml, i get the following errors:

➜  ink git:(master) ✗ cargo +nightly contract build

....

error: the `#[global_allocator]` in ink_allocator conflicts with global allocator in: sp_io

error: duplicate lang item in crate `sp_io` (which `sp_application_crypto` depends on): `panic_impl`.
  |
  = note: the lang item is first defined in crate `ink_env` (which `flipper` depends on)
  = note: first definition in `ink_env` loaded from /Users/hectorb/blockchain/pallet-contracts-xcm/ink/target/ink/wasm32-unknown-unknown/release/deps/libink_env-0acca4fc7a95b368.rlib
  = note: second definition in `sp_io` loaded from /Users/hectorb/blockchain/pallet-contracts-xcm/ink/target/ink/wasm32-unknown-unknown/release/deps/libsp_io-7276ad9650247190.rlib, /Users/hectorb/blockchain/pallet-contracts-xcm/ink/target/ink/wasm32-unknown-unknown/release/deps/libsp_io-7276ad9650247190.rmeta

error: duplicate lang item in crate `sp_io` (which `sp_application_crypto` depends on): `oom`.
  |
  = note: the lang item is first defined in crate `ink_allocator` (which `ink_env` depends on)
  = note: first definition in `ink_allocator` loaded from /Users/hectorb/blockchain/pallet-contracts-xcm/ink/target/ink/wasm32-unknown-unknown/release/deps/libink_allocator-f7c621310e573610.rlib, /Users/hectorb/blockchain/pallet-contracts-xcm/ink/target/ink/wasm32-unknown-unknown/release/deps/libink_allocator-f7c621310e573610.rmeta
  = note: second definition in `sp_io` loaded from /Users/hectorb/blockchain/pallet-contracts-xcm/ink/target/ink/wasm32-unknown-unknown/release/deps/libsp_io-7276ad9650247190.rlib, /Users/hectorb/blockchain/pallet-contracts-xcm/ink/target/ink/wasm32-unknown-unknown/release/deps/libsp_io-7276ad9650247190.rmeta

error: could not compile `extension-xcm` due to 3 previous errors

Is there anything i'm not taking into account when building the contract? I have tried with many variants adding the xcm crate dependency from a new project using cargo contract new ..., but the error is the same.

Also it would be nice to know if there is there any working example of this extension where i can take references?

Thanks!

@hbulgarini
Copy link
Author

it seems the contract compile using the following set up for xcm crate:

xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.25" }

after release .25, i start receiving the error again.

@dzmitry-lahoda
Copy link

dzmitry-lahoda commented Nov 12, 2022

confirming issue. on 9.0.25 works. on master or 0.9.32 same compilation issue.
i build it in separate cosmwasm(cosmos contract).

repo https://github.com/ComposableFi/composable/tree/dz/cosmwasm/xcm-executor/cosmwasm/contracts/xcm-executor

@dzmitry-lahoda
Copy link

needs upgrade to v3 paritytech/polkadot#6276 (comment)

@pgherveou pgherveou linked a pull request Aug 3, 2023 that will close this issue
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 a pull request may close this issue.

3 participants