Skip to content

Commit

Permalink
Remove default feature from Cargo.toml
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
tetsuharuohzeki committed Sep 27, 2022
1 parent 03764f2 commit 3bc41e0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -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,
}
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 :=
Expand Down
7 changes: 0 additions & 7 deletions crates/main/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3bc41e0

Please sign in to comment.