From 81a5a6a9f179e80855c8409f4215cc2a67e0c49f Mon Sep 17 00:00:00 2001 From: Melvin Wang Date: Sat, 11 Nov 2023 19:42:22 -0800 Subject: [PATCH] build: update cargo-make tasks with arch-specific tools --- .gitignore | 2 - crates/sample-kmdf-driver/Makefile.toml | 3 + crates/wdk-build/src/cargo_make.rs | 111 ++++++++++- crates/wdk-build/src/lib.rs | 57 +++++- crates/wdk-build/src/utils.rs | 10 +- rust-driver-makefile.toml | 234 ++++++++++++++++++++---- 6 files changed, 365 insertions(+), 52 deletions(-) diff --git a/.gitignore b/.gitignore index d92d5d4a..2f7896d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ target/ -DriverCertificate.cer -.cargo-make-loadscripts/ diff --git a/crates/sample-kmdf-driver/Makefile.toml b/crates/sample-kmdf-driver/Makefile.toml index eaeeafc1..91a7bc9e 100644 --- a/crates/sample-kmdf-driver/Makefile.toml +++ b/crates/sample-kmdf-driver/Makefile.toml @@ -1 +1,4 @@ extend = "../../rust-driver-makefile.toml" + +[env] +WDK_BUILD_ADDITIONAL_INFVERIF_FLAGS = "/msft" diff --git a/crates/wdk-build/src/cargo_make.rs b/crates/wdk-build/src/cargo_make.rs index 8c12f50d..2cf1fa0c 100644 --- a/crates/wdk-build/src/cargo_make.rs +++ b/crates/wdk-build/src/cargo_make.rs @@ -9,6 +9,14 @@ use clap::{Args, Parser}; +use crate::{ + utils::{detect_wdk_content_root, get_latest_windows_sdk_version, PathExt}, + CPUArchitecture, + ConfigError, +}; + +const PATH_ENV_VAR: &str = "Path"; + /// The name of the environment variable that cargo-make uses during `cargo /// build` and `cargo test` commands const CARGO_MAKE_CARGO_BUILD_TEST_FLAGS_ENV_VAR: &str = "CARGO_MAKE_CARGO_BUILD_TEST_FLAGS"; @@ -363,7 +371,7 @@ pub fn validate_and_forward_args() { .to_string_lossy() .strip_prefix('+') .expect("Toolchain arg should have a + prefix") - .to_owned(), + .to_string(), ) } else { None @@ -389,7 +397,92 @@ pub fn validate_and_forward_args() { forward_env_var_to_cargo_make(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS_ENV_VAR); } -fn append_to_space_delimited_env_var>(env_var_name: S, string_to_append: S) { +/// Prepends the path variable with the necessary paths to access WDK tools +/// +/// # Errors +/// +/// This function returns a [`ConfigError::WDKContentRootDetectionError`] if the +/// WDK content root directory could not be found. +/// Sets up the path for the WDK build environment. +/// +/// # Panics +/// +/// This function will panic if the CPU architecture cannot be determined from +/// `std::env::consts::ARCH` or if the PATH variable contains non-UTF8 +/// characters. +pub fn setup_path() -> Result<(), ConfigError> { + // let arch_specific_wdk_tool_root = wdk_tool_root + // .join(host_arch.as_windows_str()) + // .canonicalize()? + // .strip_extended_length_path_prefix()?; + + let Some(wdk_content_root) = detect_wdk_content_root() else { + return Err(ConfigError::WDKContentRootDetectionError); + }; + let version = get_latest_windows_sdk_version(&wdk_content_root.join("Lib"))?; + let host_arch = CPUArchitecture::try_from_cargo_str(std::env::consts::ARCH) + .expect("The rust standard library should always set std::env::consts::ARCH"); + + let wdk_bin_root = wdk_content_root + .join(format!("bin/{version}")) + .canonicalize()? + .strip_extended_length_path_prefix()?; + let host_windows_sdk_ver_bin_path = match host_arch { + CPUArchitecture::AMD64 => wdk_bin_root + .join(host_arch.as_windows_str()) + .canonicalize()? + .strip_extended_length_path_prefix()? + .to_str() + .expect("x64 host_windows_sdk_ver_bin_path should only contain valid UTF8") + .to_string(), + CPUArchitecture::ARM64 => wdk_bin_root + .join(host_arch.as_windows_str()) + .canonicalize()? + .strip_extended_length_path_prefix()? + .to_str() + .expect("ARM64 host_windows_sdk_ver_bin_path should only contain valid UTF8") + .to_string(), + }; + + // Some tools (ex. inf2cat) are only available in the x86 folder + let x86_windows_sdk_ver_bin_path = wdk_bin_root + .join("x86") + .canonicalize()? + .strip_extended_length_path_prefix()? + .to_str() + .expect("x86_windows_sdk_ver_bin_path should only contain valid UTF8") + .to_string(); + prepend_to_semicolon_delimited_env_var( + PATH_ENV_VAR, + // By putting host path first, host versions of tools are prioritized over + // x86 versions + format!("{host_windows_sdk_ver_bin_path};{x86_windows_sdk_ver_bin_path}",), + ); + + let wdk_tool_root = wdk_content_root + .join(format!("Tools/{version}")) + .canonicalize()? + .strip_extended_length_path_prefix()?; + let arch_specific_wdk_tool_root = wdk_tool_root + .join(host_arch.as_windows_str()) + .canonicalize()? + .strip_extended_length_path_prefix()?; + prepend_to_semicolon_delimited_env_var( + PATH_ENV_VAR, + arch_specific_wdk_tool_root + .to_str() + .expect("arch_specific_wdk_tool_root should only contain valid UTF8"), + ); + + forward_env_var_to_cargo_make(PATH_ENV_VAR); + Ok(()) +} + +fn append_to_space_delimited_env_var(env_var_name: S, string_to_append: T) +where + S: AsRef, + T: AsRef, +{ let env_var_name = env_var_name.as_ref(); let string_to_append = string_to_append.as_ref(); @@ -399,6 +492,20 @@ fn append_to_space_delimited_env_var>(env_var_name: S, string_to_a std::env::set_var(env_var_name, env_var_value.trim()); } +fn prepend_to_semicolon_delimited_env_var(env_var_name: S, string_to_prepend: T) +where + S: AsRef, + T: AsRef, +{ + let env_var_name = env_var_name.as_ref(); + let string_to_prepend = string_to_prepend.as_ref(); + + let mut env_var_value = string_to_prepend.to_string(); + env_var_value.push(';'); + env_var_value.push_str(std::env::var(env_var_name).unwrap_or_default().as_str()); + std::env::set_var(env_var_name, env_var_value); +} + fn forward_env_var_to_cargo_make>(env_var_name: S) { let env_var_name = env_var_name.as_ref(); diff --git a/crates/wdk-build/src/lib.rs b/crates/wdk-build/src/lib.rs index c355259d..47adc8f0 100644 --- a/crates/wdk-build/src/lib.rs +++ b/crates/wdk-build/src/lib.rs @@ -127,6 +127,13 @@ pub enum ConfigError { /// Error returned when a [`Config`] fails to be exported to the environment #[error(transparent)] ExportError(#[from] ExportError), + + /// Error returned when a [`Config`] fails to be serialized + #[error( + "WDKContentRoot should be able to be detected. Ensure that the WDK is installed, or that \ + the environment setup scripts in the eWDK have been run." + )] + WDKContentRootDetectionError, } /// Errors that could result from parsing a configuration from a [`wdk-build`] @@ -398,10 +405,10 @@ impl Config { .join(sdk_version) .join(match self.driver_config { DriverConfig::WDM() | DriverConfig::KMDF(_) => { - format!("km/{}", self.cpu_architecture.to_windows_str(),) + format!("km/{}", self.cpu_architecture.as_windows_str(),) } DriverConfig::UMDF(_) => { - format!("um/{}", self.cpu_architecture.to_windows_str(),) + format!("um/{}", self.cpu_architecture.as_windows_str(),) } }); if !windows_sdk_library_path.is_dir() { @@ -421,7 +428,7 @@ impl Config { DriverConfig::KMDF(kmdf_config) => { let kmdf_library_path = library_directory.join(format!( "wdf/kmdf/{}/{}.{}", - self.cpu_architecture.to_windows_str(), + self.cpu_architecture.as_windows_str(), kmdf_config.kmdf_version_major, kmdf_config.kmdf_version_minor )); @@ -439,7 +446,7 @@ impl Config { DriverConfig::UMDF(umdf_config) => { let umdf_library_path = library_directory.join(format!( "wdf/umdf/{}/{}.{}", - self.cpu_architecture.to_windows_str(), + self.cpu_architecture.as_windows_str(), umdf_config.umdf_version_major, umdf_config.umdf_version_minor )); @@ -651,12 +658,39 @@ impl CPUArchitecture { /// Converts [`CPUArchitecture`] to the string corresponding to what the /// architecture is typically referred to in Windows #[must_use] - pub const fn to_windows_str(&self) -> &str { + pub const fn as_windows_str(&self) -> &str { match self { Self::AMD64 => "x64", Self::ARM64 => "ARM64", } } + + /// Converts [`CPUArchitecture`] to the string corresponding to what the + /// architecture is typically referred to in Windows + #[deprecated( + since = "0.2.0", + note = "CPUArchitecture.to_windows_str() was mis-named when originally created, since the \ + conversion from CPUArchitecture to str is free. Use \ + CPUArchitecture.as_windows_str instead." + )] + #[must_use] + pub const fn to_windows_str(&self) -> &str { + self.as_windows_str() + } + + /// Converts from a cargo-provided [`std::str`] to a [`CPUArchitecture`]. + /// + /// # + #[must_use] + pub fn try_from_cargo_str>(cargo_str: S) -> Option { + // Specifically not using the [`std::convert::TryFrom`] trait to be more + // explicit in function name, since only arch strings from cargo are handled. + match cargo_str.as_ref() { + "x86_64" => Some(Self::AMD64), + "aarch64" => Some(Self::ARM64), + _ => None, + } + } } #[cfg(test)] @@ -819,4 +853,17 @@ mod tests { ); assert_eq!(config.cpu_architecture, CPUArchitecture::ARM64); } + + #[test] + fn test_try_from_cargo_str() { + assert_eq!( + CPUArchitecture::try_from_cargo_str("x86_64"), + Some(CPUArchitecture::AMD64) + ); + assert_eq!( + CPUArchitecture::try_from_cargo_str("aarch64"), + Some(CPUArchitecture::ARM64) + ); + assert_eq!(CPUArchitecture::try_from_cargo_str("arm"), None); + } } diff --git a/crates/wdk-build/src/utils.rs b/crates/wdk-build/src/utils.rs index b9e76ba1..2aa363a7 100644 --- a/crates/wdk-build/src/utils.rs +++ b/crates/wdk-build/src/utils.rs @@ -249,13 +249,9 @@ pub fn detect_cpu_architecture_in_build_script() -> CPUArchitecture { build.rs", ); - if target_arch == "x86_64" { - return CPUArchitecture::AMD64; - } else if target_arch == "aarch64" { - return CPUArchitecture::ARM64; - } - - panic!("The target architecture, {target_arch}, is currently not supported."); + CPUArchitecture::try_from_cargo_str(&target_arch).unwrap_or_else(|| { + panic!("The target architecture, {target_arch}, is currently not supported.") + }) } #[cfg(test)] diff --git a/rust-driver-makefile.toml b/rust-driver-makefile.toml index b8f278eb..b16c8229 100644 --- a/rust-driver-makefile.toml +++ b/rust-driver-makefile.toml @@ -1,12 +1,9 @@ # This file can be leveraged to build downstream drivers. See examples at https://github.com/microsoft/Windows-rust-drivers-samples -# FIXME: replace all script blocks with cargo-make commands: "Favor commands over scripts, as commands support more features such as automatic dependencies installation, argument functions, and more..." # FIXME: this flow is based on the signing process of a KMDF PNP driver. There should be different flows availabe for different types of drivers as outlined in https://learn.microsoft.com/en-us/windows-hardware/drivers/install/test-signing-driver-packages - [config] min_version = "0.37.3" init_task = "wdk-build-init" -default_to_workspace = false [env] # This allows all workspace members to access this makefile @@ -14,9 +11,7 @@ CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true # CARGO_MAKE_CARGO_BUILD_TEST_FLAGS is set to "--all-features" by default in cargo-make: https://github.com/sagiegurari/cargo-make/blob/c0abc4d0ae1bcc03adde22b63fa0accc4af2b3bc/src/lib/descriptor/makefiles/stable.toml#L31 # This is set to "" here to match the default behavior of Cargo. -CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = "" - -VC_BUILD_DIR = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsamd64_x86.bat" +CARGO_MAKE_CARGO_BUILD_TEST_FLAGS = { unset = true } # FIXME: add --locked for CI builds using CARGO_MAKE_PR and CARGO_MAKE_CI @@ -51,6 +46,7 @@ else writefile ${filepath} ${taskjson.script} end cli_args = array_join ${flow.cli.args} " " +# rust-script will try to consume --help, so help must be passed via TRIGGER_HELP env var in order to provide clap help output trigger_help = get_env TRIGGER_HELP if not is_empty ${trigger_help} cli_args = concat ${cli_args} " --help" @@ -87,6 +83,7 @@ script = ''' #![allow(unused_doc_comments)] wdk_build::cargo_make::validate_and_forward_args(); +wdk_build::cargo_make::setup_path()?; ''' [tasks.help] @@ -94,56 +91,221 @@ workspace = false env = { "TRIGGER_HELP" = "1" } run_task = "wdk-build-init" -[tasks.rename-dll-to-sys] +[tasks.copy-inx-to-output] +script_runner = "@rust" +script = ''' +use std::path::PathBuf; + +let crate_name = std::env::var("CARGO_MAKE_CRATE_FS_NAME").expect("CARGO_MAKE_CRATE_FS_NAME should be set by cargo-make"); +let cargo_make_working_directory = std::env::var("CARGO_MAKE_WORKING_DIRECTORY").expect("CARGO_MAKE_WORKING_DIRECTORY should be set by cargo-make via the env section of rust-driver-makefile.toml"); +let output_directory = std::env::var("OUTPUT_DIR").expect("OUTPUT_DIR should be set by cargo-make via the env section of rust-driver-makefile.toml"); + +let output_folder_path = PathBuf::from(&output_directory); +if !output_folder_path.exists() { + std::fs::create_dir_all(&output_folder_path).expect(&format!("creation of '{}' folder should succeed", output_folder_path.display())); +} + +let source_file = format!("{cargo_make_working_directory}/{crate_name}.inx"); +let destination_file = format!("{output_directory}/{crate_name}.inf"); +std::fs::copy(&source_file, &destination_file).expect(&format!("copy of '{source_file}' file to '{destination_file}' file should succeed")); +''' + +[tasks.generate-sys-file] dependencies = ["build"] +script_runner = "@rust" script = ''' -echo "%OUTPUT_DIR%" -cd "%OUTPUT_DIR%" -mkdir package -if exist package\%CARGO_MAKE_CRATE_FS_NAME%.sys ( - del package\%CARGO_MAKE_CRATE_FS_NAME%.sys -) -rename %CARGO_MAKE_CRATE_FS_NAME%.dll %CARGO_MAKE_CRATE_FS_NAME%.sys -copy %CARGO_MAKE_CRATE_FS_NAME%.sys package\%CARGO_MAKE_CRATE_FS_NAME%.sys +let crate_name = std::env::var("CARGO_MAKE_CRATE_FS_NAME").expect("CARGO_MAKE_CRATE_FS_NAME should be set by cargo-make"); +let output_directory = std::env::var("OUTPUT_DIR").expect("OUTPUT_DIR should be set by cargo-make via the env section of rust-driver-makefile.toml"); + +let source_file = format!("{output_directory}/{crate_name}.dll"); +let destination_file = format!("{output_directory}/{crate_name}.sys"); +std::fs::copy(&source_file, &destination_file).expect(&format!("copy of '{source_file}' file to '{destination_file}' file should succeed")); ''' [tasks.stampinf] -dependencies = ["build"] +dependencies = ["copy-inx-to-output"] +command = "stampinf" +args = [ + "-f", + "${OUTPUT_DIR}/${CARGO_MAKE_CRATE_FS_NAME}.inf", + "-d", + "*", + "-a", + "amd64", + "-c", + "${CARGO_MAKE_CRATE_FS_NAME}.cat", + "-v", + "*", + "-k", + "1.33", +] + +[tasks.infverif] +dependencies = ["stampinf"] +command = "infverif" +args = [ + "/v", + "/w", + "@@split(WDK_BUILD_ADDITIONAL_INFVERIF_FLAGS, )", + "${OUTPUT_DIR}/${CARGO_MAKE_CRATE_FS_NAME}.inf", +] + +[tasks.copy-sys-to-package] +dependencies = ["generate-sys-file"] +script_runner = "@rust" script = ''' -copy "%CARGO_MAKE_WORKING_DIRECTORY%\%CARGO_MAKE_CRATE_FS_NAME%.inx" "%OUTPUT_DIR%\package\%CARGO_MAKE_CRATE_FS_NAME%.inf" -stampinf.exe -f "%OUTPUT_DIR%\package\%CARGO_MAKE_CRATE_FS_NAME%.inf" -d * -a amd64 -c %CARGO_MAKE_CRATE_FS_NAME%.cat -v * -k 1.33 -n +use std::path::PathBuf; + +let crate_name = std::env::var("CARGO_MAKE_CRATE_FS_NAME").expect("CARGO_MAKE_CRATE_FS_NAME should be set by cargo-make"); +let output_directory = std::env::var("OUTPUT_DIR").expect("OUTPUT_DIR should be set by cargo-make via the env section of rust-driver-makefile.toml"); + +let package_folder_path = [output_directory.as_str(), "package"].iter().collect::(); +if !package_folder_path.exists() { + std::fs::create_dir(&package_folder_path).expect(&format!("creation of '{}' folder should succeed", package_folder_path.display())); +} + +let source_file = format!("{output_directory}/{crate_name}.sys"); +let destination_file = format!("{output_directory}/package/{crate_name}.sys"); +std::fs::copy(&source_file, &destination_file).expect(&format!("copy of '{source_file}' file to '{destination_file}' file should succeed")); ''' -[tasks.copypdb] +[tasks.copy-pdb-to-package] dependencies = ["build"] +script_runner = "@rust" script = ''' -cd "%OUTPUT_DIR%" -copy %CARGO_MAKE_CRATE_FS_NAME%.pdb package\%CARGO_MAKE_CRATE_FS_NAME%.pdb +use std::path::PathBuf; + +let crate_name = std::env::var("CARGO_MAKE_CRATE_FS_NAME").expect("CARGO_MAKE_CRATE_FS_NAME should be set by cargo-make"); +let output_directory = std::env::var("OUTPUT_DIR").expect("OUTPUT_DIR should be set by cargo-make via the env section of rust-driver-makefile.toml"); + +let package_folder_path = [output_directory.as_str(), "package"].iter().collect::(); +if !package_folder_path.exists() { + std::fs::create_dir(&package_folder_path).expect(&format!("creation of '{}' folder should succeed", package_folder_path.display())); +} + +let source_file = format!("{output_directory}/{crate_name}.pdb"); +let destination_file = format!("{output_directory}/package/{crate_name}.pdb"); +std::fs::copy(&source_file, &destination_file).expect(&format!("copy of '{source_file}' file to '{destination_file}' file should succeed")); ''' -[tasks.inf2cat] +[tasks.copy-inf-to-package] dependencies = ["stampinf"] +script_runner = "@rust" script = ''' -inf2cat.exe /driver:"%OUTPUT_DIR%\package" /os:10_NI_X64,10_VB_X64 /uselocaltime /verbose +use std::path::PathBuf; + +let crate_name = std::env::var("CARGO_MAKE_CRATE_FS_NAME").expect("CARGO_MAKE_CRATE_FS_NAME should be set by cargo-make"); +let output_directory = std::env::var("OUTPUT_DIR").expect("OUTPUT_DIR should be set by cargo-make via the env section of rust-driver-makefile.toml"); + +let package_folder_path = [output_directory.as_str(), "package"].iter().collect::(); +if !package_folder_path.exists() { + std::fs::create_dir(&package_folder_path).expect(&format!("creation of '{}' folder should succeed", package_folder_path.display())); +} + +let source_file = format!("{output_directory}/{crate_name}.inf"); +let destination_file = format!("{output_directory}/package/{crate_name}.inf"); +std::fs::copy(&source_file, &destination_file).expect(&format!("copy of '{source_file}' file to '{destination_file}' file should succeed")); ''' -[tasks.infverif] -dependencies = ["stampinf"] +[tasks.copy-map-to-package] +dependencies = ["build"] +script_runner = "@rust" script = ''' -"%WDKToolRoot%\%Platform%\infverif.exe" /v /w "%OUTPUT_DIR%\package\%CARGO_MAKE_CRATE_FS_NAME%.inf" /msft +use std::path::PathBuf; + +let crate_name = std::env::var("CARGO_MAKE_CRATE_FS_NAME").expect("CARGO_MAKE_CRATE_FS_NAME should be set by cargo-make"); +let output_directory = std::env::var("OUTPUT_DIR").expect("OUTPUT_DIR should be set by cargo-make via the env section of rust-driver-makefile.toml"); + +let package_folder_path = [output_directory.as_str(), "package"].iter().collect::(); +if !package_folder_path.exists() { + std::fs::create_dir(&package_folder_path).expect(&format!("creation of '{}' folder should succeed", package_folder_path.display())); +} + +let source_file = format!("{output_directory}/deps/{crate_name}.map"); +let destination_file = format!("{output_directory}/package/{crate_name}.map"); +std::fs::copy(&source_file, &destination_file).expect(&format!("copy of '{source_file}' file to '{destination_file}' file should succeed")); ''' -[tasks.sign] -dependencies = ["rename-dll-to-sys", "inf2cat", "infverif"] +[tasks.inf2cat] +dependencies = ["copy-sys-to-package", "copy-inf-to-package"] +command = "inf2cat" +args = [ + "/driver:${OUTPUT_DIR}/package", + "/os:10_NI_X64,10_VB_X64", # TODO: this should be a parameter + "/uselocaltime", +] + +[tasks.generate-certificate-if-needed] +# This script can't be in a `condition_script` block because of https://github.com/sagiegurari/cargo-make/issues/987 +script_runner = "@duckscript" script = ''' -call "%VC_BUILD_DIR%" -if not exist DriverCertificate.cer ( - makecert -r -pe -ss PrivateCertStore -n CN=DriverCertificate DriverCertificate.cer -) else ( - echo Certificate already exists. -) -signtool sign /a /v /s PrivateCertStore /n DriverCertificate /fd certHash /t http://timestamp.digicert.com "%OUTPUT_DIR%\package\%CARGO_MAKE_CRATE_FS_NAME%.cat" +out = exec certmgr.exe -put -s WDRTestCertStore -c -n WDRLocalTestCert ${OUTPUT_DIR}/WDRLocalTestCert.cer +if not eq ${out.code} 0 + echo WDRLocalTestCert not found in WDRTestCertStore. Generating new certificate. + cm_run_task generate-certificate +end ''' +[tasks.generate-certificate] +private = true +command = "makecert" +args = [ + "-r", + "-pe", + "-ss", + "WDRTestCertStore", # TODO: this should be a parameter + "-n", + "CN=WDRLocalTestCert", # TODO: this should be a parameter + "${OUTPUT_DIR}/WDRLocalTestCert.cer", +] + +[tasks.copy-certificate-to-package] +dependencies = ["generate-certificate-if-needed"] +script_runner = "@rust" +script = ''' +use std::path::PathBuf; + +let output_directory = std::env::var("OUTPUT_DIR").expect("OUTPUT_DIR should be set by cargo-make via the env section of rust-driver-makefile.toml"); + +let package_folder_path = [output_directory.as_str(), "package"].iter().collect::(); +if !package_folder_path.exists() { + std::fs::create_dir(&package_folder_path).expect(&format!("creation of '{}' folder should succeed", package_folder_path.display())); +} + +let source_file = format!("{output_directory}/WDRLocalTestCert.cer"); +let destination_file = format!("{output_directory}/package/WDRLocalTestCert.cer"); +std::fs::copy(&source_file, &destination_file).expect(&format!("copy of '{source_file}' file to '{destination_file}' file should succeed")); +''' + +[tasks.signtool] +dependencies = ["inf2cat", "generate-certificate-if-needed"] +command = "signtool" +args = [ + "sign", + "/v", + "/s", + "WDRTestCertStore", # TODO: this should be a parameter + "/n", + "WDRLocalTestCert", # TODO: this should be a parameter + "/t", + "http://timestamp.digicert.com", + "/fd", + "sha256", + "${OUTPUT_DIR}/package/${CARGO_MAKE_CRATE_FS_NAME}.cat", +] + +[tasks.package-driver] +dependencies = [ + "copy-sys-to-package", + "copy-pdb-to-package", + "copy-inf-to-package", + "copy-map-to-package", + "copy-certificate-to-package", + "signtool", + "infverif", +] + [tasks.default] -alias = "sign" +alias = "package-driver" + +# TODO: mark drivers