Skip to content

.sync/Makefile.toml: Check and test without default features#94

Open
makubacki wants to merge 1 commit intoOpenDevicePartnership:mainfrom
makubacki:add_check_test_no_default_feats
Open

.sync/Makefile.toml: Check and test without default features#94
makubacki wants to merge 1 commit intoOpenDevicePartnership:mainfrom
makubacki:add_check_test_no_default_feats

Conversation

@makubacki
Copy link
Collaborator

Without --no-default-features testing, feature-gate regressions go undetected. Code that accidentally uses a gated module or dependency outside its cfg fence compiles fine under default features but breaks for consumers that disable defaults.

Adds a higher level check-no-default-features task with two parallel subtasks:

  • check-no-default-features-code:
    • cargo check --no-default-features
  • check-no-default-features-tests:
    • cargo test --no-run --no-default-features

Runs the task in cargo make all.

Makefile-patina-readiness-tool.toml is not updated since it doesn't have a current check task and won't benefit much from this change.

Without `--no-default-features` testing, feature-gate regressions go
undetected. Code that accidentally uses a gated module or dependency
outside its `cfg` fence compiles fine under default features but
breaks for consumers that disable defaults.

Adds a higher level `check-no-default-features` task with two parallel
subtasks:

  - `check-no-default-features-code`:
    - `cargo check --no-default-features`
  - `check-no-default-features-tests`:
    - `cargo test --no-run --no-default-features`

Runs the task in `cargo make all`.

Makefile-patina-readiness-tool.toml is not updated since it doesn't
have a current `check` task and won't benefit much from this change.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
@makubacki makubacki requested review from Javagedes and os-d March 14, 2026 00:22
@makubacki makubacki self-assigned this Mar 14, 2026
@makubacki
Copy link
Collaborator Author

The change in the patina repo will be merged in OpenDevicePartnership/patina#1404. The patina Makefile.toml changes in this PR exactly match that change.

Copy link
Contributor

@Javagedes Javagedes left a comment

Choose a reason for hiding this comment

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

We probably want an additional step in CI to run the one that compiles with no features

@makubacki
Copy link
Collaborator Author

makubacki commented Mar 16, 2026

We probably want an additional step in CI to run the one that compiles with no features

To make sure I understand correctly, are you suggesting that check-no-default-features is sufficient in the all task from a sanity check perspective, but we have another step (outside of all that is already called today in CI) that invokes cargo test --no-default-features (because --no-run is in check-no-default-features)?

@makubacki
Copy link
Collaborator Author

We probably want an additional step in CI to run the one that compiles with no features

To make sure I understand correctly...

I spoke to Joey offline. I assumed that we run cargo make all in CI like some other repos, but that's not the case. I will add it to the CI steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants