From abfdc4e88f2343c29ca47604756f1a6b8b3083ac Mon Sep 17 00:00:00 2001 From: acheron <98934430+acheroncrypto@users.noreply.github.com> Date: Sat, 5 Aug 2023 23:47:06 +0200 Subject: [PATCH] chore: Remove duplicate dependency and and alphabetize features (#2590) --- avm/Cargo.toml | 4 ++-- cli/Cargo.toml | 1 - client/Cargo.toml | 4 ++-- client/example/Cargo.toml | 4 ++-- lang/Cargo.toml | 31 ++++++++++++++---------------- lang/attribute/account/Cargo.toml | 2 +- lang/attribute/constant/Cargo.toml | 2 +- lang/attribute/error/Cargo.toml | 2 +- lang/attribute/event/Cargo.toml | 2 +- lang/attribute/program/Cargo.toml | 2 +- lang/derive/accounts/Cargo.toml | 7 +++---- lang/derive/serde/Cargo.toml | 4 +--- lang/derive/space/Cargo.toml | 2 +- lang/syn/Cargo.toml | 1 - spl/Cargo.toml | 14 +++++++------- 15 files changed, 37 insertions(+), 45 deletions(-) diff --git a/avm/Cargo.toml b/avm/Cargo.toml index 2f4d22676a..e8dbcf9103 100644 --- a/avm/Cargo.toml +++ b/avm/Cargo.toml @@ -15,9 +15,9 @@ path = "src/anchor/main.rs" [dependencies] anyhow = "1.0.32" cfg-if = "1.0.0" -clap = { version = "4.2.4", features = ["derive"]} +clap = { version = "4.2.4", features = ["derive"] } dirs = "4.0.0" -once_cell = { version = "1.8.0" } +once_cell = "1.8.0" reqwest = { version = "0.11.9", default-features = false, features = ["blocking", "json", "rustls-tls"] } semver = "1.0.4" serde = { version = "1.0.136", features = ["derive"] } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1c82253852..b265f72eae 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -14,7 +14,6 @@ path = "src/bin/main.rs" [features] dev = [] -default = [] [dependencies] anchor-client = { path = "../client", version = "0.28.0" } diff --git a/client/Cargo.toml b/client/Cargo.toml index 1abfc9de59..0f0e51aae5 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -8,13 +8,13 @@ license = "Apache-2.0" description = "Rust client for Anchor programs" [features] -debug = [] async = [] +debug = [] [dependencies] anchor-lang = { path = "../lang", version = "0.28.0" } anyhow = "1" -futures = { version = "0.3" } +futures = "0.3" regex = "1" serde = { version = "1", features = ["derive"] } solana-client = ">=1.14, <1.17" diff --git a/client/example/Cargo.toml b/client/example/Cargo.toml index f18138d3fe..c3d71eb33f 100644 --- a/client/example/Cargo.toml +++ b/client/example/Cargo.toml @@ -17,8 +17,8 @@ basic-4 = { path = "../../examples/tutorial/basic-4/programs/basic-4", features composite = { path = "../../tests/composite/programs/composite", features = ["no-entrypoint"] } optional = { path = "../../tests/optional/programs/optional", features = ["no-entrypoint"] } events = { path = "../../tests/events/programs/events", features = ["no-entrypoint"] } -shellexpand = "2.1.0" anyhow = "1.0.32" clap = { version = "4.2.4", features = ["derive"] } -tokio = { version = "1", features = ["full"] } +shellexpand = "2.1.0" solana-sdk = ">=1.14, <1.17" +tokio = { version = "1", features = ["full"] } diff --git a/lang/Cargo.toml b/lang/Cargo.toml index 3b6030c2c0..e2915f1f27 100644 --- a/lang/Cargo.toml +++ b/lang/Cargo.toml @@ -10,20 +10,6 @@ description = "Solana Sealevel eDSL" [features] allow-missing-optionals = ["anchor-derive-accounts/allow-missing-optionals"] -init-if-needed = ["anchor-derive-accounts/init-if-needed"] -derive = [] -default = [] -event-cpi = ["anchor-attribute-event/event-cpi"] -idl-build = [ - "anchor-syn/idl-build", - "anchor-derive-accounts/idl-build", - "anchor-derive-serde/idl-build", - "anchor-attribute-account/idl-build", - "anchor-attribute-constant/idl-build", - "anchor-attribute-event/idl-build", - "anchor-attribute-error/idl-build", - "anchor-attribute-program/idl-build", -] anchor-debug = [ "anchor-attribute-access-control/anchor-debug", "anchor-attribute-account/anchor-debug", @@ -31,9 +17,21 @@ anchor-debug = [ "anchor-attribute-error/anchor-debug", "anchor-attribute-event/anchor-debug", "anchor-attribute-program/anchor-debug", - "anchor-attribute-program/anchor-debug", "anchor-derive-accounts/anchor-debug" ] +derive = [] +event-cpi = ["anchor-attribute-event/event-cpi"] +idl-build = [ + "anchor-attribute-account/idl-build", + "anchor-attribute-constant/idl-build", + "anchor-attribute-event/idl-build", + "anchor-attribute-error/idl-build", + "anchor-attribute-program/idl-build", + "anchor-derive-accounts/idl-build", + "anchor-derive-serde/idl-build", + "anchor-syn/idl-build", +] +init-if-needed = ["anchor-derive-accounts/init-if-needed"] [dependencies] anchor-attribute-access-control = { path = "./attribute/access-control", version = "0.28.0" } @@ -45,8 +43,7 @@ anchor-attribute-program = { path = "./attribute/program", version = "0.28.0" } anchor-derive-accounts = { path = "./derive/accounts", version = "0.28.0" } anchor-derive-serde = { path = "./derive/serde", version = "0.28.0" } anchor-derive-space = { path = "./derive/space", version = "0.28.0" } -# anchor-syn can and should only be included only for idl-build. It won't compile -# for bpf due to proc-macro2 crate. +# `anchor-syn` should only be included with `idl-build` feature anchor-syn = { path = "./syn", version = "0.28.0", optional = true } arrayref = "0.3" base64 = "0.13" diff --git a/lang/attribute/account/Cargo.toml b/lang/attribute/account/Cargo.toml index 92eeda4bdc..f9c714cd29 100644 --- a/lang/attribute/account/Cargo.toml +++ b/lang/attribute/account/Cargo.toml @@ -12,8 +12,8 @@ edition = "2021" proc-macro = true [features] -idl-build = ["anchor-syn/idl-build"] anchor-debug = ["anchor-syn/anchor-debug"] +idl-build = ["anchor-syn/idl-build"] [dependencies] anchor-syn = { path = "../../syn", version = "0.28.0", features = ["hash"] } diff --git a/lang/attribute/constant/Cargo.toml b/lang/attribute/constant/Cargo.toml index fdfb63eec3..1026560da7 100644 --- a/lang/attribute/constant/Cargo.toml +++ b/lang/attribute/constant/Cargo.toml @@ -12,8 +12,8 @@ edition = "2021" proc-macro = true [features] -idl-build = ["anchor-syn/idl-build"] anchor-debug = ["anchor-syn/anchor-debug"] +idl-build = ["anchor-syn/idl-build"] [dependencies] anchor-syn = { path = "../../syn", version = "0.28.0" } diff --git a/lang/attribute/error/Cargo.toml b/lang/attribute/error/Cargo.toml index 276e3bdbe8..6052f2a561 100644 --- a/lang/attribute/error/Cargo.toml +++ b/lang/attribute/error/Cargo.toml @@ -12,8 +12,8 @@ edition = "2021" proc-macro = true [features] -idl-build = ["anchor-syn/idl-build"] anchor-debug = ["anchor-syn/anchor-debug"] +idl-build = ["anchor-syn/idl-build"] [dependencies] anchor-syn = { path = "../../syn", version = "0.28.0" } diff --git a/lang/attribute/event/Cargo.toml b/lang/attribute/event/Cargo.toml index 9c1d810709..9f5aeebcf1 100644 --- a/lang/attribute/event/Cargo.toml +++ b/lang/attribute/event/Cargo.toml @@ -12,9 +12,9 @@ edition = "2021" proc-macro = true [features] -idl-build = ["anchor-syn/idl-build"] anchor-debug = ["anchor-syn/anchor-debug"] event-cpi = ["anchor-syn/event-cpi"] +idl-build = ["anchor-syn/idl-build"] [dependencies] anchor-syn = { path = "../../syn", version = "0.28.0", features = ["hash"] } diff --git a/lang/attribute/program/Cargo.toml b/lang/attribute/program/Cargo.toml index 370c235b7c..ad72db1f8f 100644 --- a/lang/attribute/program/Cargo.toml +++ b/lang/attribute/program/Cargo.toml @@ -12,8 +12,8 @@ edition = "2021" proc-macro = true [features] -idl-build = ["anchor-syn/idl-build"] anchor-debug = ["anchor-syn/anchor-debug"] +idl-build = ["anchor-syn/idl-build"] [dependencies] anchor-syn = { path = "../../syn", version = "0.28.0" } diff --git a/lang/derive/accounts/Cargo.toml b/lang/derive/accounts/Cargo.toml index 5ad7a08603..4f02f59555 100644 --- a/lang/derive/accounts/Cargo.toml +++ b/lang/derive/accounts/Cargo.toml @@ -13,12 +13,11 @@ proc-macro = true [features] allow-missing-optionals = ["anchor-syn/allow-missing-optionals"] -init-if-needed = ["anchor-syn/init-if-needed"] -default = [] -idl-build = ["anchor-syn/idl-build"] anchor-debug = ["anchor-syn/anchor-debug"] +idl-build = ["anchor-syn/idl-build"] +init-if-needed = ["anchor-syn/init-if-needed"] [dependencies] +anchor-syn = { path = "../../syn", version = "0.28.0" } quote = "1" syn = { version = "1", features = ["full"] } -anchor-syn = { path = "../../syn", version = "0.28.0" } diff --git a/lang/derive/serde/Cargo.toml b/lang/derive/serde/Cargo.toml index 5f00f042f9..6073246f5e 100644 --- a/lang/derive/serde/Cargo.toml +++ b/lang/derive/serde/Cargo.toml @@ -12,9 +12,7 @@ edition = "2021" proc-macro = true [features] -idl-build = [ - "anchor-syn/idl-build", -] +idl-build = ["anchor-syn/idl-build"] [dependencies] anchor-syn = { path = "../../syn", version = "0.28.0" } diff --git a/lang/derive/space/Cargo.toml b/lang/derive/space/Cargo.toml index f5cbb5d1b7..dfee809e6b 100644 --- a/lang/derive/space/Cargo.toml +++ b/lang/derive/space/Cargo.toml @@ -14,4 +14,4 @@ proc-macro = true [dependencies] proc-macro2 = "1" quote = "1" -syn = { version = "1", features = ["extra-traits"]} +syn = { version = "1", features = ["extra-traits"] } diff --git a/lang/syn/Cargo.toml b/lang/syn/Cargo.toml index 6fe638c4c3..0fafc72457 100644 --- a/lang/syn/Cargo.toml +++ b/lang/syn/Cargo.toml @@ -9,7 +9,6 @@ rust-version = "1.60" edition = "2021" [features] -default = [] allow-missing-optionals = [] anchor-debug = [] event-cpi = [] diff --git a/spl/Cargo.toml b/spl/Cargo.toml index 10d82843ed..a52b45227a 100644 --- a/spl/Cargo.toml +++ b/spl/Cargo.toml @@ -8,17 +8,17 @@ license = "Apache-2.0" description = "CPI clients for SPL programs" [features] -default = ["mint", "token", "token_2022", "associated_token"] -mint = [] -token = ["spl-token"] -token_2022 = ["spl-token-2022"] +default = ["associated_token", "mint", "token", "token_2022"] associated_token = ["spl-associated-token-account"] +dex = ["serum_dex"] +devnet = [] governance = [] +metadata = ["mpl-token-metadata"] +mint = [] shmem = [] stake = ["borsh"] -devnet = [] -metadata = ["mpl-token-metadata"] -dex = ["serum_dex"] +token = ["spl-token"] +token_2022 = ["spl-token-2022"] [dependencies] anchor-lang = { path = "../lang", version = "0.28.0", features = ["derive"] }