dex-v4 icon indicating copy to clipboard operation
dex-v4 copied to clipboard

Compilation errors in rust packages

Open blocksan opened this issue 2 years ago • 8 comments

I am trying to run the dex-v4 project on my local macbook machine but unable to get started.

I am using solana-install 1.13.5 (src:91384943; feat:1365939126)

Please let me know which right tools need to compile this project.

blocksan avatar Nov 25 '22 07:11 blocksan

Can you post the errors you have? Are you using a M1 or Intel machine?

dr497 avatar Nov 25 '22 07:11 dr497

Thank you for responding.

Here are the details of the current versions Yes I am using Macbook M1 solana-install 1.9.29 (src:0c54340a; feat:462418899)

cargo 1.65.0 (4bc8f24d3 2022-10-20)rustc 1.65.0 (897e37553 2022-11-02)

Errors I am receiving

error: failed to select a version for the requirement time = "^0.3" candidate versions found which didn't match: 0.3.15, 0.3.14, 0.3.13, ... location searched: crates.io index required by package rcgen v0.9.3 ... which satisfies dependency rcgen = "^0.9.2" (locked to 0.9.3) of package solana-streamer v1.10.34 ... which satisfies dependency solana-streamer = "=1.10.34" (locked to 1.10.34) of package solana-client v1.10.34 ... which satisfies dependency solana-client = "~1.10" (locked to 1.10.34) of package dex-v4 v0.3.0 (/Users/sandeepghosh/Documents/personal-projects/solana/dex-v4/program)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types --> /Users/sandeepghosh/.cargo/registry/src/github.com-1ecc6299db9ec823/asset-agnostic-orderbook-1.0.0/src/state/critbit.rs:40 :12 | 40 | pub struct LeafNode { | ^^^^^^^^ | = note: source type: LeafNode (256 bits) = note: target type: critbit::_::{closure#0}::TypeWithoutPadding (192 bits)

error[E0512]: cannot transmute between types of different sizes, or dependently-sized types --> /Users/sandeepghosh/.cargo/registry/src/github.com-1ecc6299db9ec823/asset-agnostic-orderbook-1.0.0/src/state/event_queue.rs:22 :12 | 22 | pub struct FillEvent { | ^^^^^^^^^ | = note: source type: FillEvent (384 bits) = note: target type: event_queue::_::{closure#0}::TypeWithoutPadding (320 bits)

Please help.

Thanks & Regards, Sandeep Ghosh, Building www.solgames.fun

On Fri, Nov 25, 2022 at 12:47 PM DR497 @.***> wrote:

Can you post the errors you have? Are you using a M1 machine?

— Reply to this email directly, view it on GitHub https://github.com/Bonfida/dex-v4/issues/94#issuecomment-1327100474, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBT525YA5IDHILFQWJHAFTWKBRXZANCNFSM6AAAAAASLA2QRE . You are receiving this because you authored the thread.Message ID: @.***>

blocksan avatar Nov 25 '22 10:11 blocksan

HI @blocksan, thanks for reporting this issue. What you are running is a known issue, and we intend to mainline a solution soon. We've ran into roadblocks because we don't have ready access to an M1 for testing. In the meantime, can you try the alpha channel for dex-v4? You can either find it in the alpha branch of this repo, or you can require the 0.3.1-alpha.0 version. I'll keep this issue open in case you run into any issue. Any feedback would be greatly appreciated since we'd like to finally solve this problem.

ellttBen avatar Nov 25 '22 14:11 ellttBen

Thank you for the clarification.

However, I cleaned up all my binaries and installations. Installed the latest version of toolchains for Solana.

I am receiving only 1 error Compiling dex-v4 v0.3.0 (../solana/dex-v4/program) error: the #[global_allocator] in this crate conflicts with global allocator in: mpl_token_metadata

I feel that this is more of a configuration issue, so if you can please help me with this.

Thanks & Regards, Sandeep Ghosh, Building www.solgames.fun

On Fri, Nov 25, 2022 at 8:24 PM ellttBen @.***> wrote:

HI @blocksan https://github.com/blocksan, thanks for reporting this issue. What you are running is a known issue, and we intend to mainline a solution soon. We've ran into roadblocks because we don't have ready access to an M1 for testing. In the meantime, can you try the alpha channel for dex-v4? You can either find it in the alpha branch of this repo, or you can require the 0.3.1-alpha.0 version. I'll keep this issue open in case you run into any issue. Any feedback would be greatly appreciated since we'd like to finally solve this problem.

— Reply to this email directly, view it on GitHub https://github.com/Bonfida/dex-v4/issues/94#issuecomment-1327600188, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBT52Z6RJOFMF4LOABA4SDWKDHJFANCNFSM6AAAAAASLA2QRE . You are receiving this because you were mentioned.Message ID: @.***>

blocksan avatar Nov 26 '22 10:11 blocksan

Hi, Just chiming in to say it's not even working on the alpha branch for me. Using an M1 too. any updates?

Dorax88 avatar Feb 27 '23 22:02 Dorax88

The new error on alpha branch is: error[E0308]: mismatched types --> src/processor/consume_events.rs:311:61 | 311 | let order_index = user_account.find_order_index(*order_id).unwrap(); | ---------------- ^^^^^^^^^ expectedu128, found array [u64; 2]``

Dorax88 avatar Feb 27 '23 22:02 Dorax88

Hi @Dorax88, thanks for reactivating the issue. I just pushed a fix for this error on the alpha branch and on crates.io with the version 0.3.1-alpha.2. Would you mind testing if this solves your issue? Once I get confirmation from you that this fixes the issue completely, I'll push a new release.

ellttBen avatar Feb 28 '23 19:02 ellttBen

current error on alpha branch- error: target is not supported, for more information see: https://docs.rs/getrandom/#unsupported-targets --> src/lib.rs:268:9 | 268 | / compile_error!("target is not supported, for more information see:
269 | | https://docs.rs/getrandom/#unsupported-targets"); | |________________________________________________________________________^

error[E0433]: failed to resolve: use of undeclared crate or module imp --> src/lib.rs:290:5 | 290 | imp::getrandom_inner(dest) | ^^^ use of undeclared crate or module imp

cryptohariseldon avatar Jul 25 '23 15:07 cryptohariseldon