Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
6a160e2
Refactor target architecture handling and command execution
svasista-ms Sep 2, 2025
a5c6f70
fix: skip packaging if target kind is not cdylib
svasista-ms Sep 4, 2025
0da33be
Merge branch 'main' into support-target-overrides
svasista-ms Sep 8, 2025
778939a
Merge remote-tracking branch 'origin/main' into support-target-overri…
svasista-ms Sep 25, 2025
1fc4ff6
- Added `resolve_final_artifacts_root` method to determine the archit…
svasista-ms Sep 29, 2025
61b1f5d
Merge branch 'main' into support-target-overrides
svasista-ms Sep 29, 2025
b980aa9
fix: update test workflow and test assertions.
svasista-ms Sep 29, 2025
20e207d
Refactor BuildAction to handle target_arch cases and improve packagin…
svasista-ms Oct 7, 2025
32dfb50
fix typos
svasista-ms Oct 9, 2025
09170ba
address Copilot's comments
svasista-ms Oct 10, 2025
1d804c0
Merge main into support-target-overrides:
svasista-ms Oct 13, 2025
2e0f588
check if the order of targets matters for the default target selection.
svasista-ms Oct 16, 2025
1f9d721
fix expect in build_command_test
svasista-ms Oct 16, 2025
ca4391f
fix lock scope in build_command_test
svasista-ms Oct 16, 2025
238c3c0
fix clippy issues
svasista-ms Oct 16, 2025
31e25ee
fix tests
svasista-ms Oct 17, 2025
065de7d
refactor: improve file locking mechanism and error handling in test u…
svasista-ms Oct 18, 2025
cdcb8c7
fix: locating Windows SDK packages in install-wdk action
svasista-ms Oct 18, 2025
4d261ef
fix: update SDK package version variable in WDK installation action
svasista-ms Oct 18, 2025
5cef038
fix: use input version for SDK package display name and version in WD…
svasista-ms Oct 18, 2025
dd23931
fix: add CARGO_WDK_NUGET_PACKAGE_ROOT environment variable to WDK con…
svasista-ms Oct 19, 2025
7eebd31
fix: update architecture descriptions and output variable names in WD…
svasista-ms Oct 20, 2025
db07ad8
Merge branch 'main' into support-target-overrides
svasista-ms Oct 21, 2025
2e85f00
fix: install-wdk action outputs and build_command_test
svasista-ms Oct 21, 2025
e3ed601
fix: correct environment variable name for NuGet package root in buil…
svasista-ms Oct 21, 2025
c6d8156
fix clippy issues
svasista-ms Oct 21, 2025
6e24606
fix: clippy issues in the newly added test code
svasista-ms Oct 22, 2025
f037f52
fix: enabled other workflows and testing with configure-wdk.env action
svasista-ms Oct 22, 2025
a4128bb
fix: update WDK environment configuration by removing sdk-version-num…
svasista-ms Oct 22, 2025
2f16baf
fix: remove sdk-version-number output from WDK installation action an…
svasista-ms Oct 22, 2025
7d7c38d
fix: update architecture handling and improve WDK installation process
svasista-ms Oct 22, 2025
d65d3a3
fix: append '.0' to version number in WDK environment configuration
svasista-ms Oct 22, 2025
203ac0a
fix: add targets for Rust toolchain installation in test workflow
svasista-ms Oct 22, 2025
45243e1
address Copilot's comments
svasista-ms Oct 23, 2025
1049978
fix `expect_detect_wdk_build_number` in tests and change error types …
svasista-ms Oct 23, 2025
1ae3cf9
- Refactored `BuildTask::run` and `BuildAction::build_and_package` me…
svasista-ms Oct 26, 2025
4588739
Refactor WDK environment configuration in GitHub workflows
svasista-ms Oct 29, 2025
d7a355e
fix: newline at end of file in test workflow
svasista-ms Oct 29, 2025
f8a00e4
fix: update error handling for host and target architecture inputs in…
svasista-ms Oct 30, 2025
26dc5bf
fix: package type descriptions in install-wdk action
svasista-ms Oct 30, 2025
fb334d7
fix: remove panic in FileLockGuard drop impl
svasista-ms Oct 30, 2025
cf55edc
fix: parser error in install-wdk action
svasista-ms Oct 30, 2025
af54c7f
fix: remove explicit call to FileLockGuard drop
svasista-ms Nov 1, 2025
70fa3e8
fix typo
svasista-ms Nov 1, 2025
2d1d773
fix parser error in install-wdk action
svasista-ms Nov 1, 2025
8ef4fed
fix: make target input required for WDK installation
svasista-ms Nov 1, 2025
d155b98
fix: install-wdk action and build_command_test
svasista-ms Nov 1, 2025
8736eb4
remove print statements in tests
svasista-ms Nov 1, 2025
2c1d3f4
fix: install all supported targets in install Rust toolchain step in …
svasista-ms Nov 1, 2025
063d26d
fix: wdk-macros-tests Cargo.toml and Cargo.lock files
svasista-ms Nov 2, 2025
b01f75d
revert changes in `BuildAction` `run_from_workspace_root`
svasista-ms Nov 2, 2025
84052a8
revert changes in `install-wdk` action
svasista-ms Nov 2, 2025
7a4a83a
fix: use `CrateType` and `TargetKind` for cdylib detection in BuildAc…
svasista-ms Nov 2, 2025
850ffb4
fix Cargo.lock file
svasista-ms Nov 2, 2025
6f4282a
revert changes not related to this PR
svasista-ms Nov 3, 2025
2d9f765
revert unrelated changes in install-wdk-action
svasista-ms Nov 3, 2025
2c842f1
remove unrelated tests
svasista-ms Nov 3, 2025
6e1586b
fix: update documentation for `run` method to clarify return type
svasista-ms Nov 3, 2025
5fc0d81
Merge branch 'main' into support-target-overrides
svasista-ms Nov 4, 2025
e8614ee
revert variable name change: $fullVersionNumber back to $version
svasista-ms Nov 4, 2025
fbacce6
revert variable name change: $fullVersionNumber back to $version
svasista-ms Nov 4, 2025
58c358f
revert $nugetPackagesRoot variable back to $packages for a cleaner diff
svasista-ms Nov 4, 2025
2d49301
Remove unnecessary 'id' field from Install WDK step in multiple workf…
svasista-ms Nov 4, 2025
50eab42
address comments
svasista-ms Nov 4, 2025
a22658b
revert changes in workflows
svasista-ms Nov 4, 2025
139a290
revert additional changes in `BuildAction` tests and `install-wdk` ac…
svasista-ms Nov 5, 2025
abe37ea
fix logging statements in `BuildTask::run`
svasista-ms Nov 5, 2025
9f5440b
remove unnecessary changes in `BuildAction` tests
svasista-ms Nov 5, 2025
2e358ce
fix documentation and revert changes in `BuildTask::run` method
svasista-ms Nov 5, 2025
286f611
revert `PATH` env setup change
svasista-ms Nov 5, 2025
a973e24
fix `get_target_dir_for_packaging` comment
svasista-ms Nov 5, 2025
4f8fd1f
fix `BuildAction::run()` documentation
svasista-ms Nov 5, 2025
3eafc0e
revert changes in log statements in `build_and_package`
svasista-ms Nov 6, 2025
3c7d046
test: packaging should fail when target arch is not provided and prob…
svasista-ms Nov 6, 2025
e20b7f7
fix `probe_target_arch_from_cargo_rustc` documentation
svasista-ms Nov 6, 2025
a9c7837
fix typo in `probe_target_arch_from_cargo_rustc` documentation
svasista-ms Nov 6, 2025
4effd32
fix: hardcode profile and target triple in `run_invokes_cargo_build_w…
svasista-ms Nov 10, 2025
1a1f9b7
Merge branch 'main' into support-target-overrides
svasista-ms Nov 17, 2025
c4d3a8b
fix: update WDKBinRoot and WDKToolRoot paths to include SDK version
svasista-ms Nov 17, 2025
476556f
fix: update `kmdf-driver-with-target-override` test fixture's Cargo.lock
svasista-ms Nov 17, 2025
193add3
address review comments
svasista-ms Nov 17, 2025
40612d5
Merge branch 'main' into support-target-overrides.
svasista-ms Nov 26, 2025
6f0741f
Revert "Merge branch 'main' into support-target-overrides."
svasista-ms Dec 4, 2025
f645238
Merge branch 'main' into support-target-overrides
svasista-ms Dec 4, 2025
feb2f51
update Cargo.lock
svasista-ms Dec 4, 2025
d8424cb
fix files affected because of merge conflicts
svasista-ms Dec 4, 2025
3af0692
fix files affected because of merge conflicts
svasista-ms Dec 4, 2025
69e661e
fix `BuildAction` tests
svasista-ms Dec 5, 2025
70fcc29
fix issue in `PackageTaskError`, corrected the order in which error v…
svasista-ms Dec 5, 2025
4f7332a
address comments
svasista-ms Dec 8, 2025
59832bb
fix tests
svasista-ms Dec 8, 2025
7dceec0
refactor build command tests to simplify environment variable handling
svasista-ms Dec 23, 2025
c2b9741
fix: update package directory name formatting in NuGet content root f…
svasista-ms Dec 24, 2025
6131ea3
refactor: disable rust-analyzer on cargo-wdk test fixtures
svasista-ms Dec 24, 2025
f55fee8
Merge branch 'main' into support-target-overrides
svasista-ms Dec 29, 2025
aa47db1
refactor: rename test for clarity on target override precedence and a…
svasista-ms Dec 29, 2025
cf1e0da
refactor: simplify WDK content root retrieval from NuGet packages
svasista-ms Dec 29, 2025
f1ce41c
address review comments
svasista-ms Dec 29, 2025
b092fcc
Merge branch 'main' into support-target-overrides
svasista-ms Jan 3, 2026
4919e99
address comments
svasista-ms Jan 5, 2026
42352a6
test: add additional tests to increase coverage of `BuildAction::get_…
svasista-ms Jan 5, 2026
5d52958
address review comments
svasista-ms Jan 6, 2026
9203c82
fix(ci): update package directory variable in install-wdk action
svasista-ms Jan 8, 2026
ce754a5
address review comments
svasista-ms Jan 9, 2026
47c1457
refactor: move project_path position in `clean_build_and_verify_project`
svasista-ms Jan 15, 2026
b62c701
revert changes under `rust-analyzer.linkedProjects`
svasista-ms Jan 20, 2026
dce7bc2
refactor test names
svasista-ms Jan 20, 2026
e7d0148
refactor build action tests
svasista-ms Jan 20, 2026
16056c4
remove unnecessary comments in install-wdk action
svasista-ms Jan 20, 2026
2ce4f10
Merge branch 'microsoft:main' into support-target-overrides
svasista-ms Jan 27, 2026
bbb35da
refactor: improve whitespace handling in `get_target_arch_from_cargo_…
svasista-ms Jan 27, 2026
06022bc
Merge branch 'microsoft:main' into support-target-overrides
svasista-ms Jan 30, 2026
8549d4e
refactor: reorganize target override tests
svasista-ms Jan 29, 2026
dd69bb3
refactor: enhance cross-compilation support and environment variable …
svasista-ms Jan 30, 2026
8f73c09
fix: replace `map().unwrap_or()` with `is_some_and()` (clippy)
svasista-ms Jan 30, 2026
34c782e
fix: update target architecture from `x64` to `AMD64`
svasista-ms Feb 2, 2026
c7c1086
fix: normalize target architecture for NuGet WDK package folder names…
svasista-ms Feb 2, 2026
0f2433e
fix: ensure target directory is absolute in get_target_dir_from_outpu…
svasista-ms Feb 2, 2026
014fa50
fix: correct typo in documentation
svasista-ms Feb 2, 2026
0a119f7
fix: update target architecture string for ARM64 in nuget_wdk_content…
svasista-ms Feb 2, 2026
bdec8e3
fix: refactor target architecture parsing in get_target_arch_from_car…
svasista-ms Feb 2, 2026
c6d39d4
fix: clarify normalization logic for NuGet WDK package folder names i…
svasista-ms Feb 2, 2026
e7e5d58
fix: add newline at end of settings.json file
svasista-ms Feb 2, 2026
13d0785
fix: use strip_prefix in get_target_arch_from_cargo_rustc function to…
svasista-ms Feb 3, 2026
5210f70
fix: use strip_prefix in get_target_arch_from_cargo_rustc function to…
svasista-ms Feb 3, 2026
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
24 changes: 9 additions & 15 deletions .github/actions/install-wdk/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,26 +139,18 @@ runs:
Write-Host "Using specified version: $version"
}

$packages = "C:\packages"

# Install WDK packages for both host and target architectures
# Host architecture needed for build tools and binaries
# Target architecture needed for content (libraries, headers)
$hostWdkPackage = "Microsoft.Windows.WDK.$hostArch"
$targetWdkPackage = "Microsoft.Windows.WDK.$targetArch"

# Determine packages to install (avoid duplicates if host == target)
$packagesToInstall = @($hostWdkPackage)
if ($targetWdkPackage -ne $hostWdkPackage) {
$packagesToInstall += $targetWdkPackage
}
$packagesRootDir = "C:\packages"

# Install WDK packages for both x64 and ARM64 architectures

$packagesToInstall = @("Microsoft.Windows.WDK.x64", "Microsoft.Windows.WDK.ARM64")

Write-Host "Installing WDK NuGet packages for version $version..."
Write-Host "Required packages: $($packagesToInstall -join ', ')"

foreach ($packageName in $packagesToInstall) {
Write-Host "Installing $packageName version $version..."
nuget install $packageName -Version $version -OutputDirectory $packages
nuget install $packageName -Version $version -OutputDirectory $packagesRootDir
if ($LASTEXITCODE -ne 0) {
throw "Failed to install $packageName version $version"
}
Expand All @@ -168,7 +160,7 @@ runs:

# Discover installed package paths in packages folder
Write-Host "Discovering installed package paths..."
$packageDirs = Get-ChildItem -Path $packages -Directory | Where-Object { $_.Name -like "Microsoft.Windows.*.$sdkVersion.*" }
$packageDirs = Get-ChildItem -Path $packagesRootDir -Directory | Where-Object { $_.Name -like "Microsoft.Windows.*.$sdkVersion.*" }
Write-Host "Found $($packageDirs.Count) package directories:"
foreach ($dir in $packageDirs) {
Write-Host " - $($dir.Name)"
Expand Down Expand Up @@ -220,6 +212,8 @@ runs:
"WDKContentRoot" = "$targetWdkPackageDir\c\"
"WDKBinRoot" = "$hostWdkPackageDir\c\bin\$sdkVersion.0"
"WDKToolRoot" = "$hostWdkPackageDir\c\tools\$sdkVersion.0"
"NugetPackagesRoot" = "$packagesRootDir"
"FullVersionNumber" = "$version"
}

# Validate paths exist before setting environment variables
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/local-development-makefile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,25 @@ jobs:
uses: dtolnay/rust-toolchain@nightly
with:
components: clippy, rustfmt
targets: |
x86_64-pc-windows-msvc
aarch64-pc-windows-msvc

- name: Install Beta Rust Toolchain
uses: dtolnay/rust-toolchain@beta
with:
components: clippy
targets: |
x86_64-pc-windows-msvc
aarch64-pc-windows-msvc

- name: Install Stable Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
targets: |
x86_64-pc-windows-msvc
aarch64-pc-windows-msvc

- name: Install Cargo Make
uses: taiki-e/install-action@v2
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust_toolchain }}
targets: |
x86_64-pc-windows-msvc
aarch64-pc-windows-msvc
components: llvm-tools-preview

- name: Install cargo-llvm-cov
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"./crates/cargo-wdk/tests/mixed-package-kmdf-workspace/Cargo.toml",
"./crates/cargo-wdk/tests/umdf-driver/Cargo.toml",
"./crates/cargo-wdk/tests/wdm-driver/Cargo.toml",
"./crates/cargo-wdk/tests/kmdf-driver-with-target-override/Cargo.toml",
"./examples/sample-kmdf-driver/Cargo.toml",
"./examples/sample-umdf-driver/Cargo.toml",
"./examples/sample-wdm-driver/Cargo.toml",
Expand Down
170 changes: 155 additions & 15 deletions crates/cargo-wdk/src/actions/build/build_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@
use std::path::{Path, PathBuf};

use anyhow::Result;
use cargo_metadata::Message;
use mockall_double::double;
use tracing::debug;
use wdk_build::CpuArchitecture;

#[double]
use crate::providers::exec::CommandExec;
use crate::{
actions::{Profile, TargetArch, build::error::BuildTaskError, to_target_triple},
actions::{Profile, build::error::BuildTaskError, to_target_triple},
trace,
};

/// Builds specified package by running `cargo build`
pub struct BuildTask<'a> {
package_name: &'a str,
profile: Option<&'a Profile>,
target_arch: TargetArch,
target_arch: Option<CpuArchitecture>,
verbosity_level: clap_verbosity_flag::Verbosity,
manifest_path: PathBuf,
command_exec: &'a CommandExec,
Expand All @@ -49,7 +51,7 @@ impl<'a> BuildTask<'a> {
package_name: &'a str,
working_dir: &'a Path,
profile: Option<&'a Profile>,
target_arch: TargetArch,
target_arch: Option<CpuArchitecture>,
verbosity_level: clap_verbosity_flag::Verbosity,
command_exec: &'a CommandExec,
) -> Self {
Expand All @@ -69,16 +71,27 @@ impl<'a> BuildTask<'a> {
}
}

/// Entry point method to run the build task
/// Run `cargo build` with the configured options
///
/// # Returns
/// * `Result<(), BuildTaskError>` - Result indicating success or failure of
/// the build task
/// `Result<impl Iterator<Item = Result<Message, std::io::Error>>,
/// BuildTaskError>`
///
/// The returned iterator yields `Result<Message, std::io::Error>` values.
/// Consumers must handle these results while iterating, because parsing
/// errors surface lazily when the message stream is consumed.
///
/// # Errors
/// * `BuildTaskError::CargoBuild` - If there is an error running the cargo
/// build command
pub fn run(&self) -> Result<(), BuildTaskError> {
/// * `BuildTaskError::EmptyManifestPath` - If the manifest path is empty or
/// not a valid unicode
/// * `BuildTaskError::CargoBuild` - If there is an error running the `cargo
/// build` command
pub fn run(
&self,
) -> Result<impl Iterator<Item = Result<Message, std::io::Error>>, BuildTaskError> {
debug!("Running cargo build");
let mut args = vec!["build".to_string()];
args.push("--message-format=json".to_string());
args.push("-p".to_string());
args.push(self.package_name.to_string());
if let Some(path) = self.manifest_path.to_str() {
Expand All @@ -91,7 +104,7 @@ impl<'a> BuildTask<'a> {
args.push("--profile".to_string());
args.push(profile.to_string());
}
if let TargetArch::Selected(target_arch) = self.target_arch {
if let Some(target_arch) = self.target_arch {
args.push("--target".to_string());
args.push(to_target_triple(target_arch));
}
Expand All @@ -105,26 +118,37 @@ impl<'a> BuildTask<'a> {

// Run cargo build from the provided working directory so that config.toml
// is respected
self.command_exec
let output = self
.command_exec
.run("cargo", &args, None, Some(self.working_dir))?;

debug!("cargo build done");
Ok(())
Ok(Message::parse_stream(std::io::Cursor::new(output.stdout)))
}
}

#[cfg(test)]
mod tests {
use std::{
os::windows::process::ExitStatusExt,
process::{ExitStatus, Output},
};

use cargo_metadata::{BuildFinished, Message};
use wdk_build::CpuArchitecture;

use super::*;
use crate::actions::{Profile, TargetArch};
use crate::{
actions::Profile,
providers::{error::CommandError, exec::MockCommandExec},
};

#[test]
fn new_succeeds_for_valid_args() {
let working_dir = PathBuf::from("C:/absolute/path/to/working/dir");
let package_name = "test_package";
let profile = Profile::Dev;
let target_arch = TargetArch::Selected(CpuArchitecture::Amd64);
let target_arch = Some(CpuArchitecture::Amd64);
let verbosity_level = clap_verbosity_flag::Verbosity::default();
let command_exec = CommandExec::new();

Expand Down Expand Up @@ -157,7 +181,7 @@ mod tests {
let working_dir = PathBuf::from("relative/path/to/working/dir");
let package_name = "test_package";
let profile = Some(Profile::Dev);
let target_arch = TargetArch::Selected(CpuArchitecture::Amd64);
let target_arch = Some(CpuArchitecture::Arm64);
let verbosity_level = clap_verbosity_flag::Verbosity::default();
let command_exec = CommandExec::new();

Expand All @@ -170,4 +194,120 @@ mod tests {
&command_exec,
);
}

#[test]
fn run_invokes_cargo_build_with_expected_args_and_returns_output() {
let working_dir = PathBuf::from("C:/abs/driver");
let manifest_path = working_dir.join("Cargo.toml");
let manifest_path_string = manifest_path.to_string_lossy().to_string();
let profile = Profile::Release;
let target_arch = CpuArchitecture::Amd64;
let verbosity = clap_verbosity_flag::Verbosity::default();
let expected_args = vec![
"build".to_string(),
"--message-format=json".to_string(),
"-p".to_string(),
"my-driver".to_string(),
"--manifest-path".to_string(),
manifest_path_string,
"--profile".to_string(),
"release".to_string(),
"--target".to_string(),
"x86_64-pc-windows-msvc".to_string(),
];
let expected_working_dir = working_dir.clone();
let mut expected_stdout = br#"{"reason":"build-finished","success":true}"#.to_vec();
expected_stdout.push(b'\n');
let expected_stdout_for_mock = expected_stdout.clone();

let mut mock = MockCommandExec::new();
mock.expect_run()
.withf(move |command, args, _env, working_dir_opt| {
let matches_command = command == "cargo";
let matches_args = args.len() == expected_args.len()
&& args
.iter()
.zip(expected_args.iter())
.all(|(actual, expected)| actual == expected);
let working_dir = working_dir_opt
.expect("working directory must be provided when running cargo build");
let matches_working_dir = working_dir == expected_working_dir.as_path();
matches_command && matches_args && matches_working_dir
})
.return_once(move |_, _, _, _| {
Ok(Output {
status: ExitStatus::default(),
stdout: expected_stdout_for_mock,
stderr: Vec::new(),
})
});
let task = BuildTask::new(
"my-driver",
&working_dir,
Some(&profile),
Some(target_arch),
verbosity,
&mock,
);

let messages = task
.run()
.expect("expected an iterator over parsed cargo message objects")
.collect::<std::result::Result<Vec<_>, _>>()
.expect("expected valid cargo messages");

assert!(
matches!(
messages.as_slice(),
[Message::BuildFinished(BuildFinished { success: true, .. })]
),
"expected one successful BuildFinished message, got: {messages:?}"
);
}

#[test]
fn run_returns_error_when_cargo_command_fails() {
let working_dir = PathBuf::from("C:/abs/driver");
let mut mock = MockCommandExec::new();
mock.expect_run().return_once(|_, _, _, _| {
let failure_output = Output {
status: ExitStatus::from_raw(1),
stdout: b"error".to_vec(),
stderr: b"failure".to_vec(),
};
Err(CommandError::from_output(
"cargo",
&["build"],
&failure_output,
))
});

let task = BuildTask::new(
"my-driver",
&working_dir,
None,
None,
clap_verbosity_flag::Verbosity::default(),
&mock,
);

let err = task.run().err().expect("expected cargo failure");
let BuildTaskError::CargoBuild(command_error) = err else {
panic!("expected cargo build error");
};
match command_error {
CommandError::CommandFailed {
command,
args,
stdout,
} => {
assert_eq!(command, "cargo");
assert_eq!(args, vec!["build".to_string()]);
assert_eq!(stdout, "error");
}
CommandError::IoError(_, _, err) => {
panic!("expected CommandFailed, got IoError: {err}")
}
}
}
}
8 changes: 6 additions & 2 deletions crates/cargo-wdk/src/actions/build/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,17 @@ pub enum BuildActionError {
OneOrMoreRustProjectsFailedToBuild(PathBuf),
#[error("One or more workspace members failed to build in the workspace: {0}")]
OneOrMoreWorkspaceMembersFailedToBuild(PathBuf),
#[error("Unsupported target arch: {0}")]
UnsupportedArchitecture(String),
#[error("Failed to detect target arch")]
CannotDetectTargetArch,
#[error("Could not determine target directory for packaging. Cause: {0}")]
CannotDetermineTargetDir(String),
}

/// Errors for the low level build task layer
#[derive(Error, Debug)]
pub enum BuildTaskError {
#[error("Error getting canonicalized path for manifest file")]
CanonicalizeManifestPath(#[from] std::io::Error),
#[error("Empty manifest path found error")]
EmptyManifestPath,
#[error("Error running cargo build command")]
Expand Down
Loading
Loading