Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 43 additions & 7 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
default_to_workspace = false

[env]
NO_STD_FLAGS = "--profile ${RUSTC_PROFILE} -Zbuild-std=core,compiler_builtins,alloc -Zbuild-std-features=compiler-builtins-mem -Zunstable-options --timings"
NO_STD_FLAGS = "--profile ${RUSTC_PROFILE} --timings"
STD_FLAGS = "--profile ${RUSTC_PROFILE} --features std"
COV_FLAGS = { value = "--workspace --profile test --ignore-filename-regex .*test.*", condition = { env_not_set = ["COV_FLAGS"] } }
RUSTDOCFLAGS = "-D warnings -D missing_docs"
Expand Down Expand Up @@ -113,11 +113,17 @@ clear = true
command = "cargo"
args = ["build", "@@split(STD_FLAGS, )", "--example", "dxe_core_std"]

[tasks.check_code]
description = "Checks rust code for no_std build errors with results."
[tasks.check_code_x64]
description = "Checks rust code for x64 build errors with results."
private = true
command = "cargo"
args = ["check", "--all-targets", "--all-features", "@@split(CARGO_MAKE_TASK_ARGS, )"]
args = ["check", "--target", "x86_64-unknown-uefi", "--features", "ci_features", "@@split(CARGO_MAKE_TASK_ARGS, )", "@@split(NO_STD_FLAGS, )",]

[tasks.check_code_aarch64]
description = "Checks rust code for aarch64 build errors with results."
private = true
command = "cargo"
args = ["check", "--target", "aarch64-unknown-uefi", "--features", "ci_features", "@@split(CARGO_MAKE_TASK_ARGS, )", "@@split(NO_STD_FLAGS, )",]

[tasks.check_tests]
description = "Checks rust test code for build errors with results."
Expand Down Expand Up @@ -145,7 +151,7 @@ run_task = [{ name = ["check-no-default-features-code", "check-no-default-featur
[tasks.check]
description = "Checks rust code for errors. Example `cargo make check`"
clear = true
run_task = [{ name = ["check_code", "check_tests"], parallel = true }]
run_task = [{ name = ["check_code_x64", "check_code_aarch64", "check_tests"], parallel = true }]

[tasks.patina-test]
description = "Builds crates with Patina tests enabled. Example `cargo make patina-test`"
Expand Down Expand Up @@ -278,8 +284,25 @@ command = "cargo"
args = ["doc", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "--features", "doc", "--open"]

[tasks.clippy]
description = "Run cargo clippy."
description = "Run cargo clippy for the host target and both UEFI cross-compilation targets."
clear = true
run_task = [{ name = ["clippy-x64", "clippy-aarch64", "clippy-std"], parallel = true }]

[tasks.clippy-x64]
description = "Run cargo clippy for x86_64-unknown-uefi."
private = true
command = "cargo"
args = ["clippy", "--target", "x86_64-unknown-uefi", "--features", "ci_features", "@@split(NO_STD_FLAGS, )", "--", "-D", "warnings"]

[tasks.clippy-aarch64]
description = "Run cargo clippy for aarch64-unknown-uefi."
private = true
command = "cargo"
args = ["clippy", "--target", "aarch64-unknown-uefi", "--features", "ci_features", "@@split(NO_STD_FLAGS, )", "--", "-D", "warnings"]

[tasks.clippy-std]
description = "Run cargo clippy for std."
private = true
command = "cargo"
args = ["clippy", "--all-targets", "--all-features", "--", "-D", "warnings"]

Expand All @@ -301,14 +324,27 @@ clear = true
command = "cargo"
args = ["test", "--doc"]

[tasks.clean-mdbook-deps]
description = """Removes the `target/mdbook/` directory to clean up old rlibs."""
clear = true
script_runner = "@duckscript"
script = '''
mdbook_target = set "target/mdbook"
exists = is_path_exists ${mdbook_target}
if ${exists}
echo Removing stale ${mdbook_target} directory...
rm -r ${mdbook_target}
end
'''

[tasks.build-mdbook-deps]
description = """Builds workspace libraries with the `mdbook` profile.
This is a prerequisite for `cargo make test-mdbook`."""
clear = true
env = { RUSTC_PROFILE = "mdbook" }
command = "cargo"
args = ["build", "--all-features", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(STD_FLAGS, )"]
dependencies = ["individual-package-targets"]
dependencies = ["clean-mdbook-deps", "individual-package-targets"]

[tasks.test-mdbook]
description = """Builds the mdbook and runs all of its embedded doctests with
Expand Down
3 changes: 2 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ coverage:
only_pulls: true
comment:
after_n_builds: 2
layout: "condensed_header, condensed_files, condensed_footer"
layout: "condensed_files, condensed_footer"
hide_project_coverage: true # Only show patch coverage in a PR comment

2 changes: 2 additions & 0 deletions components/patina_acpi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ patina = { workspace = true, features = ["mockall"] }
[features]
mockall = ["dep:mockall", "std"]
std = []
# All non-std features to test in CI
ci_features = []
2 changes: 2 additions & 0 deletions components/patina_adv_logger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ reader = []
component = ['alloc', 'reader']
std = ['clap', 'alloc', 'reader']
default = ['component']
# All non-std features to test in CI
ci_features = ["alloc", "reader", "component"]
2 changes: 2 additions & 0 deletions components/patina_mm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ patina_dxe_core = { path = "../../patina_dxe_core"}
doc = []
mockall = ["dep:mockall", "std"]
std = []
# All non-std features to test in CI
ci_features = []
4 changes: 4 additions & 0 deletions components/patina_performance/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@ zerocopy-derive = { workspace = true }
[dev-dependencies]
patina = { path = "../../sdk/patina", features = ["mockall"] }
mockall = { workspace = true }

[features]
# All non-std features to test in CI
ci_features = []
2 changes: 2 additions & 0 deletions components/patina_samples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ patina_smbios = { workspace = true }

[features]
std = []
# All non-std features to test in CI
ci_features = []
2 changes: 2 additions & 0 deletions components/patina_smbios/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ patina = { workspace = true, features = ["mockall"] }
[features]
mockall = ["dep:mockall", "std"]
std = []
# All non-std features to test in CI
ci_features = []

[lints.clippy]
undocumented_unsafe_blocks = "warn"
Expand Down
2 changes: 2 additions & 0 deletions components/patina_test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ spin = { workspace = true }

[features]
test-runner = ["patina_macro/enable_patina_tests"]
# All non-std features to test in CI
ci_features = ["test-runner"]
2 changes: 2 additions & 0 deletions core/patina_debugger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ patina_mtrr = { workspace = true }
[features]
default = []
alloc = []
# All non-std features to test in CI
ci_features = ["alloc"]
2 changes: 2 additions & 0 deletions core/patina_internal_collections/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ workspace = true
[features]
default = ["alloc"]
alloc = []
# All non-std features to test in CI
ci_features = ["alloc"]

[dependencies]
log = { workspace=true }
Expand Down
2 changes: 2 additions & 0 deletions core/patina_internal_cpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ serial_test = { workspace = true }
default = []
std = []
doc = []
# All non-std features to test in CI
ci_features = []
4 changes: 4 additions & 0 deletions core/patina_internal_depex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ workspace = true
r-efi = { workspace = true }
uuid = { workspace = true }
log = { workspace = true }

[features]
# All non-std features to test in CI
ci_features = []
2 changes: 2 additions & 0 deletions core/patina_stacktrace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ winapi = { workspace = true, features = [
[features]
std = []
doc = []
# All non-std features to test in CI
ci_features = []
2 changes: 1 addition & 1 deletion deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ignore = [
#"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish
#{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" },

{ id = "RUSTSEC-2024-0436", reason = "Macros for token pasting. No longer maintained per readme. Consider alternatives." }
# None right now
]
# If this is true, then cargo deny will use the git executable to fetch advisory database.
# If this is false, then it uses a built-in git library.
Expand Down
2 changes: 2 additions & 0 deletions patina_dxe_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ doc = ["patina_internal_cpu/doc"]
compatibility_mode_allowed = []
v1_resource_descriptor_support = []
debugger_reload = []
# All non-std features to test in CI
ci_features = ["compatibility_mode_allowed", "v1_resource_descriptor_support", "debugger_reload"]
2 changes: 2 additions & 0 deletions sdk/patina/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,5 @@ serde-with-yaml = ["serde", "dep:serde_yaml"]

unstable = ["unstable-device-path"]
unstable-device-path = []
# All non-std features to test in CI
ci_features = ["core", "alloc", "global_allocator", "unstable", "unstable-device-path"]
4 changes: 4 additions & 0 deletions sdk/patina_ffs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ serde = {workspace = true}
uuid = {workspace = true}
serde_yaml = {workspace = true}
lzma-rs = {workspace = true}

[features]
# All non-std features to test in CI
ci_features = []
2 changes: 2 additions & 0 deletions sdk/patina_ffs_extractors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ std = []
brotli = ["dep:brotli-decompressor", "dep:alloc-no-stdlib"]
crc32 = ["dep:crc32fast"]
lzma = ["dep:patina_lzma_rs"]
# All non-std features to test in CI
ci_features = ["brotli", "crc32", "lzma"]
2 changes: 2 additions & 0 deletions sdk/patina_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ default = []
# with the `#[patina_test]` attribute. Otherwise, a linker crash or failure will
# occur!
enable_patina_tests = []
# All non-std features to test in CI
ci_features = ["enable_patina_tests"]
Loading