Skip to content

Commit

Permalink
Replaces the rust build script by a makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Lichtso committed Jun 4, 2024
1 parent f4417b1 commit c6df4e2
Show file tree
Hide file tree
Showing 90 changed files with 2,852 additions and 3,444 deletions.
380 changes: 161 additions & 219 deletions programs/sbf/Cargo.lock

Large diffs are not rendered by default.

82 changes: 38 additions & 44 deletions programs/sbf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,32 +26,32 @@ rustversion = "1.0.14"
serde = "1.0.112" # must match the serde_derive version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
serde_derive = "1.0.112" # must match the serde version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
serde_json = "1.0.56"
solana-account-decoder = { path = "../../account-decoder", version = "=2.0.0" }
solana-accounts-db = { path = "../../accounts-db", version = "=2.0.0" }
solana-bpf-loader-program = { path = "../bpf_loader", version = "=2.0.0" }
solana-cli-output = { path = "../../cli-output", version = "=2.0.0" }
solana-compute-budget = { path = "../../compute-budget", version = "=2.0.0" }
solana-ledger = { path = "../../ledger", version = "=2.0.0" }
solana-logger = { path = "../../logger", version = "=2.0.0" }
solana-measure = { path = "../../measure", version = "=2.0.0" }
solana-poseidon = { path = "../../poseidon/", version = "=2.0.0" }
solana-program = { path = "../../sdk/program", version = "=2.0.0" }
solana-program-runtime = { path = "../../program-runtime", version = "=2.0.0" }
solana-program-test = { path = "../../program-test", version = "=2.0.0" }
solana-runtime = { path = "../../runtime", version = "=2.0.0" }
solana-sbf-rust-128bit-dep = { path = "rust/128bit_dep", version = "=2.0.0" }
solana-sbf-rust-invoke = { path = "rust/invoke", version = "=2.0.0" }
solana-sbf-rust-invoked = { path = "rust/invoked", version = "=2.0.0", default-features = false }
solana-sbf-rust-many-args-dep = { path = "rust/many_args_dep", version = "=2.0.0" }
solana-sbf-rust-mem = { path = "rust/mem", version = "=2.0.0" }
solana-sbf-rust-param-passing-dep = { path = "rust/param_passing_dep", version = "=2.0.0" }
solana-sbf-rust-realloc = { path = "rust/realloc", version = "=2.0.0", default-features = false }
solana-sbf-rust-realloc-invoke = { path = "rust/realloc_invoke", version = "=2.0.0" }
solana-sdk = { path = "../../sdk", version = "=2.0.0" }
solana-svm = { path = "../../svm", version = "=2.0.0" }
solana-transaction-status = { path = "../../transaction-status", version = "=2.0.0" }
agave-validator = { path = "../../validator", version = "=2.0.0" }
solana-zk-token-sdk = { path = "../../zk-token-sdk", version = "=2.0.0" }
solana-account-decoder = { path = "../../account-decoder" }
solana-accounts-db = { path = "../../accounts-db" }
solana-bpf-loader-program = { path = "../bpf_loader" }
solana-cli-output = { path = "../../cli-output" }
solana-compute-budget = { path = "../../compute-budget" }
solana-ledger = { path = "../../ledger" }
solana-logger = { path = "../../logger" }
solana-measure = { path = "../../measure" }
solana-poseidon = { path = "../../poseidon/" }
solana-program = { path = "../../sdk/program" }
solana-program-runtime = { path = "../../program-runtime" }
solana-program-test = { path = "../../program-test" }
solana-runtime = { path = "../../runtime" }
solana-sbf-rust-128bit-dep = { path = "rust/128bit_dep" }
solana-sbf-rust-invoke-dep = { path = "rust/invoke_dep" }
solana-sbf-rust-invoked-dep = { path = "rust/invoked_dep" }
solana-sbf-rust-many-args-dep = { path = "rust/many_args_dep" }
solana-sbf-rust-mem-dep = { path = "rust/mem_dep" }
solana-sbf-rust-param-passing-dep = { path = "rust/param_passing_dep" }
solana-sbf-rust-realloc-dep = { path = "rust/realloc_dep" }
solana-sbf-rust-realloc-invoke-dep = { path = "rust/realloc_invoke_dep" }
solana-sdk = { path = "../../sdk" }
solana-svm = { path = "../../svm" }
solana-transaction-status = { path = "../../transaction-status" }
agave-validator = { path = "../../validator" }
solana-zk-token-sdk = { path = "../../zk-token-sdk" }
solana_rbpf = "=0.8.1"
thiserror = "1.0"

Expand All @@ -73,10 +73,11 @@ sbf_c = []
sbf_rust = []
dummy-for-ci-check = ["sbf_c", "sbf_rust"]

[build-dependencies]
walkdir = "2"
[profile.release]
strip = true

[dependencies]
[dev-dependencies]
agave-validator = { workspace = true }
bincode = { workspace = true }
byteorder = { workspace = true }
elf = { workspace = true }
Expand All @@ -88,24 +89,20 @@ solana-account-decoder = { workspace = true }
solana-accounts-db = { workspace = true }
solana-bpf-loader-program = { workspace = true }
solana-cli-output = { workspace = true }
solana-compute-budget = { workspace = true }
solana-ledger = { workspace = true }
solana-logger = { workspace = true }
solana-measure = { workspace = true }
solana-program-runtime = { workspace = true }
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }
solana-sbf-rust-invoke = { workspace = true }
solana-sbf-rust-realloc = { workspace = true, features = ["default"] }
solana-sbf-rust-realloc-invoke = { workspace = true }
solana-sdk = { workspace = true }
solana-sbf-rust-invoke-dep = { workspace = true }
solana-sbf-rust-realloc-dep = { workspace = true }
solana-sbf-rust-realloc-invoke-dep = { workspace = true }
solana-sdk = { workspace = true, features = ["dev-context-only-utils"] }
solana-svm = { workspace = true }
solana-transaction-status = { workspace = true }
solana_rbpf = { workspace = true }

