Separate the "program" feature of solana-sdk into a new crate called solana-program#12989
Separate the "program" feature of solana-sdk into a new crate called solana-program#12989mvines merged 7 commits intosolana-labs:masterfrom
solana-sdk into a new crate called solana-program#12989Conversation
a809c2b to
1038cdd
Compare
de9cbc2 to
f158914
Compare
f3f417a to
b66cf1c
Compare
Codecov Report
@@ Coverage Diff @@
## master #12989 +/- ##
=========================================
- Coverage 82.1% 82.1% -0.1%
=========================================
Files 367 372 +5
Lines 86406 86522 +116
=========================================
+ Hits 71023 71066 +43
- Misses 15383 15456 +73 |
|
Getting close! The |
10911d2 to
d831670
Compare
| @@ -4,47 +4,36 @@ | |||
| // Allows macro expansion of `use ::solana_sdk::*` to work within this crate | |||
| extern crate self as solana_sdk; | |||
|
|
|||
There was a problem hiding this comment.
Changes to sdk/src/lib.rs are interesting to review
| pub mod serialize_utils; | ||
|
|
||
| // Modules not usable by on-chain programs | ||
| #[cfg(feature = "everything")] |
There was a problem hiding this comment.
I moved the #[cfg(feature = "everything")]s into inner cfgs in each file to clean up lib.rs
There was a problem hiding this comment.
Though does require searching through all the files to figure out if everything.
| since = "1.4.3", | ||
| note = "use solana_program_sdk::entrypoint::entrypoint instead" | ||
| )] | ||
| macro_rules! entrypoint { |
There was a problem hiding this comment.
This sucks a little. I had to keep an entrypoint macro in here to avoid breaking users
There was a problem hiding this comment.
Which users are you worried about, wouldn't anyone picking this sdk need to start using solana-program-sdk anyway?
There was a problem hiding this comment.
wouldn't anyone picking this sdk need to start using solana-program-sdk anyway?
Currently you can just upgrade solana-sdk and it'll work (with some deprecated compiler warning). I expect this will be the normal upgrade path for downstream:
- Next year upgrade to a new solana-sdk
- Notice the deprecated compiler warnings
- Switch to solana-program-sdk in 5 years
| } | ||
|
|
||
| #[frozen_abi(digest = "2ZUeCLMVQxmHYbeqMH7M97ifVSKoVErGvRHzyxcQRjgU")] | ||
| #[frozen_abi(digest = "31bz55FBVWtVQjPWz8eeyduFXMCFhVZx5uL8wyLk3hht")] |
There was a problem hiding this comment.
A bunch of frozen_abi digest updates due to files moving around, not an issue....
|
This is ready to land. Steps:
|
9384a50 to
18c73e1
Compare
The movement of files in sdk/ caused ABI hashes to change
solana-sdk into a new crate called solana-program-sdksolana-sdk into a new crate called solana-program
…d `solana-program` (bp #12989) (#13131) * Add solana-program-sdk boilerplate (cherry picked from commit 3718771) # Conflicts: # sdk/Cargo.toml * Initial population of solana-program-sdk (cherry picked from commit 63db324) # Conflicts: # Cargo.lock * Port programs to solana-program-sdk (cherry picked from commit fe68f7f) # Conflicts: # programs/bpf/Cargo.lock # programs/bpf/rust/128bit/Cargo.toml # programs/bpf/rust/128bit_dep/Cargo.toml # programs/bpf/rust/alloc/Cargo.toml # programs/bpf/rust/call_depth/Cargo.toml # programs/bpf/rust/custom_heap/Cargo.toml # programs/bpf/rust/dep_crate/Cargo.toml # programs/bpf/rust/deprecated_loader/Cargo.toml # programs/bpf/rust/dup_accounts/Cargo.toml # programs/bpf/rust/error_handling/Cargo.toml # programs/bpf/rust/external_spend/Cargo.toml # programs/bpf/rust/instruction_introspection/Cargo.toml # programs/bpf/rust/invoke/Cargo.toml # programs/bpf/rust/invoked/Cargo.toml # programs/bpf/rust/iter/Cargo.toml # programs/bpf/rust/many_args/Cargo.toml # programs/bpf/rust/many_args_dep/Cargo.toml # programs/bpf/rust/noop/Cargo.toml # programs/bpf/rust/panic/Cargo.toml # programs/bpf/rust/param_passing/Cargo.toml # programs/bpf/rust/param_passing_dep/Cargo.toml # programs/bpf/rust/rand/Cargo.toml # programs/bpf/rust/ristretto/Cargo.toml # programs/bpf/rust/sanity/Cargo.toml # programs/bpf/rust/sha256/Cargo.toml # programs/bpf/rust/sysval/Cargo.toml * Only activate legacy program feature for the solana-sdk crate (cherry picked from commit 85c51f5) * Run serum-dex unit tests (cherry picked from commit 92ce381) * Rename solana-program-sdk to solana-program (cherry picked from commit dd711ab) # Conflicts: # programs/bpf/rust/128bit/Cargo.toml # programs/bpf/rust/128bit_dep/Cargo.toml # programs/bpf/rust/alloc/Cargo.toml # programs/bpf/rust/call_depth/Cargo.toml # programs/bpf/rust/custom_heap/Cargo.toml # programs/bpf/rust/dep_crate/Cargo.toml # programs/bpf/rust/deprecated_loader/Cargo.toml # programs/bpf/rust/dup_accounts/Cargo.toml # programs/bpf/rust/error_handling/Cargo.toml # programs/bpf/rust/external_spend/Cargo.toml # programs/bpf/rust/instruction_introspection/Cargo.toml # programs/bpf/rust/invoke/Cargo.toml # programs/bpf/rust/invoked/Cargo.toml # programs/bpf/rust/iter/Cargo.toml # programs/bpf/rust/many_args/Cargo.toml # programs/bpf/rust/many_args_dep/Cargo.toml # programs/bpf/rust/noop/Cargo.toml # programs/bpf/rust/panic/Cargo.toml # programs/bpf/rust/param_passing/Cargo.toml # programs/bpf/rust/param_passing_dep/Cargo.toml # programs/bpf/rust/rand/Cargo.toml # programs/bpf/rust/ristretto/Cargo.toml # programs/bpf/rust/sanity/Cargo.toml # programs/bpf/rust/sha256/Cargo.toml # programs/bpf/rust/sysval/Cargo.toml * Update frozen_abi hashes The movement of files in sdk/ caused ABI hashes to change (cherry picked from commit a495684) * Resolve merge conflicts Co-authored-by: Michael Vines <mvines@gmail.com>
The "program" feature of
solana-sdkneeds to go away.Source backwards compatibility is retained by making
solana-sdkre-exportsolana-programdefinitions, and thesolana-sdk"program" feature becomes vestigial.This work will allow a program to declare
solana-programas a[dependency]and then the full-blownsolana-sdkas a[dev-dependency], enabling access to useful things likeBanksClientdirectly from program unit tests.