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

Disable JIT compiler on unsupported platforms #21215

Merged
merged 3 commits into from
Nov 9, 2021

Conversation

fanatid
Copy link
Contributor

@fanatid fanatid commented Nov 9, 2021

Problem

Right now only solana-test-validator checks JIT support and only for Windows, not for arch (x86_64 / arm). Developers need to pass --no-bpf-jit explicitly and sometimes this is hard because test validator is launched by other tools (for example anchor: coral-xyz/anchor#876).

Summary of Changes

  • Check platform and arch for JIT availability.
  • Move conditional compilation to lines where JIT flag is used.

Issues which will change conditional compilation when will be resolved: qmonnet/rbpf#48 solana-labs/rbpf#217

@mergify mergify bot added the community Community contribution label Nov 9, 2021
@mergify mergify bot requested a review from a team November 9, 2021 07:45
@mvines mvines added the v1.8 label Nov 9, 2021
@mvines mvines merged commit b4d0938 into solana-labs:master Nov 9, 2021
@mvines
Copy link
Member

mvines commented Nov 9, 2021

Thanks!

@fanatid fanatid deleted the bpf-jit branch November 9, 2021 11:31
mergify bot pushed a commit that referenced this pull request Nov 9, 2021
mergify bot added a commit that referenced this pull request Nov 9, 2021
(cherry picked from commit b4d0938)

Co-authored-by: Kirill Fomichev <fanatid@ya.ru>
dankelleher pushed a commit to identity-com/solana that referenced this pull request Nov 24, 2021
frits-metalogix added a commit to identity-com/solana that referenced this pull request Nov 24, 2021
jennnx added a commit to jennnx/buildspace-projects that referenced this pull request Sep 15, 2022
Hey! I posted in Discord about this, and wanted to suggest a PR too.

There's basically two things:
1) `anchor test` now runs out of the box. The developers there fixed this issue in  solana-labs/solana#21215, where they automatically disabled `bpf-jit` in validators for m1s and windows. I tried to update that everywhere it was referenced.

2) I think the section on `solana-keygen -o` and outputting it to the `target/deploy` folder *might* be outdated. Maybe it was M1-specific, but following along with the main tutorial (the one for Linux/x86) where you just use `solana-keygen new` and use your default created wallet was way easier. In fact, since the `Anchor.toml` file generated by `anchor init` by default expects the wallet to be at `"/Users/x/.config/solana/id.json"`, it was giving me some errors before I did the switch.


Maybe it's better to just delete this setup-flow completely and make everyone use the main tutorial on the buildspace website! The only "broken" thing for the M1 side is just the actual installation of anchor itself (the main tutorial on buildspace pulls the CLI binary directly from anchor's github, but as per the docs m1 processors should use avm instead).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is only support x86_64?
2 participants