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

Project does not compile without Cargo.lock (at least on MacOS) #262

Open
bengtlofgren opened this issue Dec 7, 2024 · 0 comments
Open

Comments

@bengtlofgren
Copy link

bengtlofgren commented Dec 7, 2024

Compiling issues without Cargo.lock present

At least locally, if I do not use the Cargo.lock that is specified in the repository when compiling, it fails to compile. I.e, it cannot build the Cargo.lock from the Cargo.toml.

This is likely due to a mistake done on my behalf, but it would be useful to update the README.md in order to properly explain the required steps needed in order to compile this project from scratch.

Steps to reproduce

In order to produce this error I did the following:

  1. Ensured the rustc version and cargo version were specified as in the README.md (using architecture x86_64 and version 1.75.0 as specified in the rust-toolchain.toml)

rustc --version

rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: x86_64-apple-darwin
release: 1.75.0
LLVM version: 17.0.6

And cargo --version

cargo 1.75.0 (1d8b05cdd 2023-11-20)
  1. Removed the Cargo.lock using rm Cargo.lock.

  2. Ran cargo build --target x86_64-apple-darwin (the same issue arises with cargo build)
    Resulting in:

error: failed to select a version for the requirement `solana_rbpf = "=0.8.0"`
candidate versions found which didn't match: 0.8.5, 0.8.4, 0.8.3, ...
location searched: crates.io index
required by package `solana-program-test v1.18.17`
    ... which satisfies dependency `solana-program-test = "=1.18.17"` of package `liquidity-incentive-program v0.1.0

Further debugging

  1. Because 0.8.0 is yanked on crates.io, I added the following patch to the Cargo.toml:
[patch.crates-io]
solana_rbpf = { git = "https://github.com/solana-labs/rbpf", tag = "v0.8.0" }

But then run into issues:

error: package `fixed v1.28.0` cannot be built because it requires rustc 1.79 or newer, while the currently active rustc version is 1.75.0
Either upgrade to rustc 1.79 or newer, or use
cargo update [email protected] --precise ver
where `ver` is the latest version of `fixed` supporting rustc 1.75.0

It is possible to run cargo update [email protected] --precise 1.27.0 (since 1.27.0 is the version in the Cargo.lock), but the issues persist with similar errors:

error: package `solana-program v2.1.5` cannot be built because it requires rustc 1.79.0 or newer, while the currently active rustc version is 1.75.0
Either upgrade to rustc 1.79.0 or newer, or use
cargo update [email protected] --precise ver
where `ver` is the latest version of `solana-program` supporting rustc 1.75.0

Summary

It would be ideal if this could be resolved such that the project compiles without the Cargo.lock present, allowing developers to use crates from this repository as dependencies, without having to copy over the Cargo.lock file.

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

No branches or pull requests

1 participant