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

package time v0.3.20 cannot be built because it requires rustc 1.63.0 or newer #31528

Closed
Z-4-Z opened this issue May 7, 2023 · 13 comments
Closed
Labels
community Community contribution

Comments

@Z-4-Z
Copy link

Z-4-Z commented May 7, 2023

Solana 1.14.17 does not build

root@nero:~/solana# git status
HEAD detached at v1.14.17
root@nero:~/solana# rustc -V
rustc 1.69.0 (84c898d65 2023-04-16)
root@nero:~/solana# ./scripts/cargo-install-all.sh .
OSTYPE IS: linux-gnu
Install location: /root/solana (release)
+ /root/solana/cargo build --release --bin solana --bin solana-bench-tps --bin solana-faucet --bin solana-gossip --bin solana-install --bin solana-keygen --bin solana-ledger-tool --bin solana-log-analyzer --bin solana-net-shaper --bin solana-sys-tuner --bin solana-validator --bin rbpf-cli --bin cargo-build-bpf --bin cargo-build-sbf --bin cargo-test-bpf --bin cargo-test-sbf --bin solana-dos --bin solana-install-init --bin solana-stake-accounts --bin solana-test-validator --bin solana-tokens --bin solana-watchtower --bin solana-genesis
+ exec cargo +1.60.0 build --release --bin solana --bin solana-bench-tps --bin solana-faucet --bin solana-gossip --bin solana-install --bin solana-keygen --bin solana-ledger-tool --bin solana-log-analyzer --bin solana-net-shaper --bin solana-sys-tuner --bin solana-validator --bin rbpf-cli --bin cargo-build-bpf --bin cargo-build-sbf --bin cargo-test-bpf --bin cargo-test-sbf --bin solana-dos --bin solana-install-init --bin solana-stake-accounts --bin solana-test-validator --bin solana-tokens --bin solana-watchtower --bin solana-genesis
    Finished release [optimized] target(s) in 0.30s
+ [[ -z '' ]]
+ /root/solana/cargo install --locked spl-token-cli --root /root/solana
+ exec cargo +1.60.0 install --locked spl-token-cli --root /root/solana
    Updating crates.io index
  Installing spl-token-cli v2.4.0
warning: package `h2 v0.3.17` in Cargo.lock is yanked in registry `crates-io`, consider running without --locked
error: failed to compile `spl-token-cli v2.4.0`, intermediate artifacts can be found at `/tmp/cargo-installOPETGy`

Caused by:
  package `time v0.3.20` cannot be built because it requires rustc 1.63.0 or newer, while the currently active rustc version is 1.60.0
root@nero:~/solana# uname -a
Linux nero 5.15.0-71-generic #78-Ubuntu SMP Tue Apr 18 09:00:29 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
@Z-4-Z Z-4-Z added the community Community contribution label May 7, 2023
@Z-4-Z
Copy link
Author

Z-4-Z commented May 7, 2023

There is a file

 vi ci/rust-version.sh

but replacing 1.60.0 with 1.63.0 in this file, it all compiled.

idk, did you guys forget to update this, or is this something ppl are meant to change, because that is not intuitive.

@bw-solana
Copy link
Contributor

Looks like this has been broken since at least v1.14.0. Updating rust version on the 1.14 branch is likely not The Way. @samkim-crypto what do you think?

@CriesofCarrots
Copy link
Contributor

CriesofCarrots commented May 9, 2023

It's not a particular version of solana that is broken. Well, it sort of is, since we define the rust version used to install bins on each release branch.
But the real issue is that time bumped its MSRV to v1.63 in a recent release, and some cargo actions (like package, publish, and install) automatically pull the latest available crate, regardless of what is specified in the Cargo.lock. So cargo install is not using the old version of time that we have locked.

The best approach would be to build bins directly using cargo build --release. Or if you are just looking for the validator client, ./scripts/cargo-install-all.sh --validator-only avoids the issue.

@AndRockSYS
Copy link

It's not a particular version of solana that is broken. Well, it sort of is, since we define the rust version used to install bins on each release branch. But the real issue is that time bumped its MSRV to v1.63 in a recent release, and some cargo actions (like package, publish, and install) automatically pull the latest available crate, regardless of what is specified in the Cargo.lock. So cargo install is not using the old version of time that we have locked.

The best approach would be to build bins directly using cargo build --release. Or if you are just looking for the validator client, ./scripts/cargo-install-all.sh --validator-only avoids the issue.

Hi! I am also facing that issues, so I would like to know how can I get this .so file after building, because cargo build --release cannot produce it to me, or I cannot fin it maybe

@andreisilviudragnea
Copy link

Hi @CriesofCarrots. What is the solution to this problem? cargo build --release does not work for me.

@bw-solana
Copy link
Contributor

bw-solana commented Jul 31, 2023

cargo build --release does not work for me.

Which bin are you trying to build? And what error are you seeing when using cargo build --release?

If you're trying to build the validator bin, have you tried ./scripts/cargo-install-all.sh --validator-only?

@andreisilviudragnea
Copy link

@bw-solana My problem was that I was building a Solana program crate with cargo build instead of cargo build-sbf.

@nawed2611
Copy link

Hey, I seem to run into a similar issue

cargo build-sbf
error: package `solana-program v1.16.9` cannot be built because it requires rustc 1.68.0 or newer, while the currently active rustc version is 1.62.0-dev

On running rustc -V i get

rustc 1.71.1 (eb26296b5 2023-08-03)

@andreisilviudragnea
Copy link

@nawed2611 Are you using rust-toolchain.toml in your project?

@nawed2611
Copy link

no, just a basic cargo.toml

[package]
name = "program"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
solana-program = "1.16.9"


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

@failable
Copy link

How to fix?

@SushantChandla
Copy link

@nawed2611 You should install version 1.69.0 of the rust toolchain. Or Even better you can add this rust-toolchain.toml in the root of your project mentioning the correct version. For solana, you can find the correct version to use for rust by checking file at https://github.com/solana-labs/solana/blob/v1.16.9/rust-toolchain.toml where v1.16.9 is the tag of the solana version

@CriesofCarrots
Copy link
Contributor

v1.14 is EOL, so closing this issue

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

No branches or pull requests

8 participants