You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had the same error and I managed to pass npm run build:program-rust step using docker.
# At your repository root
touch Dockerfile
docker build -t builder - < Dockerfile
docker run --platform linux/amd64 --mount type=bind,src=$(pwd),dst=/app builder
# This took several minutes to finish in my case. The last few lines of the output is like:
...
+ exit 0
cargo-build-bpf child: /root/.local/share/solana/install/releases/1.10.26/solana-release/bin/sdk/bpf/dependencies/bpf-tools/llvm/bin/llvm-readelf --dyn-symbols /app/dist/program/helloworld.so
To deploy this program:
$ solana program deploy /app/dist/program/helloworld.so
The program address will default to this keypair (override with --program-id):
/app/dist/program/helloworld-keypair.json
Here's what Dockerfile looks like:
FROM --platform=linux/amd64 rust:1-buster
WORKDIR /app
# install solana since `cargo build-bpf` custom cargo command (cargo-build-bpf) is generated hereRUN sh -c "$(curl -sSfL https://release.solana.com/v1.10.26/install)"# export additioan pathENV PATH="/root/.local/share/solana/install/active_release/bin:${PATH}"# execute what `npm run build:program-rust` doesCMD cargo build-bpf --manifest-path=./src/program-rust/Cargo.toml --bpf-out-dir=dist/program
NOTE: I only use docker for this npm run build:program-rust step to get helloworld-kaypair.json and helloworld.so files in dist/program/ directory. For other steps, instructed commands run without failure on M1 mac for my case.
Prerequisites:
Macos Monterey 12.2.1
CPU: Apple M1
Run
npm run build:program-rust
And get output
The text was updated successfully, but these errors were encountered: