cargo: Introduce feature based compiling
Introducing cargo features:
- query_apply
- genconf
By default, both are compiled.
The genconf cannot be disabled, but might do in the future.
To only compile the genconf part:
cargo build --no-default-features \
--features
nmstatectl/genconf,nmstate-clib/genconf,nmstate/genconf
Github Action expanded to run cargo clippy for genconf only feature also. Also enabled MacOS build test for genconf feature only.
Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all
Can we split the "features" code at different mods so we don't have "spaghetti" cfg ?
@qinqon I have changed to code layout for fit this conditional compiling with #[cfg(feature = "query_apply")] in lib.rs or mod.rs
Please review the new patch again.
The dep: feature require rust 1.60+ while RHEL 8.6 and RHEL 9.0 is still rust 1.58.
Let me change the rpmspec to enable nightly feature in that case.
Considering this branch is targeting RHEL 8.8 and 9.2 where rust will be 1.62+, so we should be OK.
Toni tested in MacOS VM, the gc mode works well.
@cathay4t: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:
| Test name | Commit | Details | Required | Rerun command |
|---|---|---|---|---|
| pull-nmstate-integ_tier1-k8s | 335fa6994b1aacdd33989f88e8cea898b7713964 | link | false | /test pull-nmstate-integ_tier1-k8s |
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.