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 cargo-build-bpf #13040

Merged
merged 2 commits into from
Oct 22, 2020
Merged
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
28 changes: 24 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ members = [
"ramp-tps",
"runtime",
"sdk",
"sdk/cargo-build-bpf",
"scripts",
"stake-accounts",
"stake-monitor",
Expand Down
5 changes: 5 additions & 0 deletions cargo-build-bpf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

here=$(dirname "$0")
set -x
exec cargo run --manifest-path $here/sdk/cargo-build-bpf/Cargo.toml -- --bpf-sdk $here/sdk/bpf "$@"
1 change: 1 addition & 0 deletions ci/nits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ declare print_free_tree=(
':runtime/src/**.rs'
':sdk/bpf/rust/rust-utils/**.rs'
':sdk/**.rs'
':^sdk/cargo-build-bpf/**.rs'
':^sdk/src/program_option.rs'
':^sdk/src/program_stubs.rs'
':programs/**.rs'
Expand Down
2 changes: 2 additions & 0 deletions frozen-abi/Xargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[target.bpfel-unknown-unknown.dependencies.std]
features = []
10 changes: 5 additions & 5 deletions programs/bpf/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ fn main() {
program
);
assert!(Command::new("bash")
.current_dir("rust")
.args(&["./do.sh", "build", program])
.current_dir(format!("rust/{}", program))
.args(&["../../../../cargo-build-bpf"])
.status()
.expect("Error calling do.sh from build.rs")
.expect("Error calling cargo-build-bpf from build.rs")
.success());
let src = format!(
"target/bpfel-unknown-unknown/release/solana_bpf_rust_{}.so",
"rust/{0}/solana_bpf_rust_{0}.so",
program,
);
assert!(Command::new("cp")
assert!(Command::new("mv")
.arg(&src)
.arg(&install_dir)
.status()
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/128bit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-128bit"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/128bit_dep/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-128bit-dep"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/alloc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-alloc"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/call_depth/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-call-depth"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/custom_heap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-custom-heap"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/dep_crate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-dep-crate"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/deprecated_loader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-deprecated_loader"
Expand Down
123 changes: 0 additions & 123 deletions programs/bpf/rust/do.sh

This file was deleted.

1 change: 0 additions & 1 deletion programs/bpf/rust/dup_accounts/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-dup-accounts"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/error_handling/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-error-handling"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/external_spend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-external-spend"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/instruction_introspection/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-instruction-introspection"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/invoke/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-invoke"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/invoked/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-invoked"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/iter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-iter"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/many_args/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-many-args"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/many_args_dep/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-many-args-dep"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/noop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-noop"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/panic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-panic"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/param_passing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-param-passing"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/param_passing_dep/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-param-passing-dep"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/rand/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-rand"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/ristretto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-ristretto"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/sanity/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-sanity"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/sha256/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-sha256"
Expand Down
1 change: 0 additions & 1 deletion programs/bpf/rust/sysval/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Note: This crate must be built using do.sh

[package]
name = "solana-bpf-rust-sysval"
Expand Down
1 change: 1 addition & 0 deletions scripts/cargo-install-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ else


BINS=(
cargo-build-bpf
solana
solana-bench-exchange
solana-bench-tps
Expand Down
Loading