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

[Bug]: Cannot build bubblegum or integrate into our Anchor program: package solana-program v1.16.3 cannot be built because it requires rustc 1.68.0 or newer, while the currently active rustc version is 1.62.0-dev #1147

Closed
nathanleclaire opened this issue Jul 12, 2023 · 6 comments
Labels

Comments

@nathanleclaire
Copy link

nathanleclaire commented Jul 12, 2023

Which package is this bug report for?

bubblegum

Which Type of Package is this bug report for?

Rust Contract

Issue description

We want to use bubblegum in our project, but can't even include the crate due to cargo build errors. This is replicable in this repo for me. I am on M1 Mac FWIW. To reproduce:

Ensure Solana versions and Anchor versions locally as are below and Cargo cache etc are clean.

$ pwd
$HOME/metaplex-program-library/bubblegum/program

$ rustc --version
rustc 1.70.0 (90c541806 2023-05-31)

$ solana --version
solana-cli 1.14.13 (src:0a3e52ba; feat:627291041)

$ anchor --version
anchor-cli 0.26.0

$ anchor test
...
error: package `solana-program v1.16.3` cannot be built because it requires rustc 1.68.0 or newer, while the currently active rustc version is 1.62.0-dev

Part of what landed us here is that we were trying to use newer Anchor and Solana versions, but we got borsh 0.9.x and 0.10.x version conflicts across the various packages. That seems to be fixed in later Solana versions (1.16.x). We did finally get Anchor 0.28.0 to compile and run with Solana 1.16, but then we couldn't successfully add mpl-bubblegum.

I forget exactly where in the matrix of difficulty we encountered them as well, but even when we got cargo to compile sometimes we would see "Instruction too large" errors from the validator itself. The only working install we have is Anchor 0.28.0 on Solana 1.16.3 without any bubblegum addition.

Our particular Cargo.toml locally is quite simple:

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

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

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

[dependencies]
anchor-lang = "0.26.0"
anchor-spl = "0.26.0"
mpl-bubblegum = "0.8.0"

But it hits the same issues.

Related links:

We aren't really sure what to do. Generally, we're thinking we should target Anchor 0.26.0 because everything seems to depend on it including SPL -- and due to the borsh libs problem in Solana 1.16.x, it seems like we will have to stick to 1.14 for now. But then we come back to wanting to integrate with bubblegum and it seems like we can't even compile it in its own repo in that stack. Are we missing something? Any ideas?

Relevant log output

No response

Priority this issue should have

High (immediate attention needed)

@samuelvanderwaal
Copy link
Contributor

samuelvanderwaal commented Jul 12, 2023

@nathanleclaire Just a FYI: we're in the process of moving Bubblegum to its own repo so here is the correct location for it. We'll be removing it from the metaplex program library soon, sorry for any confusion.

As far as this issue goes, you're right that Bubblegum (and other Metaplex programs) are not currently compatible with Solana v1.16 yet and so need Anchor 0.26. Solana v1.16 has some breaking changes that make it a hassle to upgrade and it's not the program version on mainnet yet so it hasn't been a priority to upgrade yet.

However, through trial-and-error of downgrading troublesome packages I was able to generate a lock file that compiles bpf code using your specified dependencies. Give the linked lock file a try and let me know if it works or doesn't for you:
https://gist.github.com/samuelvanderwaal/29eb2b4f1f7588c504ccc6b4c48af47c

Also, you might not want to use the latest Rust version as BPF support seems to sometimes lag stable. Maybe try 1.66-1.68.

@nathanleclaire
Copy link
Author

thx for speedy response! i'll check that lock file out

@nathanleclaire
Copy link
Author

nathanleclaire commented Jul 13, 2023

Also, you might not want to use the latest Rust version as BPF support seems to sometimes lag stable. Maybe try 1.66-1.68.

Can you clarify how that comes in to play here? It seems like the problem generally speaking with the packages that don't like the Rust version is due to the vendored Rust version with the Solana 1.14.13 install. So I assumed my local Rust toolchain was largely irrelevant.

@nathanleclaire
Copy link
Author

nathanleclaire commented Jul 13, 2023

lockfile looking like it's working! much appreciated!

image

(I did switch my local rust to 1.66.1 fwiw, not clear if that mattered or not)

@samuelvanderwaal
Copy link
Contributor

Also, you might not want to use the latest Rust version as BPF support seems to sometimes lag stable. Maybe try 1.66-1.68.

Can you clarify how that comes in to play here? It seems like the problem generally speaking with the packages that don't like the Rust version is due to the vendored Rust version with the Solana 1.14.13 install. So I assumed my local Rust toolchain was largely irrelevant.

It probably shouldn't matter? When I was troubleshooting it seemed like going from Rust 1.65 to 1.66 resolved one of the issues but maybe it was a false positive. I didn't try every combination of Rust versions once I got a working lock file.

@samuelvanderwaal
Copy link
Contributor

lockfile looking like it's working! much appreciated!

image (I did switch my local rust to 1.66.1 fwiw, not clear if that mattered or not)

FWIW, the way I solved this is by running cargo update -p <package> --precise <version> to downgrade the packages that were causing errors. It took some trial and error and looking up versions of various packages on crates.io. Just including this here in case it's helpful for others who need to solve this or a similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants