diff --git a/Makefile.toml b/Makefile.toml index 33bd20f99..37f7bd3d5 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -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" @@ -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." @@ -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`" @@ -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"] @@ -301,6 +324,19 @@ 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`.""" @@ -308,7 +344,7 @@ 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 diff --git a/codecov.yml b/codecov.yml index 89963a60b..93a0be5b4 100644 --- a/codecov.yml +++ b/codecov.yml @@ -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 + diff --git a/components/patina_acpi/Cargo.toml b/components/patina_acpi/Cargo.toml index 897a14b14..e2b0edea0 100644 --- a/components/patina_acpi/Cargo.toml +++ b/components/patina_acpi/Cargo.toml @@ -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 = [] diff --git a/components/patina_adv_logger/Cargo.toml b/components/patina_adv_logger/Cargo.toml index 8e8917a09..1856a743a 100644 --- a/components/patina_adv_logger/Cargo.toml +++ b/components/patina_adv_logger/Cargo.toml @@ -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"] diff --git a/components/patina_mm/Cargo.toml b/components/patina_mm/Cargo.toml index efd8238ca..f7211d0a4 100644 --- a/components/patina_mm/Cargo.toml +++ b/components/patina_mm/Cargo.toml @@ -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 = [] diff --git a/components/patina_performance/Cargo.toml b/components/patina_performance/Cargo.toml index 73f113f2e..fd1a0e2cc 100644 --- a/components/patina_performance/Cargo.toml +++ b/components/patina_performance/Cargo.toml @@ -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 = [] diff --git a/components/patina_samples/Cargo.toml b/components/patina_samples/Cargo.toml index 89097b266..43f650d20 100644 --- a/components/patina_samples/Cargo.toml +++ b/components/patina_samples/Cargo.toml @@ -18,3 +18,5 @@ patina_smbios = { workspace = true } [features] std = [] +# All non-std features to test in CI +ci_features = [] diff --git a/components/patina_smbios/Cargo.toml b/components/patina_smbios/Cargo.toml index 7159bb334..defce4e67 100644 --- a/components/patina_smbios/Cargo.toml +++ b/components/patina_smbios/Cargo.toml @@ -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" diff --git a/components/patina_test/Cargo.toml b/components/patina_test/Cargo.toml index 41f597e77..752bde166 100644 --- a/components/patina_test/Cargo.toml +++ b/components/patina_test/Cargo.toml @@ -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"] diff --git a/core/patina_debugger/Cargo.toml b/core/patina_debugger/Cargo.toml index 77b53161f..f5a87067b 100644 --- a/core/patina_debugger/Cargo.toml +++ b/core/patina_debugger/Cargo.toml @@ -30,3 +30,5 @@ patina_mtrr = { workspace = true } [features] default = [] alloc = [] +# All non-std features to test in CI +ci_features = ["alloc"] diff --git a/core/patina_internal_collections/Cargo.toml b/core/patina_internal_collections/Cargo.toml index 43ef9a9b8..715bbfb74 100644 --- a/core/patina_internal_collections/Cargo.toml +++ b/core/patina_internal_collections/Cargo.toml @@ -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 } diff --git a/core/patina_internal_cpu/Cargo.toml b/core/patina_internal_cpu/Cargo.toml index 90108f2fa..8ba5a3d15 100644 --- a/core/patina_internal_cpu/Cargo.toml +++ b/core/patina_internal_cpu/Cargo.toml @@ -37,3 +37,5 @@ serial_test = { workspace = true } default = [] std = [] doc = [] +# All non-std features to test in CI +ci_features = [] diff --git a/core/patina_internal_depex/Cargo.toml b/core/patina_internal_depex/Cargo.toml index 03f4dcb47..d40fae891 100644 --- a/core/patina_internal_depex/Cargo.toml +++ b/core/patina_internal_depex/Cargo.toml @@ -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 = [] diff --git a/core/patina_stacktrace/Cargo.toml b/core/patina_stacktrace/Cargo.toml index 64ea0d82e..9f069f2f3 100644 --- a/core/patina_stacktrace/Cargo.toml +++ b/core/patina_stacktrace/Cargo.toml @@ -29,3 +29,5 @@ winapi = { workspace = true, features = [ [features] std = [] doc = [] +# All non-std features to test in CI +ci_features = [] diff --git a/deny.toml b/deny.toml index a4c453465..10d0fab9e 100644 --- a/deny.toml +++ b/deny.toml @@ -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. diff --git a/patina_dxe_core/Cargo.toml b/patina_dxe_core/Cargo.toml index 7e6da451c..94c80cea0 100644 --- a/patina_dxe_core/Cargo.toml +++ b/patina_dxe_core/Cargo.toml @@ -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"] diff --git a/sdk/patina/Cargo.toml b/sdk/patina/Cargo.toml index fd32aa853..5bf56cfa5 100644 --- a/sdk/patina/Cargo.toml +++ b/sdk/patina/Cargo.toml @@ -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"] diff --git a/sdk/patina_ffs/Cargo.toml b/sdk/patina_ffs/Cargo.toml index 6ca1df282..2c71b5b7a 100644 --- a/sdk/patina_ffs/Cargo.toml +++ b/sdk/patina_ffs/Cargo.toml @@ -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 = [] diff --git a/sdk/patina_ffs_extractors/Cargo.toml b/sdk/patina_ffs_extractors/Cargo.toml index 1ac8939fe..a24ba487e 100644 --- a/sdk/patina_ffs_extractors/Cargo.toml +++ b/sdk/patina_ffs_extractors/Cargo.toml @@ -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"] diff --git a/sdk/patina_macro/Cargo.toml b/sdk/patina_macro/Cargo.toml index 332bfa08f..2f74b6a31 100644 --- a/sdk/patina_macro/Cargo.toml +++ b/sdk/patina_macro/Cargo.toml @@ -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"]