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

sdk/sbf/scripts/install points to sbf-tools that have a too old cargo #31337

Closed
Linerre opened this issue Apr 25, 2023 · 4 comments
Closed

sdk/sbf/scripts/install points to sbf-tools that have a too old cargo #31337

Linerre opened this issue Apr 25, 2023 · 4 comments
Labels
community Community contribution

Comments

@Linerre
Copy link

Linerre commented Apr 25, 2023

Problem

I'm working on a project where "workspace inheritance" feature of Cargo is needed/desired.

The feature has been stabilized since Rust 1.64. See this comment: dependabot/dependabot-core#5315 (comment)

However, the latest solana release (v1.15.2 on Linux) still installs sbf-tools of version v1.32:

version=v1.32

If I didn't make it wrong, this indeed downloads and installs sbf-tools of version v1.30, because:
https://github.com/solana-labs/platform-tools/blob/d848ae4eb747b105e1380749e6a2414bc155884d/build.sh#L30

which, in the end, pulls down a Cargo of version 1.62, the one that had not supported workspace inheritance:
https://github.com/solana-labs/cargo/blob/sbf-tools-v1.30/Cargo.toml

Proposed Solution

Make solana stable release (v1.15.2) point to/download a sbf-tools of version above 1.32 that ships a cargo with version 1.64 or higher:

sbf-tools-v1.35 seems stable and fine.

Why don't I try out the edge version of solana, you might wonder. Well, I did. Yet all the invoke instructions in our programs terminated with an error saying Invoked an instruction with data that is too large (12884932726 > 10240).

I believe there is something wrong with the edge version, but I have no clue yet. Trying to rolling back to the previous dev environment leads me to the above mentioned issue however.

Thanks in advance for your help.

@Linerre Linerre added the community Community contribution label Apr 25, 2023
@dmakarov
Copy link
Contributor

dmakarov commented Apr 25, 2023

More recent versions of cargo-build-sbf has a command line option to set the version of platform-tools to be installed/used.

--tools-version <STRING>
            platform-tools version to use or to install, a version string, e.g. "v1.32"

If cargo-build-sbf shipped with solana v1.15.2 supports this option, you could use it to install platform-tools v1.35.
Otherwise you can manually download the version of platform-tools you like and untar it in ~/.cache/solana/

@Linerre
Copy link
Author

Linerre commented Apr 25, 2023

More recent versions of cargo-build-sbf has a command line option to set the version of platform-tools to be installed/used.

--tools-version <STRING>
            platform-tools version to use or to install, a version string, e.g. "v1.32"

Thanks for the information. Very helpful.

If cargo-build-sbf shipped with solana v1.15.2 supports this option, you could use it to install platform-tools v1.35. Otherwise you can manually download the version of platform-tools you like and untar it in ~/.cache/solana/

I actually tried out this manual method but every time I run cargo sbf-build, I am told the cargo is too old to support workspace inheritance. I looked into it and found, somehow, it just won't use the sbf-tools I wanted it to use.

Even I created a symbolic link by replacing the old one under solana-release/bin/sdk/bpf/dependencies and modifying the version in that install.sh script. I guess the matched/target sbf-tools info has been hard coded somewhere in the release.

Anyway thank you for your help. Feel free to close the issue.

@dmakarov
Copy link
Contributor

More recent versions of cargo-build-sbf has a command line option to set the version of platform-tools to be installed/used.

--tools-version <STRING>
            platform-tools version to use or to install, a version string, e.g. "v1.32"

Thanks for the information. Very helpful.

If cargo-build-sbf shipped with solana v1.15.2 supports this option, you could use it to install platform-tools v1.35. Otherwise you can manually download the version of platform-tools you like and untar it in ~/.cache/solana/

I actually tried out this manual method but every time I run cargo sbf-build, I am told the cargo is too old to support workspace inheritance. I looked into it and found, somehow, it just won't use the sbf-tools I wanted it to use.

Even I created a symbolic link by replacing the old one under solana-release/bin/sdk/bpf/dependencies and modifying the version in that install.sh script. I guess the matched/target sbf-tools info has been hard coded somewhere in the release.

Anyway thank you for your help. Feel free to close the issue.

you could trick cargo-build-sbf into believing you have the version of platform tools it expects untaring the platform-tools tarball in the path that cargo-build-sbf (solana v1.15.2) expects. Suppose you download platform-tools v1.35, then untar it in ~/.cache/solana/v1.32/sbf-tools/ You would have to remove the existing v1.32 files first, of course.

@Linerre
Copy link
Author

Linerre commented Apr 25, 2023

you could trick cargo-build-sbf into believing you have the version of platform tools it expects untaring the platform-tools tarball in the path that cargo-build-sbf (solana v1.15.2) expects. Suppose you download platform-tools v1.35, then untar it in ~/.cache/solana/v1.32/sbf-tools/ You would have to remove the existing v1.32 files first, of course.

Haha, that's the trick. Got it. Thank you : )

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

2 participants