Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated Polkadot SDK Templates Emit Errors #5226

Closed
shawntabrizi opened this issue Aug 3, 2024 · 4 comments
Closed

Generated Polkadot SDK Templates Emit Errors #5226

shawntabrizi opened this issue Aug 3, 2024 · 4 comments

Comments

@shawntabrizi
Copy link
Member

When compiling the minimal-template, the following errors appear:

➜  minimal-template git:(master) cargo build --release
warning: unexpected `cfg` condition value: `try-runtime`
  --> pallets/template/src/lib.rs:20:12
   |
20 |     #[pallet::pallet]
   |               ^^^^^^
   |
   = note: expected values for `feature` are: `default` and `std`
   = help: consider adding `try-runtime` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default

warning: `pallet-minimal-template` (lib) generated 1 warning
warning: unexpected `cfg` condition value: `runtime-benchmarks`
  --> node/src/service.rs:30:7
   |
30 | #[cfg(feature = "runtime-benchmarks")]
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`
   = help: consider adding `runtime-benchmarks` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition value: `runtime-benchmarks`
  --> node/src/service.rs:34:11
   |
34 | #[cfg(not(feature = "runtime-benchmarks"))]
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`
   = help: consider adding `runtime-benchmarks` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: `minimal-template-node` (lib) generated 2 warnings
warning: unexpected `cfg` condition value: `try-runtime`
  --> node/src/command.rs:26:7
   |
26 | #[cfg(feature = "try-runtime")]
   |       ^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`
   = help: consider adding `try-runtime` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition value: `runtime-benchmarks`
  --> node/src/service.rs:30:7
   |
30 | #[cfg(feature = "runtime-benchmarks")]
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `feature` are: `default`
   = help: consider adding `runtime-benchmarks` as a feature in `Cargo.toml`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration

warning: `minimal-template-node` (bin "minimal-template-node") generated 3 warnings (1 duplicate)

This is because the templates lack the runtime-benchmarks or try_runtime features, but these features are being referenced within the service.rs file and command.rs file included in the template.

We need to either change the service file to exclude these feature gated parts of the code, or (probably better) include these features into the generated templates.

@shawntabrizi
Copy link
Member Author

cc @rzadp @kianenigma @mordamax

@rzadp
Copy link
Contributor

rzadp commented Aug 5, 2024

As a quick measure (to get rid of compilation errors) I proposed to remove the unused code.

And looks like the error from #[pallet::pallet] will be solved by #5099

@kianenigma Do you think we should eventually add some benchmarking or try-runtiming functionality to the minimal template, or not in order to keep it minimal?

github-merge-queue bot pushed a commit that referenced this issue Aug 5, 2024
- Progresses #5226

There is no actual `try-runtime` or `runtime-benchmarks` functionality
in the minimal template at the moment.
@shawntabrizi
Copy link
Member Author

@rzadp my take on your question is that we should aim to keep the minimal template minimal, and then using this as a starting point, see how we can simplify the process to add benchmarks and try-runtime to a minimal template.

Perhaps this would require more macro magic, or some tooling.

Maybe we cannot succeed, and we have to put them in the template, but I think that should not be the first choice.

@shawntabrizi
Copy link
Member Author

closing this issue because it is resolved with #5237

dharjeezy pushed a commit to dharjeezy/polkadot-sdk that referenced this issue Aug 28, 2024
…h#5237)

- Progresses paritytech#5226

There is no actual `try-runtime` or `runtime-benchmarks` functionality
in the minimal template at the moment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants