nmstate icon indicating copy to clipboard operation
nmstate copied to clipboard

cargo: Introduce feature based compiling

Open cathay4t opened this issue 3 years ago • 3 comments

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.

cathay4t avatar Aug 25 '22 08:08 cathay4t

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

kubevirt-bot avatar Aug 25 '22 08:08 kubevirt-bot

Can we split the "features" code at different mods so we don't have "spaghetti" cfg ?

qinqon avatar Aug 29 '22 15:08 qinqon

@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.

cathay4t avatar Sep 20 '22 10:09 cathay4t

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.

cathay4t avatar Sep 20 '22 10:09 cathay4t

Toni tested in MacOS VM, the gc mode works well.

cathay4t avatar Sep 20 '22 14:09 cathay4t

@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.

kubevirt-bot avatar Sep 22 '22 08:09 kubevirt-bot