Add conditional compilation support for impl_runtime_apis!#14709
Add conditional compilation support for impl_runtime_apis!#14709paritytech-processbot[bot] merged 24 commits intomasterfrom
impl_runtime_apis!#14709Conversation
| --features runtime-benchmarks,try-runtime,experimental | ||
| --manifest-path ./bin/node/cli/Cargo.toml | ||
| --partition count:${CI_NODE_INDEX}/${CI_NODE_TOTAL} | ||
| # run runtime-api tests with `enable-staging-api` feature |
There was a problem hiding this comment.
Is this a good idea?
There was a problem hiding this comment.
I would suggest not to do this for now, as runtime API versions often activate experimental features which may be buggy. It's acceptable for experimental features to be buggy in master, but it should not lead to test failures.
In the PR that stabilizes experimental APIs, we'd encounter the test failure in CI anyway.
There was a problem hiding this comment.
I haven't marked the correct line. It doesn't run all tests with enable-staging-api but only sp-api-test:
time cargo nextest run -p sp-api-test --features enable-staging-api
I've got some runtime api unit tests with feature flags, but they need to be invoked individually.
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Bastian Köcher <git@kchr.de>
bkchr
left a comment
There was a problem hiding this comment.
Ty! Looks good, just some last nitpicks :)
|
bot rebase |
|
Rebased |
Co-authored-by: Bastian Köcher <git@kchr.de>
This reverts commit 4da20a7.
|
bot merge |
iml_runtime_apis!impl_runtime_apis!
This PR handles
cfg_attrattribute foriml_runtime_apis!. It allows conditionally to compile different runtime api version implementations based on feature flag. E.g.:The code above will compile version 1 (with just
stable_one) by default and version 99 (withstable_oneandstaging_one) ifenable-staging-apifeature is enabled.EDIT: modified the sample code to match the latest implementation suggested by @bkchr