Skip to content

Commit 36769d0

Browse files
committed
xtask: allow "unstable_features" flag
1 parent 2f025e3 commit 36769d0

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

xtask/src/cargo.rs

+7
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub enum Feature {
5151
Logger,
5252
PanicOnLoggerErrors,
5353
Unstable,
54+
UnstableAlloc,
5455

5556
// `uefi-services` features.
5657
PanicHandler,
@@ -69,6 +70,7 @@ impl Feature {
6970
Self::Logger => "logger",
7071
Self::PanicOnLoggerErrors => "panic-on-logger-errors",
7172
Self::Unstable => "unstable",
73+
Self::UnstableAlloc => "unstable_alloc",
7274

7375
Self::PanicHandler => "uefi-services/panic_handler",
7476
Self::Qemu => "uefi-services/qemu",
@@ -99,6 +101,11 @@ impl Feature {
99101
vec![Self::GlobalAllocator, Self::Alloc, Self::Logger]
100102
}
101103

104+
/// Set of features that enables more code in the root uefi crate.
105+
pub fn more_code_unstable() -> Vec<Self> {
106+
vec![Self::Unstable, Self::UnstableAlloc]
107+
}
108+
102109
fn comma_separated_string(features: &[Feature]) -> String {
103110
features
104111
.iter()

xtask/src/main.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,15 @@ fn build(opt: &BuildOpt) -> Result<()> {
4545
return build_feature_permutations(opt);
4646
}
4747

48+
let mut features = Feature::more_code();
49+
50+
if opt.unstable_features {
51+
features.extend(Feature::more_code_unstable())
52+
}
53+
4854
let cargo = Cargo {
4955
action: CargoAction::Build,
50-
features: Feature::more_code(),
56+
features,
5157
packages: Package::all_except_xtask(),
5258
release: opt.build_mode.release,
5359
target: Some(*opt.target),

xtask/src/opt.rs

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ pub struct BuildOpt {
6363
#[clap(flatten)]
6464
pub build_mode: BuildModeOpt,
6565

66+
/// Tells whether unstable features should be activated.
67+
#[clap(long, action)]
68+
pub unstable_features: bool,
69+
6670
/// Build multiple times to check that different feature
6771
/// combinations work.
6872
#[clap(long, action)]

0 commit comments

Comments
 (0)