Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SBPFv1 to the CI pipeline #5126

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ci/test-stable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ test-stable-sbf)
# Install the platform tools
_ platform-tools-sdk/sbf/scripts/install.sh

# SBF program tests
# SBPFv0 program tests
_ make -C programs/sbf test-v0

# SBF program instruction count assertion
Expand All @@ -68,6 +68,10 @@ test-stable-sbf)
sbf_dump_archive="sbf-dumps.tar.bz2"
rm -f "$sbf_dump_archive"
tar cjvf "$sbf_dump_archive" $sbf_target_path/deploy/{*.txt,*.so}

# SBPFv1 program tests
_ make -C programs/sbf clean-all test-v1

exit 0
;;
test-docs)
Expand Down
18 changes: 16 additions & 2 deletions programs/sbf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,27 @@ SBF_SDK_PATH := ../../platform-tools-sdk/sbf
SRC_DIR := c/src
OUT_DIR := target/deploy

test-v0: all rust-v0
clean-all: clean
cargo clean

test:
SBF_OUT_DIR=$(OUT_DIR) cargo test --features="sbf_rust,sbf_c" $(TEST_ARGS)

test-v1:
SBPF_CPU=v1 $(MAKE) all ; \
$(MAKE) rust-v1 ; \
$(MAKE) test

test-v0: all rust-v0 test

rust-v0:
cargo +solana build --release --target sbpf-solana-solana --workspace ; \
cp -r target/sbpf-solana-solana/release/* target/deploy

.PHONY: rust
rust-v1:
cargo +solana build --release --target sbpfv1-solana-solana --workspace ; \
cp -r target/sbpfv1-solana-solana/release/* target/deploy

.PHONY: rust-v0

include $(SBF_SDK_PATH)/c/sbf.mk
24 changes: 12 additions & 12 deletions programs/sbf/tests/programs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1272,10 +1272,10 @@ fn assert_instruction_count() {
("noop", 5),
("noop++", 5),
("relative_call", 210),
("return_data", 980),
("return_data", 982),
("sanity", 2377),
("sanity++", 2277),
("secp256k1_recover", 25383),
("secp256k1_recover", 25483),
("sha", 1355),
("struct_pass", 108),
("struct_ret", 122),
Expand All @@ -1284,20 +1284,20 @@ fn assert_instruction_count() {
#[cfg(feature = "sbf_rust")]
{
programs.extend_from_slice(&[
("solana_sbf_rust_128bit", 1218),
("solana_sbf_rust_alloc", 5077),
("solana_sbf_rust_custom_heap", 398),
("solana_sbf_rust_128bit", 955),
("solana_sbf_rust_alloc", 4784),
("solana_sbf_rust_custom_heap", 270),
("solana_sbf_rust_dep_crate", 2),
("solana_sbf_rust_iter", 1514),
("solana_sbf_rust_many_args", 1289),
("solana_sbf_rust_mem", 2067),
("solana_sbf_rust_membuiltins", 1539),
("solana_sbf_rust_mem", 1207),
("solana_sbf_rust_membuiltins", 292),
("solana_sbf_rust_noop", 275),
("solana_sbf_rust_param_passing", 146),
("solana_sbf_rust_rand", 378),
("solana_sbf_rust_sanity", 51953),
("solana_sbf_rust_secp256k1_recover", 91185),
("solana_sbf_rust_sha", 24059),
("solana_sbf_rust_param_passing", 108),
("solana_sbf_rust_rand", 264),
("solana_sbf_rust_sanity", 50084),
("solana_sbf_rust_secp256k1_recover", 89217),
("solana_sbf_rust_sha", 22850),
]);
}

Expand Down
Loading