Ellipsis-Labs / solana-verifiable-build

CLI tool for deterministically building and verifying executable against on-chain programs or buffer accounts
183 stars 42 forks source link

Fix builds with Solana v1.17+ by using sparse index #45

Closed joncinque closed 11 months ago

joncinque commented 11 months ago

Problem

Builds using Solana v1.17 and above will typically use Rust v1.73, which means that the sparse registry index is used by default.

So when the tool runs cargo fetch, the command fetches the sparse index info.

However, the Solana build tools are still on Rust 1.68, which doesn't default to the sparse registry, so when running cargo build-sbf -- --frozen --locked, cargo will try to access the network to get the git registry, which naturally causes a failure because of the --frozen flag.

Solution

It's a slightly clunky solution, but since cargo config is only available on nightly, I went the lazy route and use the old build steps for anything less than 1.17, and force always using the sparse registry for anything greater than that while relaxing the --frozen restriction.

Let me know what you think!

joncinque commented 11 months ago

Great, done!