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

build ink-example /trait-dyn-cross-contract-calls fail #24

Open
lyh169 opened this issue Jun 7, 2023 · 1 comment
Open

build ink-example /trait-dyn-cross-contract-calls fail #24

lyh169 opened this issue Jun 7, 2023 · 1 comment

Comments

@lyh169
Copy link

lyh169 commented Jun 7, 2023

cd trait-dyn-cross-contract-calls/contracts/incrementer
cargo contract build
the error is :
Compiling trait-incrementer v4.0.0 (/private/var/folders/q3/qpr18mtx5pzdfzdp282189gw0000gn/T/cargo-contract_LdIgay/contracts/incrementer) error: the#[global_allocator]` in ink_allocator conflicts with global allocator in: ink_allocator

error[E0152]: duplicate lang item in crate ink_env (which ink depends on): panic_impl.
|
= note: the lang item is first defined in crate ink_env (which ink depends on)
= note: first definition in ink_env loaded from /Volumes/E/project/github.com/paritytech/ink-examples/trait-dyn-cross-contract-calls/target/ink/trait_incrementer/wasm32-unknown-unknown/release/deps/libink_env-732c71f7eb8a9501.rlib, /Volumes/E/project/github.com/paritytech/ink-examples/trait-dyn-cross-contract-calls/target/ink/trait_incrementer/wasm32-unknown-unknown/release/deps/libink_env-732c71f7eb8a9501.rmeta
= note: second definition in ink_env loaded from /Volumes/E/project/github.com/paritytech/ink-examples/trait-dyn-cross-contract-calls/target/ink/trait_incrementer/wasm32-unknown-unknown/release/deps/libink_env-d25c2c37eb82aaca.rlib, /Volumes/E/project/github.com/paritytech/ink-examples/trait-dyn-cross-contract-calls/target/ink/trait_incrementer/wasm32-unknown-unknown/release/deps/libink_env-d25c2c37eb82aaca.rmeta

`

the Cargo.toml is as follow; I modity the ink = { path = "/Volumes/E/project/github.com/paritytech/ink/crates/ink", default-features = false };
`
[package]
name = "trait-incrementer"
version = "4.0.0"
authors = ["Parity Technologies admin@parity.io"]
edition = "2021"
publish = false

[dependencies]
ink = { path = "/Volumes/E/project/github.com/paritytech/ink/crates/ink", default-features = false }
#ink = { path = "../../../../crates/ink", default-features = false }
`
So how can i build this contract。 @cmichi thanks

@lyh169
Copy link
Author

lyh169 commented Jun 7, 2023

cd trait-dyn-cross-contract-calls/contracts/incrementer cargo contract build the error is : Compiling trait-incrementer v4.0.0 (/private/var/folders/q3/qpr18mtx5pzdfzdp282189gw0000gn/T/cargo-contract_LdIgay/contracts/incrementer) error: the#[global_allocator]` in ink_allocator conflicts with global allocator in: ink_allocator

error[E0152]: duplicate lang item in crate ink_env (which ink depends on): panic_impl. | = note: the lang item is first defined in crate ink_env (which ink depends on) = note: first definition in ink_env loaded from /Volumes/E/project/github.com/paritytech/ink-examples/trait-dyn-cross-contract-calls/target/ink/trait_incrementer/wasm32-unknown-unknown/release/deps/libink_env-732c71f7eb8a9501.rlib, /Volumes/E/project/github.com/paritytech/ink-examples/trait-dyn-cross-contract-calls/target/ink/trait_incrementer/wasm32-unknown-unknown/release/deps/libink_env-732c71f7eb8a9501.rmeta = note: second definition in ink_env loaded from /Volumes/E/project/github.com/paritytech/ink-examples/trait-dyn-cross-contract-calls/target/ink/trait_incrementer/wasm32-unknown-unknown/release/deps/libink_env-d25c2c37eb82aaca.rlib, /Volumes/E/project/github.com/paritytech/ink-examples/trait-dyn-cross-contract-calls/target/ink/trait_incrementer/wasm32-unknown-unknown/release/deps/libink_env-d25c2c37eb82aaca.rmeta