[dev-dependencies]
solana-compute-budget = { workspace = true }
solana-ledger = { workspace = true }
solana-runtime = { workspace = true, features = ["dev-context-only-utils"] }
solana-sdk = { workspace = true, features = ["dev-context-only-utils"] }

[[bench]]
name = "bpf_loader"

Expand Down Expand Up @@ -155,8 +152,8 @@ members = [
"rust/sanity",
"rust/secp256k1_recover",
"rust/sha",
"rust/sibling_inner_instruction",
"rust/sibling_instruction",
"rust/sibling_inner_instructions",
"rust/sibling_instructions",
"rust/simulation",
"rust/spoof1",
"rust/spoof1_system",
Expand All @@ -165,9 +162,6 @@ members = [
"rust/upgraded",
]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[patch.crates-io]
# We include the following crates as our dependencies from crates.io:
#
Expand Down
13 changes: 13 additions & 0 deletions programs/sbf/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SBF_SDK_PATH := ../../sdk/sbf
SRC_DIR := c/src
OUT_DIR := target/sbf-solana-solana/release

rust:
cargo +solana build --release --target sbf-solana-solana --workspace

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

.PHONY: rust

include $(SBF_SDK_PATH)/c/sbf.mk
130 changes: 0 additions & 130 deletions programs/sbf/build.rs

This file was deleted.

2 changes: 0 additions & 2 deletions programs/sbf/c/makefile

This file was deleted.

4 changes: 0 additions & 4 deletions programs/sbf/rust/128bit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[package]
name = "solana-sbf-rust-128bit"
documentation = "https://docs.rs/solana-sbf-rust-128bit"
version = { workspace = true }
description = { workspace = true }
authors = { workspace = true }
Expand All @@ -15,6 +14,3 @@ solana-sbf-rust-128bit-dep = { workspace = true }

[lib]
crate-type = ["cdylib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
4 changes: 0 additions & 4 deletions programs/sbf/rust/128bit_dep/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[package]
name = "solana-sbf-rust-128bit-dep"
documentation = "https://docs.rs/solana-sbf-rust-128bit-dep"
version = { workspace = true }
description = { workspace = true }
authors = { workspace = true }
Expand All @@ -11,6 +10,3 @@ edition = { workspace = true }

[dependencies]
solana-program = { workspace = true }

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
4 changes: 0 additions & 4 deletions programs/sbf/rust/alloc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[package]
name = "solana-sbf-rust-alloc"
documentation = "https://docs.rs/solana-sbf-rust-alloc"
version = { workspace = true }
description = { workspace = true }
authors = { workspace = true }
Expand All @@ -14,6 +13,3 @@ solana-program = { workspace = true }

[lib]
crate-type = ["cdylib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
3 changes: 0 additions & 3 deletions programs/sbf/rust/alt_bn128/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ solana-program = { workspace = true }

[lib]
crate-type = ["cdylib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
3 changes: 0 additions & 3 deletions programs/sbf/rust/alt_bn128_compression/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ solana-program = { workspace = true }

[lib]
crate-type = ["cdylib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
5 changes: 1 addition & 4 deletions programs/sbf/rust/big_mod_exp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "solana-bpf-rust-big-mod-exp"
name = "solana-sbf-rust-big-mod-exp"
documentation = "https://docs.rs/solana-bpf-rust-big-mod-exp"
version = { workspace = true }
description = { workspace = true }
Expand All @@ -18,6 +18,3 @@ solana-program = { workspace = true }

[lib]
crate-type = ["cdylib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
4 changes: 0 additions & 4 deletions programs/sbf/rust/call_depth/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[package]
name = "solana-sbf-rust-call-depth"
documentation = "https://docs.rs/solana-sbf-rust-call-depth"
version = { workspace = true }
description = { workspace = true }
authors = { workspace = true }
Expand All @@ -14,6 +13,3 @@ solana-program = { workspace = true }

[lib]
crate-type = ["cdylib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
4 changes: 0 additions & 4 deletions programs/sbf/rust/caller_access/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[package]
name = "solana-sbf-rust-caller-access"
documentation = "https://docs.rs/solana-sbf-rust-caller-access"
version = { workspace = true }
description = { workspace = true }
authors = { workspace = true }
Expand All @@ -14,6 +13,3 @@ solana-program = { workspace = true }

[lib]
crate-type = ["cdylib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
4 changes: 0 additions & 4 deletions programs/sbf/rust/curve25519/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[package]
name = "solana-sbf-rust-curve25519"
documentation = "https://docs.rs/solana-sbf-rust-zktoken_crypto"
version = { workspace = true }
description = { workspace = true }
authors = { workspace = true }
Expand All @@ -15,6 +14,3 @@ solana-zk-token-sdk = { workspace = true }

[lib]
crate-type = ["cdylib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
4 changes: 0 additions & 4 deletions programs/sbf/rust/custom_heap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[package]
name = "solana-sbf-rust-custom-heap"
documentation = "https://docs.rs/solana-sbf-rust-custom-heap"
version = { workspace = true }
description = { workspace = true }
authors = { workspace = true }
Expand All @@ -18,6 +17,3 @@ custom-heap = []

[lib]
crate-type = ["cdylib"]

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Loading

0 comments on commit c6df4e2

Please sign in to comment.