2

I am running AWS EC2 Free Tier (t1.micro), upon running "cargo install spl-token-cli" command to install spl-token-cli my install fails towards the end, and install is abruptly ended without any error code. Is there a way to solve this?

I read that it might be a RAM issue, but solution is not clear or what the minimum requirements are to address this.

Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:        22.04
Codename:       jammy
  1. Installed Solana v1.10.31, and confirmed Solana installed. Funded SOL account from Coinbase successfully.
sh -c "$(curl -sSfL https://release.solana.com/v1.10.31/install)"
root:~# solana balance
0.36138418 SOL
  1. Installed RUST and following Libraries:
curl https://sh.rustup.rs -sSf | sh
sudo apt install libudev-dev
sudo apt install libssl-dev pkg-config
sudo apt install build-essential -y

Reference:

root:~# rustc --version
rustc 1.62.1 (e092d0b6b 2022-07-16)
  1. Ran "install spl-token-cli" received error
error: could not compile \`libsecp256k1\`

Full Error, received around 450/483

error: could not compile `libsecp256k1`

Caused by:
  process didn't exit successfully: `rustc --crate-name libsecp256k1 --edition=2018 /root/.cargo/registry/src/github.com-1ecc6299db9ec823/libsecp256k1-0.5.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="hmac"' --cfg 'feature="hmac-drbg"' --cfg 'feature="sha2"' --cfg 'feature="static-context"' --cfg 'feature="std"' --cfg 'feature="typenum"' -C metadata=f119b9f1bc16e764 -C extra-filename=-f119b9f1bc16e764 --out-dir /tmp/cargo-install5kkhba/release/deps -L dependency=/tmp/cargo-install5kkhba/release/deps --extern arrayref=/tmp/cargo-install5kkhba/release/deps/libarrayref-d72b1a7e9fc58035.rmeta --extern base64=/tmp/cargo-install5kkhba/release/deps/libbase64-9aac25c5f1796611.rmeta --extern digest=/tmp/cargo-install5kkhba/release/deps/libdigest-cf697cf6bf7ada0c.rmeta --extern hmac_drbg=/tmp/cargo-install5kkhba/release/deps/libhmac_drbg-09dac8b239e348c6.rmeta --extern libsecp256k1_core=/tmp/cargo-install5kkhba/release/deps/liblibsecp256k1_core-80357b39155ca295.rmeta --extern rand=/tmp/cargo-install5kkhba/release/deps/librand-7689b79fd2bbb12c.rmeta --extern serde=/tmp/cargo-install5kkhba/release/deps/libserde-981cc0b8bda5ddb7.rmeta --extern sha2=/tmp/cargo-install5kkhba/release/deps/libsha2-4657e764233274db.rmeta --extern typenum=/tmp/cargo-install5kkhba/release/deps/libtypenum-3d00a21487da8bed.rmeta --cap-lints allow` (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `spl-token-cli v2.0.15`, intermediate artifacts can be found at `/tmp/cargo-install5kkhba`
1
  • 1
    You should include more relevant errors as 'error: could not compile' is too general. You should have more detailed error few lines above.
    – kenorb
    Jul 21, 2022 at 14:30

2 Answers 2

1

I'm guessing if you check the output of dmesg after the compilation fails, you'd see messages from oom-killer reaping it. Typically this can be gotten around by limiting build parallelization with --jobs N where N is some number less than the output of nproc. For core development, we usually use N = TOTAL_RAM_GB / 3

0

I was able to successfully install "spl-token-cli" using the "cargo install spl-token-cli" after upgrading my server from t1.micro to t2.small. I am still not clear on the minimum requirement to run "spl-token-cli", however this worked.

AWS EC2 instance:

  • t1.micro (free tier) includes 1GB RAM/Memory - did NOT work
  • t2.small includes 2GB RAM/Memory - this DID work

Example of Fully Compiled CLI

1
  • I ran into an unrelated problem when running "spl-token create-token" on Ubuntu 22.04. According to this question/answer run wget and sudo dppkg command to get most recent "libssl" files. Ref. stackoverflow.com/questions/72378647/… ...This fixes it (a problem with packaging in 22.04):
    – Nathan
    Jul 22, 2022 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.