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

Support for Crate-Specific Features via Umbrella Dependency #5934

Open
2 tasks done
SailorSnoW opened this issue Oct 4, 2024 · 6 comments
Open
2 tasks done

Support for Crate-Specific Features via Umbrella Dependency #5934

SailorSnoW opened this issue Oct 4, 2024 · 6 comments
Labels
I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework.

Comments

@SailorSnoW
Copy link
Contributor

Is there an existing issue?

  • I have searched the existing issues

Experiencing problems? Have you tried our Stack Exchange first?

  • This is not a support question.

Motivation

While managing our dependencies through the Umbrella, we quickly encountered an issue where it seems we are unable to use internal features of the Umbrella's crates. (For instance, insecure_zero_edfrom pallet-balances, historical from pallet-session, etc.)

Request

Enable the use of specific crate features through the Umbrella.

Solution

Have any design choices been considered for this case?
For example, we could import these features via the Umbrella by combining the crate name with the feature name, like so:

pallet-balances-insecure-zero-ed = [
    "pallet-balances?/insecure_zero_ed"
]

Are you willing to help with this request?

Maybe (please elaborate above)

@SailorSnoW SailorSnoW added the I5-enhancement An additional feature request. label Oct 4, 2024
@ggwpez
Copy link
Member

ggwpez commented Oct 4, 2024

Maybe as workaround you can try to enable the feature on the crate directly, since rust feature unification should then merge those. Just make sure to use resolver = 2 in your workspace.

pallet-balances = { version = "*", features = ["insecure_zero_ed"], default-features = false }

Not sure if the * will make cargo pick the same version as the umbrella, or if you have to specify it manually...

For more long term solution guess we could do the concatenation with the features? But it can also turn quite ugly. WDYT @kianenigma ?

@SailorSnoW
Copy link
Contributor Author

Well, maybe we could simply do the same as the experimental feature and use only the feature name which will enable all crates having this feature name

experimental = [
"frame-support-procedural?/experimental",
"frame-support?/experimental",
"frame-system?/experimental",
"polkadot-sdk-frame?/experimental",
]

@ggwpez
Copy link
Member

ggwpez commented Oct 7, 2024

Depends on what features exactly. I assume that some of them would clash names, but for the big ones it should work.
What features do you need? insecure_zero_ed i guess, what else?
They can be added here and then in the zepter config:

"tuples-96": [],

@kianenigma kianenigma added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Nov 5, 2024
@kianenigma
Copy link
Contributor

hmm this seems like an issue indeed.

Combining names seems like a time bomb, I would not try this.

For the ones that we have, we should indeed treat them like experimental and just expose them at the top level umbrella. It seems to be the best we can do atm.

Long term, I hope we can reduce the number of custom feature flag we have. They are not meant to be a gate for "experimental" stuff. So the feature "insecure_zero_ed" would overall go away.

@SailorSnoW
Copy link
Contributor Author

SailorSnoW commented Nov 15, 2024

Here is some features that seems important to us to use Umbrella for our runtimes which is currently missing:

  • historical from pallet-session
  • metadata-hash from substrate-wasm-builder

@kianenigma kianenigma assigned ggwpez and unassigned ggwpez Nov 15, 2024
@kianenigma
Copy link
Contributor

@ggwpez can you see through with this please? It can probably be documented and contributed by someone else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I5-enhancement An additional feature request. T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

No branches or pull requests

3 participants