`

the Cargo.toml is as follow; I modity the ink = { path = "/Volumes/E/project/github.com/paritytech/ink/crates/ink", default-features = false }; ` [package] name = "trait-incrementer" version = "4.0.0" authors = ["Parity Technologies admin@parity.io"] edition = "2021" publish = false

[dependencies] ink = { path = "/Volumes/E/project/github.com/paritytech/ink/crates/ink", default-features = false } #ink = { path = "../../../../crates/ink", default-features = false } ` So how can i build this contract。 @cmichi thanks

i modify the ink = { path = "../../../../crates/ink", default-features = false } to ink = { version = "4.2", default-features = false } that it can work

0xf333 added a commit to 0xf333/ink-examples that referenced this issue Aug 8, 2023
Description
===========
The build process for some contracts was failing due
to issues in certain Cargo.toml files.

Changes
=======
- Commented out `crate-type` in `Cargo.toml` files.
  There's a conflict with this setting when using
  the updated version of the Ink contract compiler.

- Added `no_main` attribute in `lib.rs`. This was
  missing in some contracts, and the updated version
  of the compiler is printing warning messages when
  it's missing.

This commit addresses issue use-ink#24
0xf333 added a commit to 0xf333/ink-examples that referenced this issue Aug 10, 2023
Description
===========
The build process for some contracts was failing due
to issues in certain Cargo.toml files.

Changes
=======
- Commented out `crate-type` in `Cargo.toml` files.
  There's a conflict with this setting when using
  the updated version of the Ink contract compiler.

- Added `no_main` attribute in `lib.rs`. This was
  missing in some contracts, and the updated version
  of the compiler is printing warning messages when
  it's missing.

This commit addresses issue use-ink#24
0xf333 added a commit to 0xf333/ink-examples that referenced this issue Aug 10, 2023
Description
===========
The build process for some contracts was failing due
to issues in certain Cargo.toml files.

Changes
=======
- Commented out `crate-type` in `Cargo.toml` files.
  There's a conflict with this setting when using
  the updated version of the Ink contract compiler.

- Added `no_main` attribute in `lib.rs`. This was
  missing in some contracts, and the updated version
  of the compiler is printing warning messages when
  it's missing.

This commit addresses issue use-ink#24
0xf333 added a commit to 0xf333/ink-examples that referenced this issue Aug 10, 2023
Description
===========
The build process for some contracts was failing due
to issues in certain Cargo.toml files.

Changes
=======
- Commented out `crate-type` in `Cargo.toml` files.
  There's a conflict with this setting when using
  the updated version of the Ink contract compiler.

- Added `no_main` attribute in `lib.rs`. This was
  missing in some contracts, and the updated version
  of the compiler is printing warning messages when
  it's missing.

This commit addresses issue use-ink#24
0xf333 added a commit to 0xf333/ink-examples that referenced this issue Aug 10, 2023
Description
===========
The build process for some contracts was failing due
to issues in certain Cargo.toml files.

Changes
=======
- Commented out `crate-type` in `Cargo.toml` files.
  There's a conflict with this setting when using
  the updated version of the Ink contract compiler.

- Added `no_main` attribute in `lib.rs`. This was
  missing in some contracts, and the updated version
  of the compiler is printing warning messages when
  it's missing.

This commit addresses issue use-ink#24
0xf333 added a commit to 0xf333/ink-examples that referenced this issue Aug 12, 2023
Description
===========
The build process for some contracts was failing due
to issues in certain Cargo.toml files.

Changes
=======
- Commented out `crate-type` in `Cargo.toml` files.
  There's a conflict with this setting when using
  the updated version of the Ink contract compiler.

- Added `no_main` attribute in `lib.rs`. This was
  missing in some contracts, and the updated version
  of the compiler is printing warning messages when
  it's missing.

This commit addresses issue use-ink#24
SkymanOne pushed a commit that referenced this issue Aug 14, 2023
fix: address build failures in some contracts (#24)
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

No branches or pull requests

1 participant