GithubHelp home page GithubHelp logo

Comments (13)

mschneider avatar mschneider commented on July 18, 2024

from mango-v3.

dafyddd avatar dafyddd commented on July 18, 2024

I think the solana compiler comes with a rustc. And I use solana-cli 1.8 to compile and don't have any issues.

from mango-v3.

thanhngvpt avatar thanhngvpt commented on July 18, 2024

same error, I also tried with rustc 1.57.0-nightly (2021-09-07) same error. What wrong with me?

from mango-v3.

microwavedcola1 avatar microwavedcola1 commented on July 18, 2024

@thanhngvpt @buffalu are you guys using rosetta compatibility mode? m1 is my main driver, and havent had any issues so far

from mango-v3.

RohanKapurDEV avatar RohanKapurDEV commented on July 18, 2024

havent had any issues building on m1 either

from mango-v3.

sthornington avatar sthornington commented on July 18, 2024

The root cause of this is that mango (and switchboard) have #[repr(C)] for some account data structs (SwitchboardDecimal, *Node in matching.rs and *Event in queue.rs), but on ARM, the alignment of i128 is 16 bytes, vs 8 bytes for x86_64. These structs should all be #[repr(packed)] in my opinion, as they are in the serum dex examples.

from mango-v3.

sthornington avatar sthornington commented on July 18, 2024

In fact, it looks like SwitchboardDecimal is already packed in the latest...

from mango-v3.

sthornington avatar sthornington commented on July 18, 2024

@ckamm did you have any luck upgrading switchboard? I see you pinned the versions to older ones fairly recently...

from mango-v3.

ckamm avatar ckamm commented on July 18, 2024

Upgrading switchboard wasn't a priority so I haven't looked at it further. This PR has an upgrade though: #150

from mango-v3.

sthornington avatar sthornington commented on July 18, 2024

Gotcha. Yeah I haven’t gotten further enough to see whether switching all the account state structs to repr(packed) fixes everything else. I suspect one day everyone will be forced to switch to proper serdes using borsh rather than bytemuck casting.

from mango-v3.

smu160 avatar smu160 commented on July 18, 2024

I ran into the same issue, and I was able to rectify the issue with rustup by switching the active tool-chain.

You can confirm by running: rustup show. If you see stable-x86_64-apple-darwin (default) under active toolchain, you're good to go.

Otherwise, do as follows:

rustup default stable-x86_64-apple-darwin

Try it out:

cargo build

You should be able to build without any platform specific issues now.

from mango-v3.

sthornington avatar sthornington commented on July 18, 2024

Yes of course you can fix an issue with bad alignment on ARM by not compiling on ARM. 😀

from mango-v3.

namnh06 avatar namnh06 commented on July 18, 2024

I've got the same issue with Ubuntu 20.04
image
image

from mango-v3.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.