Skip to content

Commit

Permalink
[WIP] Fix broken build cfgs by conditional crates
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Feb 3, 2020
1 parent e1c763a commit b3b65b0
Show file tree
Hide file tree
Showing 14 changed files with 434 additions and 329 deletions.
26 changes: 24 additions & 2 deletions Cargo.lock

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

28 changes: 28 additions & 0 deletions programs/bpf/Cargo.lock

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

2 changes: 1 addition & 1 deletion programs/vote/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ serde_derive = "1.0.103"
solana-logger = { path = "../../logger", version = "0.24.0" }
solana-metrics = { path = "../../metrics", version = "0.24.0" }
solana-sdk = { path = "../../sdk", version = "0.24.0" }
solana-sdk-macro = { path = "../../sdk/macro", version = "0.24.0" }
solana-sdk-macro-frozen-abi = { path = "../../sdk/macro-frozen-abi", version = "0.24.0" }
thiserror = "1.0"

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion programs/vote/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ solana_sdk::declare_program!(
);

#[macro_use]
extern crate solana_sdk_macro;
extern crate solana_sdk_macro_frozen_abi;
2 changes: 1 addition & 1 deletion runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ solana-measure = { path = "../measure", version = "0.24.0" }
solana-metrics = { path = "../metrics", version = "0.24.0" }
solana-bpf-loader-program = { path = "../programs/bpf_loader", version = "0.24.0" }
solana-sdk = { path = "../sdk", version = "0.24.0" }
solana-sdk-macro = { path = "../sdk/macro", version = "0.24.0" }
solana-sdk-macro-frozen-abi = { path = "../sdk/macro-frozen-abi", version = "0.24.0" }
solana-stake-program = { path = "../programs/stake", version = "0.24.0" }
solana-storage-program = { path = "../programs/storage", version = "0.24.0" }
solana-vote-program = { path = "../programs/vote", version = "0.24.0" }
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern crate solana_bpf_loader_program;
extern crate serde_derive;

#[macro_use]
extern crate solana_sdk_macro;
extern crate solana_sdk_macro_frozen_abi;

extern crate fs_extra;
extern crate tempfile;
5 changes: 3 additions & 2 deletions sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ default = [
"ed25519-dalek",
"solana-logger",
"solana-crate-features",
"solana-sdk-macro"
]

[dependencies]
Expand Down Expand Up @@ -52,7 +51,9 @@ thiserror = "1.0"
ed25519-dalek = { version = "=1.0.0-pre.1", optional = true }
solana-crate-features = { path = "../crate-features", version = "0.24.0", optional = true }
solana-logger = { path = "../logger", version = "0.24.0", optional = true }
solana-sdk-macro = { path = "macro", version = "0.24.0", optional = true }
solana-sdk-macro = { path = "macro", version = "0.24.0" }
solana-sdk-macro-frozen-abi = { path = "macro-frozen-abi", version = "0.24.0" }
solana-sdk-macro-frozen-abi-dummy = { path = "macro-frozen-abi-dummy", version = "0.24.0" }

[dev-dependencies]
tiny-bip39 = "0.7.0"
Expand Down
18 changes: 18 additions & 0 deletions sdk/macro-frozen-abi-dummy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "solana-sdk-macro-frozen-abi-dummy"
version = "0.24.0"
description = "Solana SDK Macro frozen abi"
authors = ["Solana Maintainers <[email protected]>"]
repository = "https://github.com/solana-labs/solana"
homepage = "https://solana.com/"
license = "Apache-2.0"
edition = "2018"

[lib]
proc-macro = true

[dependencies]
bs58 = "0.3.0"
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0", features = ["full", "extra-traits"] }
8 changes: 8 additions & 0 deletions sdk/macro-frozen-abi-dummy/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extern crate proc_macro;

use proc_macro::TokenStream;

#[proc_macro_attribute]
pub fn frozen_abi(_attrs: TokenStream, item: TokenStream) -> TokenStream {
item
}
22 changes: 22 additions & 0 deletions sdk/macro-frozen-abi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "solana-sdk-macro-frozen-abi"
version = "0.24.0"
description = "Solana SDK Macro frozen abi"
authors = ["Solana Maintainers <[email protected]>"]
repository = "https://github.com/solana-labs/solana"
homepage = "https://solana.com/"
license = "Apache-2.0"
edition = "2018"
build = "../build.rs"

[lib]
proc-macro = true

[dependencies]
bs58 = "0.3.0"
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0", features = ["full", "extra-traits"] }

[build-dependencies]
rustc_version = "0.2"
Loading

0 comments on commit b3b65b0

Please sign in to comment.