From 3bc41e0bd85b2a6cc88636939b3ff1c1f82a498c Mon Sep 17 00:00:00 2001 From: Tetsuharu Ohzeki Date: Tue, 27 Sep 2022 09:02:16 +0900 Subject: [PATCH] Remove `default` feature from Cargo.toml In the prev commit, we don't use default features in dependencies by default. But it's not clear for rust-analyzer or other toolchains which are not integrated to our build system. To make it simplify, this change removes all `default` feature set from Cargo.toml in this repository. This express that this project requires an additional way to enable toolchain supports which is not added to our build system. Drawbacks -------- 1. rust-analyzer does not support editor agnostic setting. A developer that do not use vscode would requires additional config. rust-lang/rust-analyzer#11010 2. This requires to commit `.vscode/settings.json`. --- .vscode/settings.json | 8 ++++++++ Makefile | 3 +++ crates/main/Cargo.toml | 7 ------- 3 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9aff0cb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "rust-analyzer.cargo.features": [ + // We want to be able to rollout this application to production at all + // Thus we use _production_ as our default build feature set. + "c_at_e_main/production" + ], + "rust-analyzer.cargo.noDefaultFeatures": true, +} diff --git a/Makefile b/Makefile index f32f5ba..d810c35 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,9 @@ FASTLY_TOML_ENV ?= "" ########################### # Release Channel Mechanism ########################### + +# We want to be able to rollout this application to production at all time. +# Thus we use _production_ as our default build feature set. RELEASE_CHANNEL ?= production RELEASE_CHANNEL_FEATURES := diff --git a/crates/main/Cargo.toml b/crates/main/Cargo.toml index 5260163..3b03c46 100644 --- a/crates/main/Cargo.toml +++ b/crates/main/Cargo.toml @@ -9,13 +9,6 @@ rust-version.workspace = true fastly = "^0.8.7" [features] -# Our build system requires to set _release channel_ explicitly by using `--no-default-features`. -# This default set is only used for toolchains that are not integrated our build systems (e.g. rust-analyzer). -default = [ - # We want to be able to rollout this application to production at all time. - # Thus we use _production_ as our default build feature set. - "production" -] # These feature flags represents _release channel_. # These are mutually exclusive. You cannot enable both of them.