Skip to content

Commit 2dbbd29

Browse files
committed
Remove frozen-abi-macro dependency on solana-logger
A couple items are logged, and we can simply use eprintln!() instead
1 parent 1ad7ca9 commit 2dbbd29

File tree

9 files changed

+4
-25
lines changed

9 files changed

+4
-25
lines changed

Cargo.lock

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

account/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ dev-context-only-utils = ["bincode", "dep:qualifier_attr"]
2020
frozen-abi = [
2121
"dep:solana-frozen-abi",
2222
"dep:solana-frozen-abi-macro",
23-
"dep:solana-logger",
2423
"solana-pubkey/frozen-abi",
2524
]
2625
serde = [
@@ -41,7 +40,6 @@ solana-clock = { workspace = true }
4140
solana-frozen-abi = { workspace = true, optional = true }
4241
solana-frozen-abi-macro = { workspace = true, optional = true }
4342
solana-instruction-error = { workspace = true }
44-
solana-logger = { workspace = true, optional = true }
4543
solana-pubkey = { workspace = true }
4644
solana-sdk-ids = { workspace = true }
4745
solana-sysvar = { workspace = true, features = ["bincode"], optional = true }

frozen-abi-macro/src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn derive_abi_sample_enum_type(input: ItemEnum) -> TokenStream {
142142
#( #attrs )*
143143
impl #impl_generics ::solana_frozen_abi::abi_example::AbiExample for #type_name #ty_generics #where_clause {
144144
fn example() -> Self {
145-
::solana_frozen_abi::__private::log::info!(
145+
::std::eprintln!(
146146
"AbiExample for enum: {}",
147147
std::any::type_name::<#type_name #ty_generics>()
148148
);
@@ -194,7 +194,7 @@ fn derive_abi_sample_struct_type(input: ItemStruct) -> TokenStream {
194194
#( #attrs )*
195195
impl #impl_generics ::solana_frozen_abi::abi_example::AbiExample for #type_name #ty_generics #where_clause {
196196
fn example() -> Self {
197-
::solana_frozen_abi::__private::log::info!(
197+
::std::eprintln!(
198198
"AbiExample for struct: {}",
199199
std::any::type_name::<#type_name #ty_generics>()
200200
);
@@ -287,22 +287,20 @@ fn quote_for_test(
287287

288288
#[test]
289289
fn test_abi_digest() {
290-
::solana_logger::setup();
291290
let mut digester = ::solana_frozen_abi::abi_digester::AbiDigester::create();
292291
let example = <#type_name>::example();
293292
let result = <_>::visit_for_abi(&&example, &mut digester);
294293
let mut hash = digester.finalize();
295-
// pretty-print error
296294
if result.is_err() {
297-
::solana_frozen_abi::__private::log::error!("digest error: {:#?}", result);
295+
::std::eprintln!("Error: digest error: {:#?}", result);
298296
}
299297
result.unwrap();
300298
let actual_digest = ::std::format!("{}", hash);
301299
if ::std::env::var("SOLANA_ABI_BULK_UPDATE").is_ok() {
302300
if #expected_digest != actual_digest {
303301
::std::eprintln!("sed -i -e 's/{}/{}/g' $(git grep --files-with-matches frozen_abi)", #expected_digest, hash);
304302
}
305-
::solana_frozen_abi::__private::log::warn!("Not testing the abi digest under SOLANA_ABI_BULK_UPDATE!");
303+
::std::eprintln!("Warning: Not testing the abi digest under SOLANA_ABI_BULK_UPDATE!");
306304
} else {
307305
if let Ok(dir) = ::std::env::var("SOLANA_ABI_DUMP_DIR") {
308306
assert_eq!(#expected_digest, actual_digest, "Possibly ABI changed? Examine the diff in SOLANA_ABI_DUMP_DIR!: \n$ diff -u {}/*{}* {}/*{}*", dir, #expected_digest, dir, actual_digest);

frozen-abi/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ memmap2 = { workspace = true }
4242
bitflags = { workspace = true, features = ["serde"] }
4343
serde_bytes = { workspace = true }
4444
serde_with = { workspace = true, features = ["macros"] }
45-
solana-logger = { workspace = true }
4645

4746
[lints]
4847
workspace = true

genesis-config/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ rustdoc-args = ["--cfg=docsrs"]
1818
frozen-abi = [
1919
"dep:solana-frozen-abi",
2020
"dep:solana-frozen-abi-macro",
21-
"dep:solana-logger",
2221
]
2322
serde = [
2423
"dep:serde",
@@ -49,7 +48,6 @@ solana-frozen-abi-macro = { workspace = true, optional = true }
4948
solana-hash = { workspace = true }
5049
solana-inflation = { workspace = true }
5150
solana-keypair = { workspace = true }
52-
solana-logger = { workspace = true, optional = true }
5351
solana-poh-config = { workspace = true }
5452
solana-pubkey = { workspace = true }
5553
solana-rent = { workspace = true }

message/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ dev-context-only-utils = ["bincode", "blake3"]
2222
frozen-abi = [
2323
"dep:solana-frozen-abi",
2424
"dep:solana-frozen-abi-macro",
25-
"dep:solana-logger",
2625
"solana-address/frozen-abi",
2726
"solana-hash/frozen-abi",
2827
"serde",
@@ -47,7 +46,6 @@ solana-frozen-abi = { workspace = true, optional = true }
4746
solana-frozen-abi-macro = { workspace = true, optional = true }
4847
solana-hash = { workspace = true, features = ["decode", "sanitize"] }
4948
solana-instruction = { workspace = true, features = ["std"] }
50-
solana-logger = { workspace = true, optional = true }
5149
solana-sanitize = { workspace = true }
5250
solana-sdk-ids = { workspace = true }
5351
solana-short-vec = { workspace = true, optional = true }

system-interface/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ bincode = ["dep:solana-instruction", "alloc", "serde"]
2424
frozen-abi = [
2525
"dep:solana-frozen-abi",
2626
"dep:solana-frozen-abi-macro",
27-
"dep:solana-logger",
2827
"serde",
2928
"std",
3029
"solana-address/frozen-abi",
@@ -41,7 +40,6 @@ solana-address = { workspace = true, features = ["decode"] }
4140
solana-frozen-abi = { workspace = true, features = ["frozen-abi"], optional = true }
4241
solana-frozen-abi-macro = { workspace = true, features = ["frozen-abi"], optional = true }
4342
solana-instruction = { workspace = true, features = ["bincode", "std"], optional = true }
44-
solana-logger = { workspace = true, optional = true }
4543
solana-msg = { workspace = true }
4644
solana-program-error = { workspace = true }
4745

transaction/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ dev-context-only-utils = ["blake3", "serde", "verify", "solana-hash/atomic"]
2626
frozen-abi = [
2727
"dep:solana-frozen-abi",
2828
"dep:solana-frozen-abi-macro",
29-
"dep:solana-logger",
3029
]
3130
serde = [
3231
"dep:serde",
@@ -47,7 +46,6 @@ solana-frozen-abi-macro = { workspace = true, optional = true }
4746
solana-hash = { workspace = true }
4847
solana-instruction = { workspace = true }
4948
solana-instruction-error = { workspace = true }
50-
solana-logger = { workspace = true, optional = true }
5149
solana-message = { workspace = true }
5250
solana-sanitize = { workspace = true }
5351
solana-sdk-ids = { workspace = true }

vote-interface/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ solana-serialize-utils = { workspace = true }
7777
itertools = { workspace = true }
7878
rand = { workspace = true }
7979
solana-epoch-schedule = { workspace = true }
80-
solana-logger = { workspace = true }
8180
solana-pubkey = { workspace = true, features = ["dev-context-only-utils"] }
8281
solana-vote-interface = { path = ".", features = ["dev-context-only-utils"] }
8382

0 commit comments

Comments
 (0)