Skip to content

Conversation

@wmmc88
Copy link
Collaborator

@wmmc88 wmmc88 commented Sep 23, 2025

This pull request introduces improved error handling and context for file system operations in the wdk-build crate, refactors path validation logic for include and library directories, and updates the CI workflow to lint example projects using Cargo Make. The most important changes are grouped below:

Error Handling Improvements

  • Introduced new types IoError and IoErrorMetadata to wrap std::io::Error with additional context about the file system paths involved in I/O failures, and updated ConfigError to use these types for better diagnostics. [1] [2]
  • Refactored file system operations throughout crates/wdk-build/src/cargo_make.rs and related code to use the new error types, providing richer error information for failures in directory creation, file copying, symlink creation, and path canonicalization. [1] [2] [3] [4] [5]

Path Validation Refactoring

  • Consolidated directory existence and canonicalization logic into a new helper method validate_and_add_include_path, reducing code duplication and ensuring consistent error reporting for include and library paths in the Config struct. [1] [2] [3] [4] [5]

CI Workflow Enhancement

  • Updated .github/workflows/lint.yaml to install Cargo Make and add a linting step for example projects using cargo make clippy, ensuring that example code is checked for lint issues in CI.

Minor Codebase Improvements

  • Updated imports in crates/wdk-build/src/lib.rs to include new types and paths required for enhanced error handling.
  • Simplified error propagation for header file lookup by removing unnecessary error mapping in ucx_header.

Copilot AI review requested due to automatic review settings September 23, 2025 05:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces improved error handling for file system operations and enforces clippy linting on example projects in CI. The changes focus on providing better error context for I/O failures and ensuring code quality consistency across the codebase.

  • Introduces new IoError and IoErrorMetadata types to wrap std::io::Error with additional file path context
  • Refactors file system operations throughout the codebase to use enhanced error handling
  • Updates CI workflow to lint example projects using Cargo Make

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
examples/sample-wdm-driver/src/lib.rs Updates imports and improves memory safety with &raw mut syntax
examples/sample-umdf-driver/src/lib.rs Uses &raw mut syntax and simplifies size calculation
examples/sample-kmdf-driver/src/lib.rs Uses &raw mut syntax and simplifies size calculation
crates/wdk-sys/build.rs Adds feature-gated compilation and enhanced I/O error handling
crates/wdk-build/src/utils.rs Updates error handling to use new IoError types
crates/wdk-build/src/lib.rs Introduces new error types and refactors path validation logic
crates/wdk-build/src/cargo_make.rs Enhances file operations with better error context
.github/workflows/lint.yaml Adds Cargo Make installation and example project linting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Melvin Wang <[email protected]>
Copilot AI review requested due to automatic review settings September 23, 2025 19:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@wmmc88
Copy link
Collaborator Author

wmmc88 commented Sep 23, 2025

blocked on #480

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant