Skip to content

[major] Remove "alloc" feature from default feature list of all Patina crates - #1685

Merged
vineelko merged 1 commit into
OpenDevicePartnership:majorfrom
vineelko:users/vineelko/patina_feature_dependency_fix_0801
Aug 3, 2026
Merged

vineelko merged 1 commit into
OpenDevicePartnership:majorfrom
vineelko:users/vineelko/patina_feature_dependency_fix_0801

Conversation

@vineelko

@vineelko vineelko commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

Background: Behavior of --all-features with explicit package vs without explicit package:

cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib

NOTE: --tests is nothing special here any target can be picked

Problem: Rust MM Supervisor avoids hidden heap allocations from dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently includes
"alloc" in its default feature set, the MM Supervisor branch had to explicitly
remove it from its default features(default = []) and also by not defining an
explicit #[global_allocator]. Because default-features = false only affects
a direct dependency, not transitive dependencies

Now with default=[] in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means trying to
run cargo clippy --tests did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as patina
sdk is neither built with test feature(remember this is a dependency to whatever
crate is being built) nor alloc(since we have set default=[]).

sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
cargo clippy --tests will break the build with or without --all-features because in
both the cases c_ptr.rs is always present and extern crate alloc is always
absent as neither test feature(again remember this is a dependency to whatever
crate is being built) nor alloc(since we have set default=[]).

sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;

Resulting in below error:

error[E0433]: cannot find module or crate `alloc` in this scope
--> sdk\patina\src\base\c_ptr.rs:9:5
|
9 | use alloc::boxed::Box;
|     ^^^^^ use of unresolved module or unlinked crate `alloc`

While restoring the feature gate on c_ptr fixes this immediate issue(also done
in #1677), debugging "feature"
related failures like this is not a very pleasant experience. In particular,
--all-features only applies to the package being built and does not propagate
to dependencies. To some extent cargo hack makes it easier to run failing
command on individual packages but that brings in its own set of new challenges.
After spending a considerable amount of time untangling the dependencies and
finding the root cause, it seems that removing "alloc" from the default feature set
across all Patina crates would alleviate some of the debugging pain.

Benefits:

  1. Patina crates no longer assume the presence of the alloc feature.

  2. Crates within Patina repo are nothing special and they have to explicitly
    declare the required feature set, making feature usage easier to audit and
    maintain.

    E:\repos\patina>cargo tree -e features -p patina_ffs_extractors -e=no-dev
    patina_ffs_extractors v23.0.1 (E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----
    
    vs
    
    E:\repos\patina>cargo tree -e features -p patina_ffs_extractors -e=no-dev
    patina_ffs_extractors v23.0.1 (E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    
  3. Rust MM Supervisor can now opt out of alloc without requiring any hacks.
    Please note that #[global_allocator] should still be avoided so that the
    compiler can flag any dependent code paths that require heap allocations.

This is a breaking change because existing consumers relying on Patina's default
feature set will need to explicitly enable the required features. Most existing
crates have already been updated as part of this commit.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

cargo make all and validated on hardware platform.

Integration Instructions

All external crates relying on patina crates will need to add "alloc" to the features list like below
patina = { workspace = true, features = ["alloc"] }

@vineelko
vineelko requested review from kuqin12 and makubacki August 1, 2026 22:48
@github-actions github-actions Bot added impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact labels Aug 1, 2026
@patina-automation

patina-automation Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

ℹ️ QEMU Validation Skipped - PR Branch Unavailable

The Patina QEMU PR validation workflow did not run because the PR branch is no longer accessible.

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/30833255931

Note: Previous results are available in this comment's edit history.

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@makubacki makubacki left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I agree with the change. Especially after sorting through similar issues last week. However, I think this should target the major branch given it is a breaking change and given the immediate code changes made in #1677, it shouldn't' be urgent.

@vineelko

vineelko commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Sure Michael, will get this into major branch.

@vineelko
vineelko changed the base branch from main to major August 3, 2026 16:24
…ncies explicit

**TIL:**

Behavior of `--all-features` with explicit package vs without explicit package,
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
NOTE: --tests is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently includes
"alloc" in its default feature set, the MM Supervisor branch had to explicitly
remove it from its default features(`default = []`) and also by not defining an
explicit `#[global_allocator]`. Because `default-features = false` only affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as patina
sdk is neither built with test feature(remember this is a dependency to whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run `cargo
clippy --tests` will break the build with or without `--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is always
absent as neither test feature(again remember this is a dependency to whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate issue(also done
in OpenDevicePartnership#1677), debugging feature
related failures like this is not a very pleasant experience. In particular,
`--all-features` only applies to the package being built and does not propagate
to dependencies. To some extent `cargo hack` makes it easier to run failing
command on individual packages but that brings in its own set of new challenges.
After spending a considerable amount of time untangling the dependencies and
understanding the root cause, it seems that disabling the default feature set
across all Patina crates would alleviate some of the debugging pain.

Benefits:
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to explicitly
   declare the required feature set, making feature usage easier to audit and
   maintain.
    ```
    E:\repos\patina>cargo tree -e features -p patina_ffs_extractors -e=no-dev
    patina_ffs_extractors v23.0.1 (E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

    E:\repos\patina>cargo tree -e features -p patina_ffs_extractors -e=no-dev
    patina_ffs_extractors v23.0.1 (E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any hacks.
   Please note that #[global_allocator] should still be avoided so that the
   compiler can flag any dependent code paths that require heap allocations.

This is a breaking change because existing consumers relying on Patina's default
feature set will need to explicitly enable the required features. Most existing
crates have already been updated as part of this commit.
@vineelko
vineelko force-pushed the users/vineelko/patina_feature_dependency_fix_0801 branch from bd56c7f to c054b5b Compare August 3, 2026 16:25
@makubacki makubacki changed the title Disable default features across Patina crates to make feature dependencies explicit [major] Disable default features across Patina crates to make feature dependencies explicit Aug 3, 2026
@makubacki
makubacki requested a review from Javagedes August 3, 2026 17:23
@makubacki

Copy link
Copy Markdown
Collaborator

Added @Javagedes since he's looking at additive feature changes.

@Javagedes

Copy link
Copy Markdown
Contributor

Overall I don't agree with disabling default features across patina. That is very uncommon across the ecosystem.

In my opinion the answer is that if you don't think the feature should be enabled by default, then we should not have it in the default features list. But there are some features that should realistically be always on (alloc features for example).

Regardless of my opinion and whether you follow through with this, there are three features that are not additive, so if any of them are swapped from enabled to disabled by default, will cause breaking changes:

  1. alloc feature in patina_debugger will disable almost all of the functionality we know and love in the debugger. However enabling / disabling this feature at the moment also requires a manual change in patina crate to change the location at which patina_debugger::initialize is called. See: [Feature]: make alloc feature for patina_debugger additive #1686
  2. compatability_mode_allowed: This is also not additive; it swaps implementation of activate_compatiability_mode. I think this is off by default already, so I don't think this will have an issue. See [Feature]: make compatability_mode_allowed feature additive #1664
  3. v1_resource_descriptor_support. This is also not additive. It swaps how hobs are parsed. I think this is off by default so it should not be an issue. See [Feature]: make v1_resource_descriptor_support feature additive #1663

@kuqin12

kuqin12 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

In my opinion the answer is that if you don't think the feature should be enabled by default, then we should not have it in the default features list. But there are some features that should realistically be always on (alloc features for example).

The alloc is actually the main issue here. We will not support the alloc nor put global allocator in the supervisor binary for simplicity.

@Javagedes

Copy link
Copy Markdown
Contributor

In my opinion the answer is that if you don't think the feature should be enabled by default, then we should not have it in the default features list. But there are some features that should realistically be always on (alloc features for example).

The alloc is actually the main issue here. We will not support the alloc nor put global allocator in the supervisor binary for simplicity.

I should have looked at the PR more closely. The PR title is poorely worded. This is not disabling all default features across the patina crates. This is simply removing alloc from the default list of features specifically for patina_internal_core. That is not as big of a deal in my eyes.

However I still don't understand why you cannot just do default-features = false for your crate, rather removing it from the default list of features somewhere else. It at least prevents a breaking change.

@vineelko

vineelko commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks Joey, let me update the title. I was more furious after scratching my head debugging it, hence the title 😄

However I still don't understand why you cannot just do default-features = false for your crate, rather removing it from the default list of features somewhere else. It at least prevents a breaking change.

The problem is not about the direct usage of a dependency. It is the indirect inclusion of "alloc" crate which is a pain to debug and isolate. default-features=false only prevent an immediate dependency to not include its default feature set but it does not prevent a transitive dependency to include its defaults. On top that, it works fine for normal cargo build with minor fixes, but fails for various clippy/test configurations we run as part of cargo make all.

@vineelko vineelko changed the title [major] Disable default features across Patina crates to make feature dependencies explicit [major] Remove "alloc" feature from default feature list of all Patina crates Aug 3, 2026
@kuqin12

kuqin12 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

However I still don't understand why you cannot just do default-features = false for your crate, rather removing it from the default list of features somewhere else. It at least prevents a breaking change.

The problem is not about the direct usage of a dependency. It is the indirect inclusion of "alloc" crate which is a pain to debug and isolate. default-features=false only prevent an immediate dependency to not include its default feature set but it does not prevent a transitive dependency to include its defaults. On top that, it works fine for normal cargo build with minor fixes, but fails for various clippy/test configurations we run as part of cargo make all.

Yes, the alloc should not be propagated to the platform level. But we should not let it creep into the basic crates unconditionally, either.

@vineelko

vineelko commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Yes, the alloc should not be propagated to the platform level. But we should not let it creep into the basic crates unconditionally, either.

Agreed, this PR only makes the dependency on "alloc" crate explicit but does not prevent any alloc feature usage from a transitive dependency(though it makes auditing the dependency tree via "cargo tree" slightly better to pin point).

Why a crate needs a dependency on "alloc" is a different question which requires more scrutiny and if needed should be isolated with a feature guard as already done in #1677

@vineelko
vineelko merged commit 63d2ac8 into OpenDevicePartnership:major Aug 3, 2026
15 checks passed
kuqin12 pushed a commit that referenced this pull request Aug 13, 2026
…a crates (#1685)

## Description

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

`cargo make all` and validated on hardware platform.

## Integration Instructions

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
makubacki pushed a commit that referenced this pull request Sep 14, 2026
…a crates (#1685)

## Description

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

`cargo make all` and validated on hardware platform.

## Integration Instructions

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
kuqin12 pushed a commit that referenced this pull request Sep 17, 2026
…a crates (#1685)

## Description

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

`cargo make all` and validated on hardware platform.

## Integration Instructions

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
makubacki pushed a commit that referenced this pull request Sep 17, 2026
…a crates (#1685)

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
extern crate alloc;

pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

`cargo make all` and validated on hardware platform.

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
vineelko added a commit that referenced this pull request Oct 1, 2026
…a crates (#1685)

## Description

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

`cargo make all` and validated on hardware platform.

## Integration Instructions

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
makubacki pushed a commit that referenced this pull request Oct 9, 2026
…#1685)

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
extern crate alloc;

pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

`cargo make all` and validated on hardware platform.

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
vineelko added a commit that referenced this pull request Oct 11, 2026
…a crates (#1685)

## Description

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

`cargo make all` and validated on hardware platform.

## Integration Instructions

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
vineelko added a commit that referenced this pull request Oct 12, 2026
…a crates (#1685)

## Description

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

`cargo make all` and validated on hardware platform.

## Integration Instructions

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
vineelko added a commit that referenced this pull request Oct 13, 2026
…a crates (#1685)

## Description

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
#[cfg(any(test, feature = "alloc"))]        <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

`cargo make all` and validated on hardware platform.

## Integration Instructions

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
makubacki pushed a commit that referenced this pull request Oct 13, 2026
…#1685)

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
extern crate alloc;

pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

`cargo make all` and validated on hardware platform.

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
makubacki pushed a commit that referenced this pull request Oct 13, 2026
…#1685)

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
extern crate alloc;

pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

`cargo make all` and validated on hardware platform.

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
makubacki pushed a commit that referenced this pull request Oct 13, 2026
…#1685)

**Background:** Behavior of `--all-features` with explicit package vs
without explicit package:
```
cargo clippy --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- all features defined in crate_b are enabled and built as a lib

cargo clippy -p crate_a --all-features --tests
workspace
  crate a(feature fa)           <--- all features defined in crate_a are enabled and built as a test binary
    crate b(feature fb)         <--- only features selected when specifying crate_b as dependency are enabled(if non selected, default features are applied) and built as a lib
```
**NOTE:** `--tests` is nothing special here any target can be picked

**Problem:** Rust MM Supervisor avoids hidden heap allocations from
dependencies
by ensuring the "alloc" feature is not enabled. Since Patina currently
includes
"alloc" in its default feature set, the MM Supervisor branch had to
explicitly
remove it from its default features(`default = []`) and also by not
defining an
explicit `#[global_allocator]`. Because `default-features = false` only
affects
a direct dependency, not transitive dependencies

Now with `default=[]` in place on patina sdk in feature/supv branch,

Before the SDK refactor, c_ptr.rs is gated as shown below. Which means
trying to
run `cargo clippy --tests` did not break the build with or without
--all-features because in both cases c_ptr.rs is fully stubbed out as
patina
sdk is neither built with test feature(remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
extern crate alloc;

pub mod boot_services;

sdk\patina\src\boot_services\c_ptr.rs       <----- stubbed out because patina sdk is a dependency for whatever test crate is being built right now
use alloc::boxed::Box;
```

After the SDK refactor, c_ptr.rs is NOT gated. Which means trying to run
`cargo clippy --tests` will break the build with or without
`--all-features` because in
both the cases c_ptr.rs is always present and `extern crate alloc` is
always
absent as neither test feature(again remember this is a dependency to
whatever
crate is being built) nor alloc(since we have set default=[]).

```
sdk\patina\src\lib.rs
extern crate alloc;

pub mod base;                               <----- NOT STUBBED OUT

sdk\patina\src\base\c_ptr.rs                <----- NOT STUBBED OUT
use alloc::boxed::Box;
```

Resulting in below error:

  ```
  error[E0433]: cannot find module or crate `alloc` in this scope
 --> sdk\patina\src\base\c_ptr.rs:9:5
  |
9 | use alloc::boxed::Box;
  |     ^^^^^ use of unresolved module or unlinked crate `alloc`
  ```

While restoring the feature gate on `c_ptr` fixes this immediate
issue(also done
in #1677), debugging
"feature"
related failures like this is not a very pleasant experience. In
particular,
`--all-features` only applies to the package being built and does not
propagate
to dependencies. To some extent `cargo hack` makes it easier to run
failing
command on individual packages but that brings in its own set of new
challenges.
After spending a considerable amount of time untangling the dependencies
and
finding the root cause, it seems that removing "alloc" from the default
feature set
across all Patina crates would alleviate some of the debugging pain.

**Benefits:**
1. Patina crates no longer assume the presence of the `alloc` feature.
2. Crates within Patina repo are nothing special and they have to
explicitly
declare the required feature set, making feature usage easier to audit
and
   maintain.

    ```
E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "default"  <----

    vs

E:\repos\patina>cargo tree -e features -p patina_ffs_extractors
-e=no-dev
patina_ffs_extractors v23.0.1
(E:\repos\patina\sdk\patina_ffs_extractors)
    ...
    ├── patina feature "alloc"    <----
    ```
3. Rust MM Supervisor can now opt out of `alloc` without requiring any
hacks.
Please note that #[global_allocator] should still be avoided so that the
compiler can flag any dependent code paths that require heap
allocations.

This is a breaking change because existing consumers relying on Patina's
default
feature set will need to explicitly enable the required features. Most
existing
crates have already been updated as part of this commit.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [x] Breaking change?
- [ ] Includes tests?
- [ ] Includes documentation?

`cargo make all` and validated on hardware platform.

All external crates relying on patina crates will need to add "alloc" to
the features list like below
`patina = { workspace = true, features = ["alloc"] }`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:breaking-change Requires integration attention impact:non-functional Does not have a functional impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants