From 858ca752e2ca6191505b698cc8cad0de75a4f644 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 4 Feb 2021 23:02:01 +0000 Subject: [PATCH] Generate keypair file for c program deployment (#15080) (#15110) * Generate keypair file for c program deployment * Build and use solana-keygen in test-stable-perf (cherry picked from commit bba1b496630e1494da31f9e634ebccfb97529300) Co-authored-by: Jack May --- ci/test-stable.sh | 4 ++++ sdk/bpf/c/bpf.mk | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/ci/test-stable.sh b/ci/test-stable.sh index b9ee39b10d..ec3feca39a 100755 --- a/ci/test-stable.sh +++ b/ci/test-stable.sh @@ -39,6 +39,10 @@ test-stable) _ "$cargo" stable test --jobs "$NPROC" --all --exclude solana-local-cluster ${V:+--verbose} -- --nocapture ;; test-stable-perf) + # solana-keygen required when building C programs + _ "$cargo" build --manifest-path=keygen/Cargo.toml + export PATH="$PWD/target/debug":$PATH + # BPF solana-sdk legacy compile test ./cargo-build-bpf --manifest-path sdk/Cargo.toml diff --git a/sdk/bpf/c/bpf.mk b/sdk/bpf/c/bpf.mk index da272147fd..379058d256 100644 --- a/sdk/bpf/c/bpf.mk +++ b/sdk/bpf/c/bpf.mk @@ -168,6 +168,11 @@ $1: $2 @echo "[lld] $1 ($2)" $(_@)mkdir -p $(dir $1) $(_@)$(LLD) $(BPF_LLD_FLAGS) -o $1 $2 +ifeq (,$(wildcard $(subst .so,-keypair.json,$1))) + $(_@)solana-keygen new --no-passphrase --silent -o $(subst .so,-keypair.json,$1) +endif + @echo To deploy this program: + @echo $$$$ solana program deploy $(realpath $1) endef define TEST_C_RULE