Skip to content

Commit 0707ddf

Browse files
committed
doc: help with feature selection
1 parent 2e1df6a commit 0707ddf

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

uefi-test-runner/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2024"
77

88
[dependencies]
99
uefi-raw = { path = "../uefi-raw" }
10-
uefi = { path = "../uefi", features = ["alloc", "global_allocator", "panic_handler", "logger", "qemu"] }
10+
uefi = { path = "../uefi", features = ["alloc", "global_allocator", "panic_handler", "logger", "qemu", "log-debugcon"] }
1111

1212
log.workspace = true
1313

uefi/Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ license.workspace = true
1515
repository.workspace = true
1616
rust-version.workspace = true
1717

18+
# Feature documentation in uefi/lib.rs.
1819
[features]
19-
# KEEP this feature list in sync with doc in lib.rs!
20-
default = [ "log-debugcon" ]
20+
# KEEP this feature list in sync with doc in uefi/lib.rs!
21+
default = [ ]
2122
alloc = []
2223

23-
# Generic gate to code that uses unstable features of Rust. You usually need a nightly toolchain.
24+
# Generic gate to code that uses unstable features of Rust, needing a nightly
25+
# toolchain.
2426
unstable = []
2527

2628
# Helper features:
@@ -31,9 +33,6 @@ panic_handler = []
3133
# - dependency log-debugcon: logical, not technical
3234
# - dependency panic_handler: logical, not technical
3335
qemu = ["dep:qemu-exit", "panic_handler", "log-debugcon"]
34-
# Whether the internal logger from the helpers module should also log to
35-
# the debugcon device (QEMU) and debug-console (cloud-hypervisor). Only works
36-
# on x86.
3736
log-debugcon = []
3837

3938
[dependencies]

uefi/src/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@
120120
//!
121121
//! ## Optional Cargo crate features
122122
//!
123+
//! A list of recommended default features follows below.
124+
//!
125+
//! ### Feature List
126+
//!
123127
//! - `alloc`: Enable functionality requiring the [`alloc`] crate from
124128
//! the Rust standard library. For example, methods that return a
125129
//! `Vec` rather than filling a statically-sized array. This requires
@@ -134,6 +138,8 @@
134138
//! - `logger`: Logging implementation for the standard [`log`] crate
135139
//! that prints output to the UEFI console. No buffering is done; this
136140
//! is not a high-performance logger.
141+
//! - `log-debugcon`: Whether the logger set up by `logger` should also log
142+
//! to the debugcon device (available in QEMU or Cloud Hypervisor on x86).
137143
//! - `panic_handler`: Add a default panic handler that logs to `stdout`.
138144
//! - `unstable`: Enable functionality that depends on [unstable
139145
//! features] in the nightly compiler.
@@ -147,6 +153,16 @@
147153
//! only unfold their potential when you invoke `uefi::helpers::init` as soon
148154
//! as possible in your application.
149155
//!
156+
//! ### Recommended Default Features
157+
//!
158+
//! In typical use-cases, the following features are useful for you:
159+
//! - Building a UEFI image:
160+
//! - Recommended: `alloc`, `global_allocator`, `logger`, `panic_handler`
161+
//! - Optional : `log-debugcon`, `unstable`, `qemu`
162+
//! - Building another application/library:
163+
//! - Recommended: `alloc`,
164+
//! - Optional : `unstable`
165+
//!
150166
//! # Discuss and Contribute
151167
//!
152168
//! For general discussions, feel free to join us in our [Zulip] and ask

0 commit comments

Comments
 (0)