From 6082e8434dfe1fa34be9bc38dfa76b863c1819ea Mon Sep 17 00:00:00 2001 From: Kevin Heavey Date: Tue, 17 Sep 2024 10:08:48 +0400 Subject: [PATCH] Remove frozen-abi build script (#2911) * replace cfg(RUSTC_WITH_SPECIALIZATION) with cfg(feature = "frozen-abi") * remove the build scripts for the two frozen-abi crates * remove all rustc_version deps * remove a rustc_version dep that I missed * fix duplicate lines in Cargo.toml files * remove build.rs from instruction crate * remove rustc_version from instruction crate * remove no-longer-needed check-cfg entries * update lock file after rebase --- Cargo.lock | 31 ---------------- Cargo.toml | 3 -- accounts-db/Cargo.toml | 12 +++---- accounts-db/build.rs | 1 - accounts-db/src/accounts_db.rs | 2 +- accounts-db/src/lib.rs | 2 +- bloom/Cargo.toml | 12 +++---- bloom/build.rs | 1 - bloom/src/lib.rs | 2 +- builtins-default-costs/Cargo.toml | 8 ++--- builtins-default-costs/build.rs | 1 - builtins-default-costs/src/lib.rs | 2 +- cargo-registry/Cargo.toml | 3 -- compute-budget/Cargo.toml | 8 ++--- compute-budget/build.rs | 1 - compute-budget/src/compute_budget.rs | 2 +- compute-budget/src/lib.rs | 2 +- core/Cargo.toml | 12 +++---- core/build.rs | 1 - core/src/lib.rs | 2 +- cost-model/Cargo.toml | 12 +++---- cost-model/build.rs | 1 - cost-model/src/lib.rs | 2 +- curves/secp256k1-recover/Cargo.toml | 13 +++---- curves/secp256k1-recover/build.rs | 1 - curves/secp256k1-recover/src/lib.rs | 2 +- frozen-abi/Cargo.toml | 8 ++--- frozen-abi/build.rs | 25 ------------- frozen-abi/macro/Cargo.toml | 8 ++--- frozen-abi/macro/build.rs | 1 - frozen-abi/macro/src/lib.rs | 45 +++++++++++------------- frozen-abi/src/lib.rs | 10 +++--- gossip/Cargo.toml | 12 +++---- gossip/build.rs | 1 - gossip/src/contact_info.rs | 2 +- gossip/src/lib.rs | 2 +- ledger/Cargo.toml | 12 +++---- ledger/build.rs | 1 - ledger/src/lib.rs | 2 +- perf/Cargo.toml | 14 ++++---- perf/build.rs | 24 ------------- perf/src/lib.rs | 2 +- perf/src/recycler.rs | 2 +- program-runtime/Cargo.toml | 12 +++---- program-runtime/build.rs | 1 - program-runtime/src/lib.rs | 2 +- program-runtime/src/loaded_programs.rs | 4 +-- program-runtime/src/sysvar_cache.rs | 2 +- programs/address-lookup-table/Cargo.toml | 3 -- programs/address-lookup-table/build.rs | 1 - programs/address-lookup-table/src/lib.rs | 2 +- programs/stake-tests/Cargo.toml | 3 -- programs/stake/Cargo.toml | 3 -- programs/stake/build.rs | 1 - programs/stake/src/lib.rs | 2 +- programs/vote/Cargo.toml | 12 +++---- programs/vote/build.rs | 1 - programs/vote/src/lib.rs | 2 +- runtime-transaction/Cargo.toml | 3 -- runtime-transaction/build.rs | 1 - runtime-transaction/src/lib.rs | 2 +- runtime/Cargo.toml | 12 +++---- runtime/build.rs | 1 - runtime/src/bank/serde_snapshot.rs | 2 +- runtime/src/lib.rs | 2 +- runtime/src/serde_snapshot.rs | 4 +-- runtime/src/serde_snapshot/storage.rs | 2 +- runtime/src/serde_snapshot/utils.rs | 8 ++--- runtime/src/stake_account.rs | 4 +-- sdk/Cargo.toml | 12 +++---- sdk/build.rs | 1 - sdk/feature-set/Cargo.toml | 12 +++---- sdk/feature-set/build.rs | 1 - sdk/feature-set/src/lib.rs | 2 +- sdk/hash/Cargo.toml | 12 +++---- sdk/hash/build.rs | 1 - sdk/hash/src/lib.rs | 2 +- sdk/instruction/Cargo.toml | 4 --- sdk/instruction/build.rs | 1 - sdk/instruction/src/lib.rs | 2 +- sdk/program/Cargo.toml | 4 --- sdk/program/build.rs | 1 - sdk/program/src/lib.rs | 2 +- sdk/pubkey/Cargo.toml | 12 +++---- sdk/pubkey/build.rs | 1 - sdk/pubkey/src/lib.rs | 2 +- sdk/signature/Cargo.toml | 12 +++---- sdk/signature/build.rs | 1 - sdk/signature/src/lib.rs | 2 +- sdk/src/fee.rs | 2 +- sdk/src/lib.rs | 2 +- sdk/src/packet.rs | 6 ++-- sdk/src/reserved_account_keys.rs | 2 +- short-vec/Cargo.toml | 13 +++---- short-vec/build.rs | 1 - short-vec/src/lib.rs | 2 +- svm/Cargo.toml | 12 +++---- svm/build.rs | 1 - svm/src/lib.rs | 2 +- svm/src/message_processor.rs | 2 +- svm/src/runtime_config.rs | 2 +- version/Cargo.toml | 12 +++---- version/build.rs | 1 - version/src/lib.rs | 2 +- vote/Cargo.toml | 12 +++---- vote/build.rs | 1 - vote/src/lib.rs | 2 +- 107 files changed, 210 insertions(+), 356 deletions(-) delete mode 120000 accounts-db/build.rs delete mode 120000 bloom/build.rs delete mode 120000 builtins-default-costs/build.rs delete mode 120000 compute-budget/build.rs delete mode 120000 core/build.rs delete mode 120000 cost-model/build.rs delete mode 120000 curves/secp256k1-recover/build.rs delete mode 100644 frozen-abi/build.rs delete mode 120000 frozen-abi/macro/build.rs delete mode 120000 gossip/build.rs delete mode 120000 ledger/build.rs delete mode 120000 program-runtime/build.rs delete mode 120000 programs/address-lookup-table/build.rs delete mode 120000 programs/stake/build.rs delete mode 120000 programs/vote/build.rs delete mode 120000 runtime-transaction/build.rs delete mode 120000 runtime/build.rs delete mode 120000 sdk/build.rs delete mode 120000 sdk/feature-set/build.rs delete mode 120000 sdk/hash/build.rs delete mode 120000 sdk/instruction/build.rs delete mode 120000 sdk/program/build.rs delete mode 120000 sdk/pubkey/build.rs delete mode 120000 sdk/signature/build.rs delete mode 120000 short-vec/build.rs delete mode 120000 svm/build.rs delete mode 120000 version/build.rs delete mode 120000 vote/build.rs diff --git a/Cargo.lock b/Cargo.lock index 6fdfa5f8df553c..cc21ffa28ef13e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,7 +87,6 @@ dependencies = [ "hex", "hyper", "log", - "rustc_version 0.4.1", "serde", "serde_derive", "serde_json", @@ -5713,7 +5712,6 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rayon", - "rustc_version 0.4.1", "seqlock", "serde", "serde_bytes", @@ -5753,7 +5751,6 @@ dependencies = [ "log", "num-derive", "num-traits", - "rustc_version 0.4.1", "solana-feature-set", "solana-log-collector", "solana-program", @@ -5918,7 +5915,6 @@ dependencies = [ "log", "rand 0.8.5", "rayon", - "rustc_version 0.4.1", "serde", "serde_derive", "solana-frozen-abi", @@ -6013,7 +6009,6 @@ dependencies = [ "lazy_static", "log", "rand 0.8.5", - "rustc_version 0.4.1", "solana-address-lookup-table-program", "solana-bpf-loader-program", "solana-compute-budget-program", @@ -6273,7 +6268,6 @@ dependencies = [ name = "solana-compute-budget" version = "2.1.0" dependencies = [ - "rustc_version 0.4.1", "solana-frozen-abi", "solana-sdk", ] @@ -6356,7 +6350,6 @@ dependencies = [ "rand_chacha 0.3.1", "rayon", "rolling-file", - "rustc_version 0.4.1", "rustls 0.23.13", "serde", "serde_bytes", @@ -6431,7 +6424,6 @@ dependencies = [ "lazy_static", "log", "rand 0.8.5", - "rustc_version 0.4.1", "solana-builtins-default-costs", "solana-compute-budget", "solana-feature-set", @@ -6587,7 +6579,6 @@ name = "solana-feature-set" version = "2.1.0" dependencies = [ "lazy_static", - "rustc_version 0.4.1", "solana-frozen-abi", "solana-frozen-abi-macro", "solana-program", @@ -6612,7 +6603,6 @@ dependencies = [ "im", "log", "memmap2", - "rustc_version 0.4.1", "serde", "serde_bytes", "serde_derive", @@ -6628,7 +6618,6 @@ version = "2.1.0" dependencies = [ "proc-macro2", "quote", - "rustc_version 0.4.1", "syn 2.0.77", ] @@ -6714,7 +6703,6 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rayon", - "rustc_version 0.4.1", "serde", "serde_bytes", "serde_derive", @@ -6759,7 +6747,6 @@ dependencies = [ "bytemuck", "bytemuck_derive", "js-sys", - "rustc_version 0.4.1", "serde", "serde_derive", "solana-atomic-u64", @@ -6787,7 +6774,6 @@ dependencies = [ "getrandom 0.2.10", "js-sys", "num-traits", - "rustc_version 0.4.1", "serde", "serde_derive", "solana-define-syscall", @@ -6860,7 +6846,6 @@ dependencies = [ "rayon", "reed-solomon-erasure", "rocksdb", - "rustc_version 0.4.1", "scopeguard", "serde", "serde_bytes", @@ -7125,7 +7110,6 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rayon", - "rustc_version 0.4.1", "serde", "solana-frozen-abi", "solana-frozen-abi-macro", @@ -7220,7 +7204,6 @@ dependencies = [ "parking_lot 0.12.3", "qualifier_attr", "rand 0.8.5", - "rustc_version 0.4.1", "serde", "serde_bytes", "serde_derive", @@ -7295,7 +7278,6 @@ dependencies = [ "num-traits", "percentage", "rand 0.8.5", - "rustc_version 0.4.1", "serde", "solana-compute-budget", "solana-feature-set", @@ -7366,7 +7348,6 @@ dependencies = [ "js-sys", "num-traits", "rand 0.8.5", - "rustc_version 0.4.1", "serde", "serde_derive", "solana-atomic-u64", @@ -7665,7 +7646,6 @@ dependencies = [ "rand_chacha 0.3.1", "rayon", "regex", - "rustc_version 0.4.1", "serde", "serde_derive", "serde_json", @@ -7726,7 +7706,6 @@ dependencies = [ "criterion", "log", "rand 0.8.5", - "rustc_version 0.4.1", "solana-builtins-default-costs", "solana-compute-budget", "solana-program", @@ -7774,7 +7753,6 @@ dependencies = [ "qualifier_attr", "rand 0.7.3", "rand 0.8.5", - "rustc_version 0.4.1", "serde", "serde_bytes", "serde_derive", @@ -7822,7 +7800,6 @@ dependencies = [ "anyhow", "borsh 1.5.1", "libsecp256k1", - "rustc_version 0.4.1", "solana-define-syscall", "solana-frozen-abi", "solana-frozen-abi-macro", @@ -7877,7 +7854,6 @@ version = "2.1.0" dependencies = [ "assert_matches", "bincode", - "rustc_version 0.4.1", "serde", "serde_json", "solana-frozen-abi", @@ -7893,7 +7869,6 @@ dependencies = [ "ed25519-dalek", "generic-array 0.14.7", "rand 0.8.5", - "rustc_version 0.4.1", "serde", "serde_derive", "solana-frozen-abi", @@ -7926,7 +7901,6 @@ dependencies = [ "bincode", "log", "proptest", - "rustc_version 0.4.1", "solana-compute-budget", "solana-config-program", "solana-feature-set", @@ -7945,7 +7919,6 @@ version = "2.1.0" dependencies = [ "assert_matches", "bincode", - "rustc_version 0.4.1", "solana-feature-set", "solana-program-test", "solana-sdk", @@ -8052,7 +8025,6 @@ dependencies = [ "prost", "qualifier_attr", "rand 0.8.5", - "rustc_version 0.4.1", "serde", "serde_derive", "shuttle", @@ -8461,7 +8433,6 @@ name = "solana-version" version = "2.1.0" dependencies = [ "log", - "rustc_version 0.4.1", "semver 1.0.23", "serde", "serde_derive", @@ -8481,7 +8452,6 @@ dependencies = [ "itertools 0.12.1", "log", "rand 0.8.5", - "rustc_version 0.4.1", "serde", "serde_derive", "solana-frozen-abi", @@ -8499,7 +8469,6 @@ dependencies = [ "log", "num-derive", "num-traits", - "rustc_version 0.4.1", "serde", "serde_derive", "solana-feature-set", diff --git a/Cargo.toml b/Cargo.toml index 18e6c3e879fbea..9605e91f04d90a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -178,8 +178,6 @@ level = "warn" check-cfg = [ 'cfg(target_os, values("solana"))', 'cfg(feature, values("frozen-abi", "no-entrypoint"))', - 'cfg(RUSTC_WITH_SPECIALIZATION)', - 'cfg(RUSTC_WITHOUT_SPECIALIZATION)', ] [workspace.dependencies] @@ -338,7 +336,6 @@ reqwest = { version = "0.11.27", default-features = false } reqwest-middleware = "0.2.5" rolling-file = "0.2.0" rpassword = "7.3" -rustc_version = "0.4" rustls = { version = "0.23.13", default-features = false } scopeguard = "1.2.0" semver = "1.0.23" diff --git a/accounts-db/Cargo.toml b/accounts-db/Cargo.toml index 2eb876219da96a..4d84e51daa0fbb 100644 --- a/accounts-db/Cargo.toml +++ b/accounts-db/Cargo.toml @@ -37,8 +37,12 @@ serde = { workspace = true, features = ["rc"] } serde_derive = { workspace = true } smallvec = { workspace = true, features = ["const_generics"] } solana-bucket-map = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-inline-spl = { workspace = true } solana-lattice-hash = { workspace = true } solana-measure = { workspace = true } @@ -79,9 +83,6 @@ test-case = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] dev-context-only-utils = [ "dep:qualifier_attr", @@ -89,7 +90,6 @@ dev-context-only-utils = [ "dep:solana-vote-program", ] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-sdk/frozen-abi", diff --git a/accounts-db/build.rs b/accounts-db/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/accounts-db/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/accounts-db/src/accounts_db.rs b/accounts-db/src/accounts_db.rs index 9842a6d9d4d0db..f863c81007b110 100644 --- a/accounts-db/src/accounts_db.rs +++ b/accounts-db/src/accounts_db.rs @@ -2415,7 +2415,7 @@ pub fn make_min_priority_thread_pool() -> ThreadPool { .unwrap() } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl solana_frozen_abi::abi_example::AbiExample for AccountsDb { fn example() -> Self { let accounts_db = AccountsDb::new_single_for_tests(); diff --git a/accounts-db/src/lib.rs b/accounts-db/src/lib.rs index 68ffe068bec6f2..8e7b4faf926b75 100644 --- a/accounts-db/src/lib.rs +++ b/accounts-db/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] #[macro_use] diff --git a/bloom/Cargo.toml b/bloom/Cargo.toml index 4c9d88893fbacf..f9d82460ec11c8 100644 --- a/bloom/Cargo.toml +++ b/bloom/Cargo.toml @@ -16,8 +16,12 @@ log = { workspace = true } rand = { workspace = true } serde = { workspace = true, features = ["rc"] } serde_derive = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-sanitize = { workspace = true } solana-sdk = { workspace = true } @@ -31,12 +35,8 @@ name = "solana_bloom" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-sdk/frozen-abi", diff --git a/bloom/build.rs b/bloom/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/bloom/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/bloom/src/lib.rs b/bloom/src/lib.rs index e188a9c2a1873a..944643883dd978 100644 --- a/bloom/src/lib.rs +++ b/bloom/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] pub mod bloom; #[cfg_attr(feature = "frozen-abi", macro_use)] diff --git a/builtins-default-costs/Cargo.toml b/builtins-default-costs/Cargo.toml index f2173aabed588f..bdd29a267280b5 100644 --- a/builtins-default-costs/Cargo.toml +++ b/builtins-default-costs/Cargo.toml @@ -17,7 +17,9 @@ solana-address-lookup-table-program = { workspace = true } solana-bpf-loader-program = { workspace = true } solana-compute-budget-program = { workspace = true } solana-config-program = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-loader-v4-program = { workspace = true } solana-sdk = { workspace = true } solana-stake-program = { workspace = true } @@ -35,12 +37,8 @@ rand = "0.8.5" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "solana-vote-program/frozen-abi", ] diff --git a/builtins-default-costs/build.rs b/builtins-default-costs/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/builtins-default-costs/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/builtins-default-costs/src/lib.rs b/builtins-default-costs/src/lib.rs index 43c5c3043fcfc0..915064b4b79e35 100644 --- a/builtins-default-costs/src/lib.rs +++ b/builtins-default-costs/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] use { ahash::AHashMap, diff --git a/cargo-registry/Cargo.toml b/cargo-registry/Cargo.toml index 3224845067a87a..fa876b944bca60 100644 --- a/cargo-registry/Cargo.toml +++ b/cargo-registry/Cargo.toml @@ -39,8 +39,5 @@ toml = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] dev-context-only-utils = [] diff --git a/compute-budget/Cargo.toml b/compute-budget/Cargo.toml index bbcaa27b8d57d5..07ba01cfdc785f 100644 --- a/compute-budget/Cargo.toml +++ b/compute-budget/Cargo.toml @@ -10,15 +10,13 @@ license = { workspace = true } edition = { workspace = true } [dependencies] -solana-frozen-abi = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-sdk = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "solana-sdk/frozen-abi", ] diff --git a/compute-budget/build.rs b/compute-budget/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/compute-budget/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/compute-budget/src/compute_budget.rs b/compute-budget/src/compute_budget.rs index 5539e812645349..577a000b7c6799 100644 --- a/compute-budget/src/compute_budget.rs +++ b/compute-budget/src/compute_budget.rs @@ -1,6 +1,6 @@ use crate::compute_budget_limits::{self, ComputeBudgetLimits, DEFAULT_HEAP_COST}; -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl ::solana_frozen_abi::abi_example::AbiExample for ComputeBudget { fn example() -> Self { // ComputeBudget is not Serialize so just rely on Default. diff --git a/compute-budget/src/lib.rs b/compute-budget/src/lib.rs index f6ff865be67185..46a8312dcffd27 100644 --- a/compute-budget/src/lib.rs +++ b/compute-budget/src/lib.rs @@ -1,5 +1,5 @@ //! Solana compute budget types and default configurations. -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] pub mod compute_budget; pub mod compute_budget_limits; diff --git a/core/Cargo.toml b/core/Cargo.toml index bbceb94dbc659e..4d0797908627f5 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -54,8 +54,12 @@ solana-cost-model = { workspace = true } solana-entry = { workspace = true } solana-feature-set = { workspace = true } solana-fee = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-geyser-plugin-manager = { workspace = true } solana-gossip = { workspace = true } solana-ledger = { workspace = true } @@ -118,15 +122,11 @@ test-case = { workspace = true } [target."cfg(unix)".dependencies] sysctl = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] dev-context-only-utils = [ "solana-runtime/dev-context-only-utils", ] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-accounts-db/frozen-abi", diff --git a/core/build.rs b/core/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/core/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/core/src/lib.rs b/core/src/lib.rs index 2ba671ca62b580..c88488f0876667 100644 --- a/core/src/lib.rs +++ b/core/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] #![recursion_limit = "2048"] //! The `solana` library implements the Solana high-performance blockchain architecture. diff --git a/cost-model/Cargo.toml b/cost-model/Cargo.toml index 2339f2e9d3eee4..54564e1e0dd9ca 100644 --- a/cost-model/Cargo.toml +++ b/cost-model/Cargo.toml @@ -16,8 +16,12 @@ log = { workspace = true } solana-builtins-default-costs = { workspace = true } solana-compute-budget = { workspace = true } solana-feature-set = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-metrics = { workspace = true } solana-runtime-transaction = { workspace = true } solana-sdk = { workspace = true } @@ -40,12 +44,8 @@ test-case = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-compute-budget/frozen-abi", diff --git a/cost-model/build.rs b/cost-model/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/cost-model/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/cost-model/src/lib.rs b/cost-model/src/lib.rs index d0e043c9ad77ed..f408a18de3b377 100644 --- a/cost-model/src/lib.rs +++ b/cost-model/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] pub mod block_cost_limits; diff --git a/curves/secp256k1-recover/Cargo.toml b/curves/secp256k1-recover/Cargo.toml index 6f983ef6d713c4..daa138f76e18e6 100644 --- a/curves/secp256k1-recover/Cargo.toml +++ b/curves/secp256k1-recover/Cargo.toml @@ -11,8 +11,12 @@ edition = { workspace = true } [dependencies] borsh = { workspace = true, optional = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } thiserror = { workspace = true } [target.'cfg(target_os = "solana")'.dependencies] @@ -28,12 +32,9 @@ borsh = { workspace = true } [target.'cfg(not(target_os = "solana"))'.dev-dependencies] libsecp256k1 = { workspace = true, features = ["hmac"] } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] borsh = ["dep:borsh"] -frozen-abi = ["dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro"] +frozen-abi = ["dep:solana-frozen-abi", "dep:solana-frozen-abi-macro"] [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/curves/secp256k1-recover/build.rs b/curves/secp256k1-recover/build.rs deleted file mode 120000 index 84539eddaa6ded..00000000000000 --- a/curves/secp256k1-recover/build.rs +++ /dev/null @@ -1 +0,0 @@ -../../frozen-abi/build.rs \ No newline at end of file diff --git a/curves/secp256k1-recover/src/lib.rs b/curves/secp256k1-recover/src/lib.rs index 837f2b8cf3aed3..55c764b214a1e3 100644 --- a/curves/secp256k1-recover/src/lib.rs +++ b/curves/secp256k1-recover/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] //! Public key recovery from [secp256k1] ECDSA signatures. //! //! [secp256k1]: https://en.bitcoin.it/wiki/Secp256k1 diff --git a/frozen-abi/Cargo.toml b/frozen-abi/Cargo.toml index 18382a28b3b1bd..78f0c6a67e5f83 100644 --- a/frozen-abi/Cargo.toml +++ b/frozen-abi/Cargo.toml @@ -29,12 +29,10 @@ bitflags = { workspace = true, features = ["serde"] } serde_bytes = { workspace = true } solana-logger = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true } - [features] -default = ["frozen-abi"] -# no reason to deactivate this. It's needed because the build.rs is reused elsewhere +default = [] +# activate the frozen-abi feature when we actually want to do frozen-abi testing, +# otherwise leave it off because it requires nightly Rust frozen-abi = [] [lints] diff --git a/frozen-abi/build.rs b/frozen-abi/build.rs deleted file mode 100644 index a95ef31ad70f65..00000000000000 --- a/frozen-abi/build.rs +++ /dev/null @@ -1,25 +0,0 @@ -#[cfg(feature = "frozen-abi")] -extern crate rustc_version; -#[cfg(feature = "frozen-abi")] -use rustc_version::{version_meta, Channel}; - -fn main() { - #[cfg(feature = "frozen-abi")] - // Copied and adapted from - // https://github.com/Kimundi/rustc-version-rs/blob/1d692a965f4e48a8cb72e82cda953107c0d22f47/README.md#example - // Licensed under Apache-2.0 + MIT - match version_meta().unwrap().channel { - Channel::Stable => { - println!("cargo:rustc-cfg=RUSTC_WITHOUT_SPECIALIZATION"); - } - Channel::Beta => { - println!("cargo:rustc-cfg=RUSTC_WITHOUT_SPECIALIZATION"); - } - Channel::Nightly => { - println!("cargo:rustc-cfg=RUSTC_WITH_SPECIALIZATION"); - } - Channel::Dev => { - println!("cargo:rustc-cfg=RUSTC_WITH_SPECIALIZATION"); - } - } -} diff --git a/frozen-abi/macro/Cargo.toml b/frozen-abi/macro/Cargo.toml index f5cb98c1287e45..e0f61637913331 100644 --- a/frozen-abi/macro/Cargo.toml +++ b/frozen-abi/macro/Cargo.toml @@ -17,12 +17,10 @@ proc-macro2 = { workspace = true } quote = { workspace = true } syn = { workspace = true, features = ["full", "extra-traits"] } -[build-dependencies] -rustc_version = { workspace = true } - [features] -default = ["frozen-abi"] -# no reason to deactivate this. It's needed because the build.rs is reused elsewhere +default = [] +# activate the frozen-abi feature when we actually want to do frozen-abi testing, +# otherwise leave it off because it requires nightly Rust frozen-abi = [] [lints] diff --git a/frozen-abi/macro/build.rs b/frozen-abi/macro/build.rs deleted file mode 120000 index 10238032f5f6ec..00000000000000 --- a/frozen-abi/macro/build.rs +++ /dev/null @@ -1 +0,0 @@ -../build.rs \ No newline at end of file diff --git a/frozen-abi/macro/src/lib.rs b/frozen-abi/macro/src/lib.rs index bb3f7886169111..abdb0908f8901a 100644 --- a/frozen-abi/macro/src/lib.rs +++ b/frozen-abi/macro/src/lib.rs @@ -1,43 +1,38 @@ extern crate proc_macro; -// This file littered with these essential cfgs so ensure them. -#[cfg(not(any(RUSTC_WITH_SPECIALIZATION, RUSTC_WITHOUT_SPECIALIZATION)))] -compile_error!("rustc_version is missing in build dependency and build.rs is not specified"); - -#[cfg(any(RUSTC_WITH_SPECIALIZATION, RUSTC_WITHOUT_SPECIALIZATION))] use proc_macro::TokenStream; // Define dummy macro_attribute and macro_derive for stable rustc -#[cfg(RUSTC_WITHOUT_SPECIALIZATION)] +#[cfg(not(feature = "frozen-abi"))] #[proc_macro_attribute] pub fn frozen_abi(_attrs: TokenStream, item: TokenStream) -> TokenStream { item } -#[cfg(RUSTC_WITHOUT_SPECIALIZATION)] +#[cfg(not(feature = "frozen-abi"))] #[proc_macro_derive(AbiExample)] pub fn derive_abi_sample(_item: TokenStream) -> TokenStream { "".parse().unwrap() } -#[cfg(RUSTC_WITHOUT_SPECIALIZATION)] +#[cfg(not(feature = "frozen-abi"))] #[proc_macro_derive(AbiEnumVisitor)] pub fn derive_abi_enum_visitor(_item: TokenStream) -> TokenStream { "".parse().unwrap() } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] use proc_macro2::{Span, TokenStream as TokenStream2, TokenTree}; -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] use quote::{quote, ToTokens}; -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] use syn::{ parse_macro_input, Attribute, Error, Fields, Ident, Item, ItemEnum, ItemStruct, ItemType, LitStr, Variant, }; -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn filter_serde_attrs(attrs: &[Attribute]) -> bool { fn contains_skip(tokens: TokenStream2) -> bool { for token in tokens.into_iter() { @@ -72,7 +67,7 @@ fn filter_serde_attrs(attrs: &[Attribute]) -> bool { false } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn filter_allow_attrs(attrs: &mut Vec) { attrs.retain(|attr| { let ss = &attr.path().segments.first().unwrap().ident.to_string(); @@ -80,7 +75,7 @@ fn filter_allow_attrs(attrs: &mut Vec) { }); } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn derive_abi_sample_enum_type(input: ItemEnum) -> TokenStream { let type_name = &input.ident; @@ -157,7 +152,7 @@ fn derive_abi_sample_enum_type(input: ItemEnum) -> TokenStream { result.into() } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn derive_abi_sample_struct_type(input: ItemStruct) -> TokenStream { let type_name = &input.ident; let mut sample_fields = quote! {}; @@ -212,7 +207,7 @@ fn derive_abi_sample_struct_type(input: ItemStruct) -> TokenStream { result.into() } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] #[proc_macro_derive(AbiExample)] pub fn derive_abi_sample(item: TokenStream) -> TokenStream { let item = parse_macro_input!(item as Item); @@ -226,7 +221,7 @@ pub fn derive_abi_sample(item: TokenStream) -> TokenStream { } } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn do_derive_abi_enum_visitor(input: ItemEnum) -> TokenStream { let type_name = &input.ident; let mut serialized_variants = quote! {}; @@ -264,7 +259,7 @@ fn do_derive_abi_enum_visitor(input: ItemEnum) -> TokenStream { }).into() } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] #[proc_macro_derive(AbiEnumVisitor)] pub fn derive_abi_enum_visitor(item: TokenStream) -> TokenStream { let item = parse_macro_input!(item as Item); @@ -277,7 +272,7 @@ pub fn derive_abi_enum_visitor(item: TokenStream) -> TokenStream { } } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn quote_for_test( test_mod_ident: &Ident, type_name: &Ident, @@ -321,12 +316,12 @@ fn quote_for_test( } } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn test_mod_name(type_name: &Ident) -> Ident { Ident::new(&format!("{type_name}_frozen_abi"), Span::call_site()) } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn frozen_abi_type_alias(input: ItemType, expected_digest: &str) -> TokenStream { let type_name = &input.ident; let test = quote_for_test(&test_mod_name(type_name), type_name, expected_digest); @@ -337,7 +332,7 @@ fn frozen_abi_type_alias(input: ItemType, expected_digest: &str) -> TokenStream result.into() } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn frozen_abi_struct_type(input: ItemStruct, expected_digest: &str) -> TokenStream { let type_name = &input.ident; let test = quote_for_test(&test_mod_name(type_name), type_name, expected_digest); @@ -348,7 +343,7 @@ fn frozen_abi_struct_type(input: ItemStruct, expected_digest: &str) -> TokenStre result.into() } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn quote_sample_variant( type_name: &Ident, ty_generics: &syn::TypeGenerics, @@ -394,7 +389,7 @@ fn quote_sample_variant( } } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] fn frozen_abi_enum_type(input: ItemEnum, expected_digest: &str) -> TokenStream { let type_name = &input.ident; let test = quote_for_test(&test_mod_name(type_name), type_name, expected_digest); @@ -405,7 +400,7 @@ fn frozen_abi_enum_type(input: ItemEnum, expected_digest: &str) -> TokenStream { result.into() } -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] #[proc_macro_attribute] pub fn frozen_abi(attrs: TokenStream, item: TokenStream) -> TokenStream { let mut expected_digest: Option = None; diff --git a/frozen-abi/src/lib.rs b/frozen-abi/src/lib.rs index d9007738a68f16..4c6819e1c297a6 100644 --- a/frozen-abi/src/lib.rs +++ b/frozen-abi/src/lib.rs @@ -1,17 +1,17 @@ #![allow(incomplete_features)] -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(specialization))] +#![cfg_attr(feature = "frozen-abi", feature(specialization))] // Allows macro expansion of `use ::solana_frozen_abi::*` to work within this crate extern crate self as solana_frozen_abi; -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] pub mod abi_digester; -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] pub mod abi_example; -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] mod hash; -#[cfg(RUSTC_WITH_SPECIALIZATION)] +#[cfg(feature = "frozen-abi")] #[macro_use] extern crate solana_frozen_abi_macro; diff --git a/gossip/Cargo.toml b/gossip/Cargo.toml index 679c4a93f91e09..48449a5d078809 100644 --- a/gossip/Cargo.toml +++ b/gossip/Cargo.toml @@ -33,8 +33,12 @@ solana-client = { workspace = true } solana-connection-cache = { workspace = true } solana-entry = { workspace = true } solana-feature-set = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-ledger = { workspace = true } solana-logger = { workspace = true } solana-measure = { workspace = true } @@ -62,12 +66,8 @@ serial_test = { workspace = true } solana-runtime = { workspace = true, features = ["dev-context-only-utils"] } test-case = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-bloom/frozen-abi", diff --git a/gossip/build.rs b/gossip/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/gossip/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/gossip/src/contact_info.rs b/gossip/src/contact_info.rs index 3b05a0fd5fbc81..4a39ae34a6cbd3 100644 --- a/gossip/src/contact_info.rs +++ b/gossip/src/contact_info.rs @@ -625,7 +625,7 @@ pub(crate) fn get_quic_socket(socket: &SocketAddr) -> Result )) } -#[cfg(all(test, RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(all(test, feature = "frozen-abi"))] impl solana_frozen_abi::abi_example::AbiExample for ContactInfo { fn example() -> Self { Self { diff --git a/gossip/src/lib.rs b/gossip/src/lib.rs index c164a4cd3fde96..b1c90c335edb4b 100644 --- a/gossip/src/lib.rs +++ b/gossip/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] pub mod cluster_info; diff --git a/ledger/Cargo.toml b/ledger/Cargo.toml index b12fcddf2b9b41..15c56d07c94c33 100644 --- a/ledger/Cargo.toml +++ b/ledger/Cargo.toml @@ -46,8 +46,12 @@ solana-bpf-loader-program = { workspace = true } solana-cost-model = { workspace = true } solana-entry = { workspace = true } solana-feature-set = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-measure = { workspace = true } solana-metrics = { workspace = true } solana-perf = { workspace = true } @@ -90,13 +94,9 @@ solana-runtime = { workspace = true, features = ["dev-context-only-utils"] } spl-pod = { workspace = true } test-case = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] dev-context-only-utils = [] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-runtime/frozen-abi", diff --git a/ledger/build.rs b/ledger/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/ledger/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/ledger/src/lib.rs b/ledger/src/lib.rs index a7007b49fa4223..c47d6317fc08e6 100644 --- a/ledger/src/lib.rs +++ b/ledger/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] #![recursion_limit = "2048"] diff --git a/perf/Cargo.toml b/perf/Cargo.toml index 0e90fd7ccf231a..cc0354a2677e9e 100644 --- a/perf/Cargo.toml +++ b/perf/Cargo.toml @@ -21,8 +21,12 @@ log = { workspace = true } rand = { workspace = true } rayon = { workspace = true } serde = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-metrics = { workspace = true } solana-rayon-threadlimit = { workspace = true } solana-sdk = { workspace = true } @@ -43,12 +47,8 @@ rand_chacha = { workspace = true } solana-logger = { workspace = true } test-case = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-sdk/frozen-abi", @@ -70,6 +70,4 @@ level = "warn" check-cfg = [ 'cfg(build_target_feature_avx)', 'cfg(build_target_feature_avx2)', - 'cfg(RUSTC_WITH_SPECIALIZATION)', - 'cfg(RUSTC_WITHOUT_SPECIALIZATION)', ] diff --git a/perf/build.rs b/perf/build.rs index a38f6c73307cd7..025c71008f092b 100644 --- a/perf/build.rs +++ b/perf/build.rs @@ -1,8 +1,3 @@ -#[cfg(feature = "frozen-abi")] -extern crate rustc_version; -#[cfg(feature = "frozen-abi")] -use rustc_version::{version_meta, Channel}; - fn main() { #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] { @@ -13,23 +8,4 @@ fn main() { println!("cargo:rustc-cfg=build_target_feature_avx2"); } } - - // Copied and adapted from - // https://github.com/Kimundi/rustc-version-rs/blob/1d692a965f4e48a8cb72e82cda953107c0d22f47/README.md#example - // Licensed under Apache-2.0 + MIT - #[cfg(feature = "frozen-abi")] - match version_meta().unwrap().channel { - Channel::Stable => { - println!("cargo:rustc-cfg=RUSTC_WITHOUT_SPECIALIZATION"); - } - Channel::Beta => { - println!("cargo:rustc-cfg=RUSTC_WITHOUT_SPECIALIZATION"); - } - Channel::Nightly => { - println!("cargo:rustc-cfg=RUSTC_WITH_SPECIALIZATION"); - } - Channel::Dev => { - println!("cargo:rustc-cfg=RUSTC_WITH_SPECIALIZATION"); - } - } } diff --git a/perf/src/lib.rs b/perf/src/lib.rs index b3d09c91eb99d0..c70b3afbb0d49a 100644 --- a/perf/src/lib.rs +++ b/perf/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] pub mod cuda_runtime; pub mod data_budget; pub mod deduper; diff --git a/perf/src/recycler.rs b/perf/src/recycler.rs index 3053d5717a913c..3af4e554f870eb 100644 --- a/perf/src/recycler.rs +++ b/perf/src/recycler.rs @@ -57,7 +57,7 @@ impl Default for RecyclerX { } } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl solana_frozen_abi::abi_example::AbiExample for RecyclerX> { diff --git a/program-runtime/Cargo.toml b/program-runtime/Cargo.toml index af276bc12562d0..4e764de35b5854 100644 --- a/program-runtime/Cargo.toml +++ b/program-runtime/Cargo.toml @@ -23,8 +23,12 @@ rand = { workspace = true } serde = { workspace = true } solana-compute-budget = { workspace = true } solana-feature-set = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-log-collector = { workspace = true } solana-measure = { workspace = true } solana-metrics = { workspace = true } @@ -48,12 +52,8 @@ name = "solana_program_runtime" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-compute-budget/frozen-abi", diff --git a/program-runtime/build.rs b/program-runtime/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/program-runtime/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/program-runtime/src/lib.rs b/program-runtime/src/lib.rs index 7033b96aa875e1..3a690d1d0824e9 100644 --- a/program-runtime/src/lib.rs +++ b/program-runtime/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![deny(clippy::arithmetic_side_effects)] #![deny(clippy::indexing_slicing)] diff --git a/program-runtime/src/loaded_programs.rs b/program-runtime/src/loaded_programs.rs index e7b49a38951623..181f5280db71d6 100644 --- a/program-runtime/src/loaded_programs.rs +++ b/program-runtime/src/loaded_programs.rs @@ -1347,7 +1347,7 @@ impl ProgramCache { } } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl solana_frozen_abi::abi_example::AbiExample for ProgramCacheEntry { fn example() -> Self { // ProgramCacheEntry isn't serializable by definition. @@ -1355,7 +1355,7 @@ impl solana_frozen_abi::abi_example::AbiExample for ProgramCacheEntry { } } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl solana_frozen_abi::abi_example::AbiExample for ProgramCache { fn example() -> Self { // ProgramCache isn't serializable by definition. diff --git a/program-runtime/src/sysvar_cache.rs b/program-runtime/src/sysvar_cache.rs index 79124bd93f379e..8b4bc614375b64 100644 --- a/program-runtime/src/sysvar_cache.rs +++ b/program-runtime/src/sysvar_cache.rs @@ -16,7 +16,7 @@ use { solana_type_overrides::sync::Arc, }; -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl ::solana_frozen_abi::abi_example::AbiExample for SysvarCache { fn example() -> Self { // SysvarCache is not Serialize so just rely on Default. diff --git a/programs/address-lookup-table/Cargo.toml b/programs/address-lookup-table/Cargo.toml index 30e1ca5a0f3d7b..7c0836219e8508 100644 --- a/programs/address-lookup-table/Cargo.toml +++ b/programs/address-lookup-table/Cargo.toml @@ -24,9 +24,6 @@ solana-log-collector = { workspace = true } solana-program-runtime = { workspace = true } solana-sdk = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [lib] crate-type = ["lib"] name = "solana_address_lookup_table_program" diff --git a/programs/address-lookup-table/build.rs b/programs/address-lookup-table/build.rs deleted file mode 120000 index 84539eddaa6ded..00000000000000 --- a/programs/address-lookup-table/build.rs +++ /dev/null @@ -1 +0,0 @@ -../../frozen-abi/build.rs \ No newline at end of file diff --git a/programs/address-lookup-table/src/lib.rs b/programs/address-lookup-table/src/lib.rs index e146dd184b5385..65dae7585777c1 100644 --- a/programs/address-lookup-table/src/lib.rs +++ b/programs/address-lookup-table/src/lib.rs @@ -1,5 +1,5 @@ #![allow(incomplete_features)] -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(specialization))] +#![cfg_attr(feature = "frozen-abi", feature(specialization))] #[cfg(not(target_os = "solana"))] pub mod processor; diff --git a/programs/stake-tests/Cargo.toml b/programs/stake-tests/Cargo.toml index f73a7a4195dd0a..e38ae57f62b791 100644 --- a/programs/stake-tests/Cargo.toml +++ b/programs/stake-tests/Cargo.toml @@ -20,8 +20,5 @@ solana-sdk = { workspace = true } solana-vote-program = { workspace = true } test-case = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/programs/stake/Cargo.toml b/programs/stake/Cargo.toml index d5a14a98d4d0ec..5d5dbd442afa3c 100644 --- a/programs/stake/Cargo.toml +++ b/programs/stake/Cargo.toml @@ -27,9 +27,6 @@ solana-compute-budget = { workspace = true } solana-logger = { workspace = true } test-case = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [lib] crate-type = ["lib"] name = "solana_stake_program" diff --git a/programs/stake/build.rs b/programs/stake/build.rs deleted file mode 120000 index 84539eddaa6ded..00000000000000 --- a/programs/stake/build.rs +++ /dev/null @@ -1 +0,0 @@ -../../frozen-abi/build.rs \ No newline at end of file diff --git a/programs/stake/src/lib.rs b/programs/stake/src/lib.rs index 4ea8df91501a85..e56d9d4b996676 100644 --- a/programs/stake/src/lib.rs +++ b/programs/stake/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] #[deprecated( since = "1.8.0", diff --git a/programs/vote/Cargo.toml b/programs/vote/Cargo.toml index d76f5e1980818b..80d4cbe34d4987 100644 --- a/programs/vote/Cargo.toml +++ b/programs/vote/Cargo.toml @@ -17,8 +17,12 @@ num-traits = { workspace = true } serde = { workspace = true } serde_derive = { workspace = true } solana-feature-set = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-metrics = { workspace = true } solana-program = { workspace = true } solana-program-runtime = { workspace = true } @@ -30,9 +34,6 @@ assert_matches = { workspace = true } solana-logger = { workspace = true } test-case = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [lib] crate-type = ["lib"] name = "solana_vote_program" @@ -42,7 +43,6 @@ targets = ["x86_64-unknown-linux-gnu"] [features] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-program/frozen-abi", diff --git a/programs/vote/build.rs b/programs/vote/build.rs deleted file mode 120000 index 84539eddaa6ded..00000000000000 --- a/programs/vote/build.rs +++ /dev/null @@ -1 +0,0 @@ -../../frozen-abi/build.rs \ No newline at end of file diff --git a/programs/vote/src/lib.rs b/programs/vote/src/lib.rs index b63eaa1c5eb643..978d42f6d98282 100644 --- a/programs/vote/src/lib.rs +++ b/programs/vote/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] pub mod vote_processor; pub mod vote_state; diff --git a/runtime-transaction/Cargo.toml b/runtime-transaction/Cargo.toml index 69d172ec112c7c..772a9e28af93df 100644 --- a/runtime-transaction/Cargo.toml +++ b/runtime-transaction/Cargo.toml @@ -31,9 +31,6 @@ solana-program = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [[bench]] name = "process_compute_budget_instructions" harness = false diff --git a/runtime-transaction/build.rs b/runtime-transaction/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/runtime-transaction/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/runtime-transaction/src/lib.rs b/runtime-transaction/src/lib.rs index 28d54b4eb3b6b8..9b79a97d40e874 100644 --- a/runtime-transaction/src/lib.rs +++ b/runtime-transaction/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] mod compute_budget_instruction_details; diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 5a740f32805aed..583a79d0359081 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -56,8 +56,12 @@ solana-config-program = { workspace = true } solana-cost-model = { workspace = true } solana-feature-set = { workspace = true } solana-fee = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-inline-spl = { workspace = true } solana-loader-v4-program = { workspace = true } solana-measure = { workspace = true } @@ -113,13 +117,9 @@ test-case = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] dev-context-only-utils = ["solana-svm/dev-context-only-utils"] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-accounts-db/frozen-abi", diff --git a/runtime/build.rs b/runtime/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/runtime/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/runtime/src/bank/serde_snapshot.rs b/runtime/src/bank/serde_snapshot.rs index 69de472175978e..d0a422e1ad95d0 100644 --- a/runtime/src/bank/serde_snapshot.rs +++ b/runtime/src/bank/serde_snapshot.rs @@ -502,7 +502,7 @@ mod tests { assert_eq!(dbank.epoch_reward_status, EpochRewardStatus::Inactive); } - #[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] + #[cfg(feature = "frozen-abi")] mod test_bank_serialize { use { super::*, diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index d066628c717b34..d4c78936f1b517 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] #[macro_use] diff --git a/runtime/src/serde_snapshot.rs b/runtime/src/serde_snapshot.rs index b49e336ac4aa27..7dd6e7bf7f21e8 100644 --- a/runtime/src/serde_snapshot.rs +++ b/runtime/src/serde_snapshot.rs @@ -283,7 +283,7 @@ impl From for SerializableVersionedBank { } } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl solana_frozen_abi::abi_example::TransparentAsHelper for SerializableVersionedBank {} /// Helper type to wrap BufReader streams when deserializing and reconstructing from either just a @@ -817,7 +817,7 @@ impl<'a> Serialize for SerializableAccountsDb<'a> { } } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl<'a> solana_frozen_abi::abi_example::TransparentAsHelper for SerializableAccountsDb<'a> {} #[allow(clippy::too_many_arguments)] diff --git a/runtime/src/serde_snapshot/storage.rs b/runtime/src/serde_snapshot/storage.rs index 7308e24c6e025a..c079a6f34d39cc 100644 --- a/runtime/src/serde_snapshot/storage.rs +++ b/runtime/src/serde_snapshot/storage.rs @@ -36,5 +36,5 @@ impl From<&AccountStorageEntry> for SerializableAccountStorageEntry { } } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl solana_frozen_abi::abi_example::TransparentAsHelper for SerializableAccountStorageEntry {} diff --git a/runtime/src/serde_snapshot/utils.rs b/runtime/src/serde_snapshot/utils.rs index a9b953ba4851bf..3484d255b79951 100644 --- a/runtime/src/serde_snapshot/utils.rs +++ b/runtime/src/serde_snapshot/utils.rs @@ -2,7 +2,7 @@ use serde::{ ser::{SerializeSeq, SerializeTuple}, Serialize, Serializer, }; -#[cfg(all(test, RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(all(test, feature = "frozen-abi"))] use solana_frozen_abi::abi_example::TransparentAsHelper; // consumes an iterator and returns an object that will serialize as a serde seq @@ -17,7 +17,7 @@ where iter: std::cell::RefCell>, } - #[cfg(all(test, RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] + #[cfg(all(test, feature = "frozen-abi"))] impl TransparentAsHelper for SerializableSequencedIterator {} impl Serialize for SerializableSequencedIterator @@ -56,7 +56,7 @@ where iter: std::cell::RefCell>, } - #[cfg(all(test, RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] + #[cfg(all(test, feature = "frozen-abi"))] impl TransparentAsHelper for SerializableSequencedIterator {} impl Serialize for SerializableSequencedIterator @@ -95,7 +95,7 @@ where iter: std::cell::RefCell>, } - #[cfg(all(test, RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] + #[cfg(all(test, feature = "frozen-abi"))] impl TransparentAsHelper for SerializableMappedIterator {} impl Serialize for SerializableMappedIterator diff --git a/runtime/src/stake_account.rs b/runtime/src/stake_account.rs index d4fe0d65784f30..85cbb9e852ae54 100644 --- a/runtime/src/stake_account.rs +++ b/runtime/src/stake_account.rs @@ -1,4 +1,4 @@ -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] use solana_frozen_abi::abi_example::AbiExample; use { solana_sdk::{ @@ -98,7 +98,7 @@ impl PartialEq> for StakeAccount { } } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl AbiExample for StakeAccount { fn example() -> Self { use solana_sdk::{ diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index afc2d7e6c584cf..8793f1e58bd1ab 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -37,7 +37,6 @@ full = [ borsh = ["dep:borsh", "solana-program/borsh", "solana-secp256k1-recover/borsh"] dev-context-only-utils = ["qualifier_attr"] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-feature-set/frozen-abi", @@ -88,8 +87,12 @@ solana-bn254 = { workspace = true } solana-decode-error = { workspace = true } solana-derivation-path = { workspace = true } solana-feature-set = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-program = { workspace = true } solana-program-memory = { workspace = true } solana-sanitize = { workspace = true } @@ -121,9 +124,6 @@ solana-sdk = { path = ".", features = ["dev-context-only-utils"] } static_assertions = { workspace = true } tiny-bip39 = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/sdk/build.rs b/sdk/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/sdk/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/sdk/feature-set/Cargo.toml b/sdk/feature-set/Cargo.toml index 02da9d0cc4f2f9..d6f2824b08982e 100644 --- a/sdk/feature-set/Cargo.toml +++ b/sdk/feature-set/Cargo.toml @@ -11,16 +11,16 @@ edition = { workspace = true } [dependencies] lazy_static = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-program = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", ] diff --git a/sdk/feature-set/build.rs b/sdk/feature-set/build.rs deleted file mode 120000 index 84539eddaa6ded..00000000000000 --- a/sdk/feature-set/build.rs +++ /dev/null @@ -1 +0,0 @@ -../../frozen-abi/build.rs \ No newline at end of file diff --git a/sdk/feature-set/src/lib.rs b/sdk/feature-set/src/lib.rs index f2b094e90850dd..6567404a947db5 100644 --- a/sdk/feature-set/src/lib.rs +++ b/sdk/feature-set/src/lib.rs @@ -17,7 +17,7 @@ //! 3. Add desired logic to check for and switch on feature availability. //! //! For more information on how features are picked up, see comments for `Feature`. -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] use { lazy_static::lazy_static, diff --git a/sdk/hash/Cargo.toml b/sdk/hash/Cargo.toml index de0dafd76226da..ecf502e0ba243d 100644 --- a/sdk/hash/Cargo.toml +++ b/sdk/hash/Cargo.toml @@ -20,8 +20,12 @@ bytemuck_derive = { workspace = true, optional = true } serde = { workspace = true, optional = true } serde_derive = { workspace = true, optional = true } solana-atomic-u64 = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-sanitize = { workspace = true } [dev-dependencies] @@ -31,16 +35,12 @@ solana-hash = { path = ".", features = ["dev-context-only-utils"] } js-sys = { workspace = true } wasm-bindgen = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] borsh = ["dep:borsh", "std"] bytemuck = ["dep:bytemuck", "dep:bytemuck_derive"] default = ["std"] dev-context-only-utils = ["bs58/alloc"] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "std" diff --git a/sdk/hash/build.rs b/sdk/hash/build.rs deleted file mode 120000 index 84539eddaa6ded..00000000000000 --- a/sdk/hash/build.rs +++ /dev/null @@ -1 +0,0 @@ -../../frozen-abi/build.rs \ No newline at end of file diff --git a/sdk/hash/src/lib.rs b/sdk/hash/src/lib.rs index dfc2e3efce8cf3..c5cad6f58a5861 100644 --- a/sdk/hash/src/lib.rs +++ b/sdk/hash/src/lib.rs @@ -1,5 +1,5 @@ #![no_std] -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #[cfg(feature = "borsh")] use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; #[cfg(any(feature = "std", target_arch = "wasm32"))] diff --git a/sdk/instruction/Cargo.toml b/sdk/instruction/Cargo.toml index 4fd6a8d3c7947f..0f96abda001702 100644 --- a/sdk/instruction/Cargo.toml +++ b/sdk/instruction/Cargo.toml @@ -30,15 +30,11 @@ wasm-bindgen = { workspace = true } [dev-dependencies] solana-instruction = { path = ".", features = ["borsh"] } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] bincode = ["dep:bincode", "dep:serde"] borsh = ["dep:borsh"] default = ["std"] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "serde", diff --git a/sdk/instruction/build.rs b/sdk/instruction/build.rs deleted file mode 120000 index 84539eddaa6ded..00000000000000 --- a/sdk/instruction/build.rs +++ /dev/null @@ -1 +0,0 @@ -../../frozen-abi/build.rs \ No newline at end of file diff --git a/sdk/instruction/src/lib.rs b/sdk/instruction/src/lib.rs index 1b3aa31855ad98..8627a204bb41d8 100644 --- a/sdk/instruction/src/lib.rs +++ b/sdk/instruction/src/lib.rs @@ -10,7 +10,7 @@ //! while executing a given instruction is also included in `Instruction`, as //! [`AccountMeta`] values. The runtime uses this information to efficiently //! schedule execution of transactions. -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] #![no_std] diff --git a/sdk/program/Cargo.toml b/sdk/program/Cargo.toml index 0d4d0afae6a1fd..51a8367dfa83f0 100644 --- a/sdk/program/Cargo.toml +++ b/sdk/program/Cargo.toml @@ -102,9 +102,6 @@ solana-pubkey = { workspace = true, features = ["dev-context-only-utils"] } static_assertions = { workspace = true } test-case = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] @@ -123,7 +120,6 @@ borsh = [ ] dev-context-only-utils = ["dep:qualifier_attr"] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-hash/frozen-abi", diff --git a/sdk/program/build.rs b/sdk/program/build.rs deleted file mode 120000 index 84539eddaa6ded..00000000000000 --- a/sdk/program/build.rs +++ /dev/null @@ -1 +0,0 @@ -../../frozen-abi/build.rs \ No newline at end of file diff --git a/sdk/program/src/lib.rs b/sdk/program/src/lib.rs index 7fb630240861de..8488c00daf937f 100644 --- a/sdk/program/src/lib.rs +++ b/sdk/program/src/lib.rs @@ -464,7 +464,7 @@ //! [lut]: https://docs.solanalabs.com/proposals/versioned-transactions #![allow(incomplete_features)] -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(specialization))] +#![cfg_attr(feature = "frozen-abi", feature(specialization))] // Allows macro expansion of `use ::solana_program::*` to work within this crate extern crate self as solana_program; diff --git a/sdk/pubkey/Cargo.toml b/sdk/pubkey/Cargo.toml index b7c9434e7e9ca9..64260e6f085191 100644 --- a/sdk/pubkey/Cargo.toml +++ b/sdk/pubkey/Cargo.toml @@ -21,8 +21,12 @@ serde = { workspace = true, optional = true } serde_derive = { workspace = true, optional = true } solana-atomic-u64 = { workspace = true } solana-decode-error = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-sanitize = { workspace = true } [target.'cfg(target_os = "solana")'.dependencies] @@ -55,9 +59,6 @@ solana-pubkey = { path = ".", features = [ strum = { workspace = true } strum_macros = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] borsh = ["dep:borsh", "dep:borsh0-10", "std"] bytemuck = ["dep:bytemuck", "dep:bytemuck_derive"] @@ -65,7 +66,6 @@ curve25519 = ["dep:curve25519-dalek", "sha2"] default = ["std"] dev-context-only-utils = ["dep:arbitrary", "std"] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro" ] diff --git a/sdk/pubkey/build.rs b/sdk/pubkey/build.rs deleted file mode 120000 index 84539eddaa6ded..00000000000000 --- a/sdk/pubkey/build.rs +++ /dev/null @@ -1 +0,0 @@ -../../frozen-abi/build.rs \ No newline at end of file diff --git a/sdk/pubkey/src/lib.rs b/sdk/pubkey/src/lib.rs index 82a9753df8f6da..c29e3654c396e7 100644 --- a/sdk/pubkey/src/lib.rs +++ b/sdk/pubkey/src/lib.rs @@ -1,6 +1,6 @@ //! Solana account addresses. #![no_std] -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] #[cfg(any(feature = "std", target_arch = "wasm32"))] diff --git a/sdk/signature/Cargo.toml b/sdk/signature/Cargo.toml index e6ac2a0af65554..989200b9281b61 100644 --- a/sdk/signature/Cargo.toml +++ b/sdk/signature/Cargo.toml @@ -16,8 +16,12 @@ generic-array = { workspace = true, features = ["more_lengths"] } rand = { workspace = true, optional = true } serde = { workspace = true, optional = true } serde_derive = { workspace = true, optional = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-sanitize = { workspace = true } [dev-dependencies] @@ -25,13 +29,9 @@ curve25519-dalek = { workspace = true } ed25519-dalek = { workspace = true } solana-program = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] default = ["std"] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "std" diff --git a/sdk/signature/build.rs b/sdk/signature/build.rs deleted file mode 120000 index 84539eddaa6ded..00000000000000 --- a/sdk/signature/build.rs +++ /dev/null @@ -1 +0,0 @@ -../../frozen-abi/build.rs \ No newline at end of file diff --git a/sdk/signature/src/lib.rs b/sdk/signature/src/lib.rs index 8d2434c2d3fa14..1521391824a8da 100644 --- a/sdk/signature/src/lib.rs +++ b/sdk/signature/src/lib.rs @@ -1,6 +1,6 @@ //! 64-byte signature type. #![no_std] -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #[cfg(any(test, feature = "verify"))] use core::convert::TryInto; #[cfg(feature = "serde")] diff --git a/sdk/src/fee.rs b/sdk/src/fee.rs index 24e61e1d14848f..22d04812fa0d76 100644 --- a/sdk/src/fee.rs +++ b/sdk/src/fee.rs @@ -215,7 +215,7 @@ impl Default for FeeStructure { } } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl ::solana_frozen_abi::abi_example::AbiExample for FeeStructure { fn example() -> Self { FeeStructure::default() diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index 47f680603c65c3..07c92473cbb46a 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -30,7 +30,7 @@ //! [`clap`]: https://docs.rs/clap #![allow(incomplete_features)] -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(specialization))] +#![cfg_attr(feature = "frozen-abi", feature(specialization))] // Allows macro expansion of `use ::solana_sdk::*` to work within this crate extern crate self as solana_sdk; diff --git a/sdk/src/packet.rs b/sdk/src/packet.rs index 8d3ef8b3e539cf..1aa93308820d47 100644 --- a/sdk/src/packet.rs +++ b/sdk/src/packet.rs @@ -50,17 +50,17 @@ pub struct Meta { pub flags: PacketFlags, } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl ::solana_frozen_abi::abi_example::AbiExample for PacketFlags { fn example() -> Self { Self::empty() } } -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl ::solana_frozen_abi::abi_example::TransparentAsHelper for PacketFlags {} -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl ::solana_frozen_abi::abi_example::EvenAsOpaque for PacketFlags { const TYPE_NAME_MATCHER: &'static str = "::_::InternalBitFlags"; } diff --git a/sdk/src/reserved_account_keys.rs b/sdk/src/reserved_account_keys.rs index 0ce4ac632bb250..49cde7fd9bcd79 100644 --- a/sdk/src/reserved_account_keys.rs +++ b/sdk/src/reserved_account_keys.rs @@ -27,7 +27,7 @@ mod zk_elgamal_proof_program { // ReservedAccountKeys is not serialized into or deserialized from bank // snapshots but the bank requires this trait to be implemented anyways. -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl ::solana_frozen_abi::abi_example::AbiExample for ReservedAccountKeys { fn example() -> Self { // ReservedAccountKeys is not Serialize so just rely on Default. diff --git a/short-vec/Cargo.toml b/short-vec/Cargo.toml index 2ab13eaad53a34..3d1a772f50ae7b 100644 --- a/short-vec/Cargo.toml +++ b/short-vec/Cargo.toml @@ -9,13 +9,14 @@ homepage = { workspace = true } license = { workspace = true } edition = { workspace = true } -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [dependencies] serde = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } [dev-dependencies] assert_matches = { workspace = true } @@ -23,7 +24,7 @@ bincode = { workspace = true } serde_json = { workspace = true } [features] -frozen-abi = ["dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro"] +frozen-abi = ["dep:solana-frozen-abi", "dep:solana-frozen-abi-macro"] [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/short-vec/build.rs b/short-vec/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/short-vec/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/short-vec/src/lib.rs b/short-vec/src/lib.rs index f1f9f554e28882..138d3d79dd4ba2 100644 --- a/short-vec/src/lib.rs +++ b/short-vec/src/lib.rs @@ -1,5 +1,5 @@ //! Compact serde-encoding of vectors with small length. -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] #[cfg(feature = "frozen-abi")] use solana_frozen_abi_macro::AbiExample; diff --git a/svm/Cargo.toml b/svm/Cargo.toml index 2b2a44646e7604..be94989d892121 100644 --- a/svm/Cargo.toml +++ b/svm/Cargo.toml @@ -20,8 +20,12 @@ solana-bpf-loader-program = { workspace = true } solana-compute-budget = { workspace = true } solana-feature-set = { workspace = true } solana-fee = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-loader-v4-program = { workspace = true } solana-log-collector = { workspace = true } solana-measure = { workspace = true } @@ -60,13 +64,9 @@ test-case = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] dev-context-only-utils = ["dep:qualifier_attr"] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-compute-budget/frozen-abi", diff --git a/svm/build.rs b/svm/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/svm/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/svm/src/lib.rs b/svm/src/lib.rs index f3cbbaa0f9cb18..7a42e3ce4b10f8 100644 --- a/svm/src/lib.rs +++ b/svm/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] pub mod account_loader; diff --git a/svm/src/message_processor.rs b/svm/src/message_processor.rs index 7b9d248e5b981f..589e1d1362a6bf 100644 --- a/svm/src/message_processor.rs +++ b/svm/src/message_processor.rs @@ -16,7 +16,7 @@ use { #[derive(Debug, Default, Clone, serde_derive::Deserialize, serde_derive::Serialize)] pub struct MessageProcessor {} -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl ::solana_frozen_abi::abi_example::AbiExample for MessageProcessor { fn example() -> Self { // MessageProcessor's fields are #[serde(skip)]-ed and not Serialize diff --git a/svm/src/runtime_config.rs b/svm/src/runtime_config.rs index 7e063bc30e5b5d..e7ee19a1115873 100644 --- a/svm/src/runtime_config.rs +++ b/svm/src/runtime_config.rs @@ -1,6 +1,6 @@ use solana_compute_budget::compute_budget::ComputeBudget; -#[cfg(all(RUSTC_WITH_SPECIALIZATION, feature = "frozen-abi"))] +#[cfg(feature = "frozen-abi")] impl ::solana_frozen_abi::abi_example::AbiExample for RuntimeConfig { fn example() -> Self { // RuntimeConfig is not Serialize so just rely on Default. diff --git a/version/Cargo.toml b/version/Cargo.toml index 8fd935b5ae9b25..3372a5cabbbcba 100644 --- a/version/Cargo.toml +++ b/version/Cargo.toml @@ -15,8 +15,12 @@ semver = { workspace = true } serde = { workspace = true } serde_derive = { workspace = true } solana-feature-set = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-sanitize = { workspace = true } solana-sdk = { workspace = true } solana-serde-varint = { workspace = true } @@ -24,7 +28,6 @@ solana-serde-varint = { workspace = true } [features] dummy-for-ci-check = [] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-sdk/frozen-abi", @@ -36,8 +39,5 @@ name = "solana_version" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [lints] workspace = true diff --git a/version/build.rs b/version/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/version/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/version/src/lib.rs b/version/src/lib.rs index 2a09817ccfbcd6..64e25775fbcba9 100644 --- a/version/src/lib.rs +++ b/version/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] extern crate serde_derive; pub use self::legacy::{LegacyVersion1, LegacyVersion2}; diff --git a/vote/Cargo.toml b/vote/Cargo.toml index 89f3b5e433f49f..ae27fd04c781fb 100644 --- a/vote/Cargo.toml +++ b/vote/Cargo.toml @@ -15,8 +15,12 @@ log = { workspace = true } rand = { workspace = true, optional = true } serde = { workspace = true, features = ["rc"] } serde_derive = { workspace = true } -solana-frozen-abi = { workspace = true, optional = true } -solana-frozen-abi-macro = { workspace = true, optional = true } +solana-frozen-abi = { workspace = true, optional = true, features = [ + "frozen-abi", +] } +solana-frozen-abi-macro = { workspace = true, optional = true, features = [ + "frozen-abi", +] } solana-sdk = { workspace = true } thiserror = { workspace = true } @@ -31,13 +35,9 @@ rand = { workspace = true } [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[build-dependencies] -rustc_version = { workspace = true, optional = true } - [features] dev-context-only-utils = ["dep:rand"] frozen-abi = [ - "dep:rustc_version", "dep:solana-frozen-abi", "dep:solana-frozen-abi-macro", "solana-sdk/frozen-abi", diff --git a/vote/build.rs b/vote/build.rs deleted file mode 120000 index ae66c237c5f4fd..00000000000000 --- a/vote/build.rs +++ /dev/null @@ -1 +0,0 @@ -../frozen-abi/build.rs \ No newline at end of file diff --git a/vote/src/lib.rs b/vote/src/lib.rs index 5f2fa1a6d5be92..53d8fdc37e06a7 100644 --- a/vote/src/lib.rs +++ b/vote/src/lib.rs @@ -1,4 +1,4 @@ -#![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))] +#![cfg_attr(feature = "frozen-abi", feature(min_specialization))] #![allow(clippy::arithmetic_side_effects)] pub mod vote_account;