Unable to build versions to match deployed contracts

Open
#23 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
docker, python, rust

Research direction

Start by running the reported command and reading scripts/build_image.py alongside builds.json, then review related PR #22 and the Rust version handling. The work is complete when the stellar-cli 23.2.1 and rust 1.86.0 combination can build successfully while accommodating their different compiler requirements.

Written by the indexing model from the issue text.

Description

bug

Related to my recently submitted PR #22 that tries to build docker images to verify many existing mainnet contracts

What version are you using?

I am using the branch on that PR, which only extended the allowed set in builds.json to match the versions found "in the wild" of deployed contracts on Soroban mainnet.

What did you do?
./scripts/build_image.py --stellar-cli-version 23.2.1 --rust-version 1.86.0-slim-bookworm --rust-image-digest sha256:57d
415bbd61ce11e2d5f73de068103c7bd9f3188dc132c97cef4a8f62989e944
What did you expect to see?

I expected this to build, as there are multiple contracts using this combination of stellar-cli and rustc

What did you see instead?

I got a build error:

3.288 error: cannot install package `stellar-cli 23.2.1`, it requires rustc 1.89.0 or newer, while the currently active rustc version is 1.86.0                    

This proves that the rustc used to compile the contract is in many cases not the same rustc used to compile stellar-cli. This doesn't have to match as any stellar-cli from the same commit (on any compiler) must have the same actions/output. Apparently many people are using pre-compiled binaries from Github rather than compiling from source locally.

Proposal

I would propose either:

  1. Downloading pre-built stellar binary from github releases or anywhere else that is hosted OR
  2. Using a different rustc to compile stellar from that in the final image. This means 2 different rustc versions (for build and for the final runtime).

Especially if you are going with 2, I think we need to stop providing so many knobs and hardcode one rustc for each stellar version for the build stage in builds.json and always use that rather than passing in some choice in the build_image.py script

Dominant language
Python
Stars
0
Forks
2
Avg merge
6h 22m
Merged PRs (30d)
5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stellar/stellar-cli-docker

All issues in stellar/stellar-cli-docker

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.