openbook-dex / openbook-v2

openbook-v2 monorepo, contains solana program and ts client
Other
132 stars 70 forks source link

Openbook v2 dependencies error integrations mango-v4 #261

Open Panda404NotFound opened 1 month ago

Panda404NotFound commented 1 month ago

**Greetings, I want to use mango-v4 project and I get the openbook v2 dependencies error.

workspace Cargo.toml:**

[workspace]
members = [ "lib/*",
    "programs/*"
]
resolver = "1"

[workspace.dependencies]
anchor-client = "=0.28.0"
anchor-spl = "=0.28.0"
anchor-lang = "=0.28.0"

solana-address-lookup-table-program = "~1.16.7"
solana-account-decoder = "~1.16.7"
solana-client = "~1.16.7"
solana-logger = "~1.16.7"
solana-program = "~1.16.7"
solana-program-test = "~1.16.7"
solana-rpc = "~1.16.7"
solana-sdk = { version = "~1.16.7", default-features = false }
solana-transaction-status = { version = "~1.16.7" }

mango-v4 = { git = "https://github.com/blockworks-foundation/mango-v4", features = ["client"] }

[profile.release]
overflow-checks = true

[patch.crates-io]
anchor-lang = { git = "https://github.com/coral-xyz/anchor", tag = "v0.28.0" }
anchor-spl = { git = "https://github.com/coral-xyz/anchor", tag = "v0.28.0" }
anchor-client = { git = "https://github.com/coral-xyz/anchor", tag = "v0.28.0" }

Programs Cargo.toml:

[package]
name = "solana-project"
version = "0.1.0"
description = "Created with Anchor"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "solana_project"

[features]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = ["custom-heap"]
test-bpf = ["client"]
client = ["solana-sdk", "no-entrypoint"]
custom-heap = []

[dependencies]
anchor-lang = { workspace = true }
anchor-spl = { workspace = true }

solana-address-lookup-table-program = { workspace = true }
solana-program = { workspace = true }
solana-sdk = { workspace = true, default-features = false, optional = true }

mango-v4 = { workspace = true, features = ["client"] }

[dev-dependencies]
solana-sdk = { workspace = true, default-features = false }
solana-program-test = { workspace = true }
spl-token = { version = "^3.0.0", features = ["no-entrypoint"] }
spl-associated-token-account = { version = "^1.0.3", features = [
    "no-entrypoint",
] }

Problem:

   Compiling openbook-v2 v0.1.0 (https://github.com/openbook-dex/openbook-v2.git?rev=270b2d2d473862bd4e3aa213feb970af81f4b3e2#270b2d2d)
error[E0119]: conflicting implementations of trait `Zeroable` for type `AnyEvent`
   --> /Users/a1111/.cargo/git/checkouts/openbook-v2-bb287b4bf73a7086/270b2d2/programs/openbook-v2/src/state/orderbook/heap.rs:220:32

Full error.docx

Panda404NotFound commented 1 month ago

I'm try to compile clear project and have same error. Try every version of releases, branch "feature/anchor-29" and always have same problem. What's wrong am i doing?

[features]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []

[dependencies]
openbook-v2 = { git = "https://github.com/openbook-dex/openbook-v2.git", rev
   = "270b2d2d473862bd4e3aa213feb970af81f4b3e2", features = ["client", "no-entry point", "cpi", "enable-gpl"], default-features=false }

ERROR:

    Checking openbook-v2 v0.1.0 (https://github.com/openbook-dex/openbook-v2.git?rev=270b2d2d473862bd4e3aa213feb970af81f4b3e2#270b2d2d)
error[E0119]: conflicting implementations of trait `Zeroable` for type `AnyEvent`
   --> /Users/a1111/.cargo/git/checkouts/openbook-v2-bb287b4bf73a7086/270b2d2/programs/openbook-v2/src/state/orderbook/heap.rs:220:32
riordanp commented 1 month ago

hi, which rust toolchain version are you using? should be working with rust >=1.69.0