Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

fix feature flag for frame-system-benchmarking#14617

Open
xlc wants to merge 1 commit intoparitytech:masterfrom
xlc:fix-features
Open

fix feature flag for frame-system-benchmarking#14617
xlc wants to merge 1 commit intoparitytech:masterfrom
xlc:fix-features

Conversation

@xlc
Copy link
Contributor

@xlc xlc commented Jul 24, 2023

A required feature flag doesn't make sense.

@xlc xlc requested review from a team July 24, 2023 02:34
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system" }
frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../../benchmarking", features = ["runtime-benchmarks"] }
frame-support = { version = "4.0.0-dev", default-features = false, path = "../../support", features = ["runtime-benchmarks"] }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../../system", features = ["runtime-benchmarks"] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A required feature flag doesn't make sense.

Rust feature flags are additive, and this crate only does benchmarking. So without the flag the crate just does nothing (which is fine).

We cannot ever enable runtime-benchmarks or try-runtime by default. It causes all kinds of issues by being propagated downwards. There is a script in the CI to prevent this as well.

Copy link
Contributor Author

@xlc xlc Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't 100% get what you mean. Crates can be optional. You shouldn't include/enable this if it is not meant for runtime benchmarks. If any downstream crates are getting issues because of this, that means it shouldn't include this at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That means we are shifting the problem from not accidentally enabling the feature to not accidentally enabling this crate?
I think just never enabling runtime-benchmarks and try-runtime by default is a pretty simple rule, that does not need any exceptions. But yea, it should also be possible to optionally enable the dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include an empty crate doesn't make a lot of sense to me. Why do you ever want to do that?

I think just never enabling runtime-benchmarks and try-runtime by default is a pretty simple rule, that does not need any exceptions.

I don't agree with this. Pallets specifically built for runtime benchmarks (i.e. this one) can have runtime-benchmarks enabled by default.

On another note, I don't like implicit rules. If it is not sufficiently discussed, and documented, they don't exist to me.

@paritytech-ci paritytech-ci requested a review from a team July 24, 2023 10:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants