Skip to content

anchor build --verifiable fails #180

@chaitanya5

Description

@chaitanya5

My program builds successfully on my local machine but fails when running the anchor build --verifiable command which builds the program inside a docker image.

rustc --version
rustc 1.87.0 (17067e9ac 2025-05-09)
solana --version
solana-cli 2.2.12 (src:0315eb6a; feat:1522022101, client:Agave)
anchor --version
anchor-cli 0.31.1

Cargo.toml

[package]
name = "gacha-machine"
version = "0.1.0"
description = "Created with Anchor"
edition = "2021"

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

[features]
default = []
cpi = ["no-entrypoint"]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
idl-build = [
    "anchor-lang/idl-build",
    "anchor-spl/idl-build",
    "switchboard-on-demand/idl-build"
]


[dependencies]
anchor-lang = "0.31.1"
anchor-spl = "0.31.1"
switchboard-on-demand = { version = "0.10.2", features = ["anchor"] }

anchor build

Error: Function _ZN4core5slice4sort6stable14driftsort_main17h4673eb8c192b2219E Stack offset of 4104 exceeded max offset of 4096 by 8 bytes, please minimize large stack variables. Estimated function frame size: 4160 bytes. Exceeding the maximum stack offset may cause undefined behavior during execution.

Error: Function _ZN4core5slice4sort6stable14driftsort_main17hfddcd1a56d97a363E Stack offset of 4104 exceeded max offset of 4096 by 8 bytes, please minimize large stack variables. Estimated function frame size: 4160 bytes. Exceeding the maximum stack offset may cause undefined behavior during execution.

    Finished `release` profile [optimized] target(s) in 0.37s
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.18s
     Running unittests src/lib.rs (/home/godfather/shubham/gacham/readycards_backend/target/debug/deps/gacha_machine-2840818d96dd60fd)

anchor build --verifiable

Using image "solanafoundation/anchor:v0.31.1"
Run docker image
f403f4cdcb71dfa030a816d3e4add442cd46acc74020fdea316c0db1f200424b
Building gacha_machine manifest: "programs/gacha-machine/Cargo.toml"
    Updating crates.io index
 Downloading crates ...
  Downloaded ahash v0.8.12
  Downloaded semver v1.0.27
  Downloaded aes-gcm-siv v0.11.1
  Downloaded solana-derivation-path v2.2.1
  Downloaded solana-pubkey v2.4.0
  Downloaded serde v1.0.228
  Downloaded spl-discriminator-syn v0.2.1
.
.
.
.
  Downloaded protoc-bin-vendored-linux-s390_64 v3.2.0
error: rustc 1.79.0-dev is not supported by the following packages:

                 Note that this is the rustc version that ships with Solana tools and not your system's rustc version. Use `solana-install update` or head over to https://docs.solanalabs.com/cli/install to install a newer version.
  [email protected] requires rustc 1.81
  [email protected] requires rustc 1.82
Either upgrade rustc or select compatible dependency versions with
`cargo update <name>@<current-ver> --precise <compatible-ver>`
where `<compatible-ver>` is the latest version supporting rustc 1.79.0-dev

Cleaning up the docker target directory
Removing the docker container
anchor-program
Error during Docker build: Failed to build program
Error: Failed to build program

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions