From 149c70938f2b29f8d92ba1cc952aeb63d4084e27 Mon Sep 17 00:00:00 2001
From: Przemek Rzad <przemek@parity.io>
Date: Fri, 9 Aug 2024 18:11:50 +0200
Subject: [PATCH] Add missing features in templates' node packages (#5294)

Corrects the issue we had
[here](https://github.com/paritytech/polkadot-sdk-parachain-template/pull/10),
in which `cargo build --release` worked but `cargo build --package
parachain-template-node --release` failed with missing features.

The command has been added to CI to make sure it works, but at the same
we're changing it in the readme to just `cargo build --release` for
simplification.

Labeling silent because those packages are un-published as part of the
regular release process.

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
---
 templates/minimal/README.md         | 2 +-
 templates/minimal/node/Cargo.toml   | 5 ++++-
 templates/parachain/README.md       | 2 +-
 templates/parachain/node/Cargo.toml | 7 ++++++-
 templates/solochain/README.md       | 2 +-
 templates/solochain/node/Cargo.toml | 5 ++++-
 6 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/templates/minimal/README.md b/templates/minimal/README.md
index b556a453608..180c229e744 100644
--- a/templates/minimal/README.md
+++ b/templates/minimal/README.md
@@ -42,7 +42,7 @@ packages required to compile this template - please take note of the Rust compil
 🔨 Use the following command to build the node without launching it:
 
 ```sh
-cargo build --package minimal-template-node --release
+cargo build --release
 ```
 
 🐳 Alternatively, build the docker image:
diff --git a/templates/minimal/node/Cargo.toml b/templates/minimal/node/Cargo.toml
index 70b24c19f8e..da5073ea687 100644
--- a/templates/minimal/node/Cargo.toml
+++ b/templates/minimal/node/Cargo.toml
@@ -57,4 +57,7 @@ minimal-template-runtime = { workspace = true }
 substrate-build-script-utils = { workspace = true, default-features = true }
 
 [features]
-default = []
+default = ["std"]
+std = [
+	"minimal-template-runtime/std",
+]
diff --git a/templates/parachain/README.md b/templates/parachain/README.md
index 802d8586b39..b7fa2bed0ed 100644
--- a/templates/parachain/README.md
+++ b/templates/parachain/README.md
@@ -44,7 +44,7 @@ packages required to compile this template - please take note of the Rust compil
 🔨 Use the following command to build the node without launching it:
 
 ```sh
-cargo build --package parachain-template-node --release
+cargo build --release
 ```
 
 🐳 Alternatively, build the docker image:
diff --git a/templates/parachain/node/Cargo.toml b/templates/parachain/node/Cargo.toml
index 7cf1f1fddc7..c782888a3e8 100644
--- a/templates/parachain/node/Cargo.toml
+++ b/templates/parachain/node/Cargo.toml
@@ -79,7 +79,12 @@ color-print = { workspace = true }
 substrate-build-script-utils = { workspace = true, default-features = true }
 
 [features]
-default = []
+default = ["std"]
+std = [
+	"log/std",
+	"parachain-template-runtime/std",
+	"xcm/std",
+]
 runtime-benchmarks = [
 	"cumulus-primitives-core/runtime-benchmarks",
 	"frame-benchmarking-cli/runtime-benchmarks",
diff --git a/templates/solochain/README.md b/templates/solochain/README.md
index c5dc5db7f3b..6a5a7853f9c 100644
--- a/templates/solochain/README.md
+++ b/templates/solochain/README.md
@@ -28,7 +28,7 @@ installation](#alternatives-installations) options.
 Use the following command to build the node without launching it:
 
 ```sh
-cargo build --package solochain-template-node --release
+cargo build --release
 ```
 
 ### Embedded Docs
diff --git a/templates/solochain/node/Cargo.toml b/templates/solochain/node/Cargo.toml
index 6eebf3694e3..9dd1b144d22 100644
--- a/templates/solochain/node/Cargo.toml
+++ b/templates/solochain/node/Cargo.toml
@@ -66,7 +66,10 @@ solochain-template-runtime = { workspace = true }
 substrate-build-script-utils = { workspace = true, default-features = true }
 
 [features]
-default = []
+default = ["std"]
+std = [
+	"solochain-template-runtime/std",
+]
 # Dependencies that are only required if runtime benchmarking should be build.
 runtime-benchmarks = [
 	"frame-benchmarking-cli/runtime-benchmarks",
-- 
GitLab