Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix various pipeline breakages (nightly rustfmt bug, new nightly clippy lints, upstream winget dependency issue) #117

Merged
merged 5 commits into from
Mar 5, 2024
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
6 changes: 3 additions & 3 deletions .github/actions/winget-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ runs:
shell: pwsh
run: |
New-Item -Type Directory $env:RUNNER_TEMP/winget-install
Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.7.3/Microsoft.UI.Xaml.2.7.x64.appx -OutFile $env:RUNNER_TEMP/winget-install/Microsoft.UI.Xaml.2.7.x64.appx
Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri https://github.com/microsoft/microsoft-ui-xaml/releases/download/v2.8.6/Microsoft.UI.Xaml.2.8.x64.appx -OutFile $env:RUNNER_TEMP/winget-install/Microsoft.UI.Xaml.2.8.x64.appx
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -OutFile $env:RUNNER_TEMP/winget-install/Microsoft.VCLibs.x64.14.00.Desktop.appx # Needed per https://github.com/microsoft/winget-cli/blob/21de1607ed5c90174e6bb931406975c18681a5dd/README.md?plain=1#L35C19-L35C19
Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri $env:LatestWingetDownloadUri -OutFile $env:RUNNER_TEMP/winget-install/winget.msixbundle
Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri $env:LatestWingetLicenseDownloadUri -OutFile $env:RUNNER_TEMP/winget-install/license.xml
- name: Start Winget Installation
shell: pwsh
run: |
Add-AppxProvisionedPackage -Online -PackagePath $env:RUNNER_TEMP/winget-install/winget.msixbundle -LicensePath $env:RUNNER_TEMP/winget-install/license.xml -DependencyPackagePath $env:RUNNER_TEMP/winget-install/Microsoft.UI.Xaml.2.7.x64.appx, $env:RUNNER_TEMP/winget-install/Microsoft.VCLibs.x64.14.00.Desktop.appx
Add-AppxProvisionedPackage -Online -PackagePath $env:RUNNER_TEMP/winget-install/winget.msixbundle -LicensePath $env:RUNNER_TEMP/winget-install/license.xml -DependencyPackagePath $env:RUNNER_TEMP/winget-install/Microsoft.UI.Xaml.2.8.x64.appx, $env:RUNNER_TEMP/winget-install/Microsoft.VCLibs.x64.14.00.Desktop.appx
- name: Wait for Completion of Winget Installation
shell: pwsh
run: |
while ((Get-Command * | Select-String winget).ToString() -ne "winget.exe") {
while ((Get-Command * | Select-String winget)?.ToString() -ne "winget.exe") {
Start-Sleep -Seconds 1
}
Write-Output "Winget Version: $(winget --version)"
6 changes: 4 additions & 2 deletions .github/workflows/code-formatting-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ jobs:
uses: actions/checkout@v4

- name: Install Rust Toolchain (Nightly)
uses: dtolnay/rust-toolchain@nightly
# Need to temporarily pin nightly used for fmt because of upstream bug: https://github.com/rust-lang/rustfmt/issues/6082, https://github.com/rust-lang/rustfmt/issues/6099
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-02-17
components: rustfmt

- name: Run Cargo Format
run: cargo +nightly fmt --all -- --check
run: cargo +nightly-2024-02-17 fmt --all -- --check

taplo-fmt:
name: .toml Formatting Check
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ When executing the default task, just `cargo make` make also works since the `de

### Argument Forwarding

`windows-drivers-rs` extends `cargo make` to forward specific arguements to the underlying `cargo` commands. In order to specify arguments to forward, they must be provided **after explicitly specifying the `cargo-make` task name** (ie. omitting the name for the `default` task is not supported).
`windows-drivers-rs` extends `cargo make` to forward specific arguments to the underlying `cargo` commands. In order to specify arguments to forward, they must be provided **after explicitly specifying the `cargo-make` task name** (ie. omitting the name for the `default` task is not supported).

#### Examples

Expand Down
2 changes: 1 addition & 1 deletion crates/wdk-build/rust-driver-makefile.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file can be leveraged to build downstream drivers. See examples at https://github.com/microsoft/Windows-rust-drivers-samples

# 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
# FIXME: this flow is based on the signing process of a KMDF PNP driver. There should be different flows available 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.8"
init_task = "wdk-build-init"
Expand Down
2 changes: 1 addition & 1 deletion crates/wdk-build/src/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl BuilderExt for Builder {
// -WDeprecated warning
.clang_arg("--warn-=no-deprecated-declarations")
// Windows SDK & DDK contain unnecessary token pasting (ex. &##_variable: `&` and
// `_variable` are seperate tokens already, and don't need `##` to concatenate them)
// `_variable` are separate tokens already, and don't need `##` to concatenate them)
.clang_arg("--warn-=no-invalid-token-paste")
.clang_arg("-fms-extensions")
.blocklist_item("ExAllocatePoolWithTag") // Deprecated
Expand Down
2 changes: 1 addition & 1 deletion crates/wdk-build/src/cargo_make.rs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ where
fn forward_env_var_to_cargo_make<S: AsRef<str>>(env_var_name: S) {
let env_var_name = env_var_name.as_ref();

// Since this executes in a child proccess to cargo-make, we need to forward the
// Since this executes in a child process to cargo-make, we need to forward the
// values we want to change to duckscript, in order to get it to modify the
// parent process (ie. cargo-make)
if let Some(env_var_value) = std::env::var_os(env_var_name) {
Expand Down
12 changes: 6 additions & 6 deletions crates/wdk-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! configure any build that depends on the WDK (Windows Driver Kit). This is
//! especially useful for crates that generate FFI bindings to the WDK,
//! WDK-dependent libraries, and programs built on top of the WDK (ex. Drivers).
//! This library is built to be able to accomodate different WDK releases, as
//! This library is built to be able to accommodate different WDK releases, as
//! well strives to allow for all the configuration the WDK allows. This
//! includes being ables to select different WDF versions and different driver
//! models (WDM, KMDF, UMDF).
Expand Down Expand Up @@ -47,8 +47,8 @@ use utils::PathExt;
/// Configuration parameters for a build dependent on the WDK
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct Config {
/// Path to root of WDK. Corresponds with WDKContentRoot environment
/// varialbe in eWDK
/// Path to root of WDK. Corresponds with `WDKContentRoot` environment
/// variable in eWDK
pub wdk_content_root: PathBuf,
/// Build configuration of driver
pub driver_config: DriverConfig,
Expand Down Expand Up @@ -108,7 +108,7 @@ pub struct UMDFConfig {
/// Errors that could result from configuring a build via [`wdk-build`]
#[derive(Debug, Error)]
pub enum ConfigError {
/// Error returned when an std::io operation fails
/// Error returned when an [`std::io`] operation fails
#[error(transparent)]
IoError(#[from] std::io::Error),

Expand Down Expand Up @@ -139,7 +139,7 @@ pub enum ConfigError {
)]
WDKContentRootDetectionError,

/// Error returned when cargo_metadata execution or parsing fails
/// Error returned when `cargo_metadata` execution or parsing fails
#[error(transparent)]
CargoMetadataError(#[from] cargo_metadata::Error),

Expand Down Expand Up @@ -198,7 +198,7 @@ pub enum ExportError {
/// Error returned when the crate being compiled does not have a `links`
/// value in its Cargo.toml
#[error(
"Missing `links` value in crate's config.toml. Metadata is unable to propogate to \
"Missing `links` value in crate's config.toml. Metadata is unable to propagate to \
dependencies without a `links` value"
)]
MissingLinksValue(#[from] std::env::VarError),
Expand Down
2 changes: 0 additions & 2 deletions crates/wdk-build/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,6 @@ pub fn detect_cpu_architecture_in_build_script() -> CPUArchitecture {

#[cfg(test)]
mod tests {
use std::path::PathBuf;

use windows::Win32::UI::Shell::{FOLDERID_ProgramFiles, SHGetKnownFolderPath, KF_FLAG_DEFAULT};

use super::*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub extern "system" fn driver_entry(
WdfDriverCreate,
driver as PDRIVER_OBJECT,
registry_path,
// The order of the next two arguements is swapped!
// The order of the next two arguments is swapped!
&mut driver_config,
WDF_NO_OBJECT_ATTRIBUTES,
driver_handle_output,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ error[E0308]: arguments to this function are incorrect
| | WdfDriverCreate,
| | driver as PDRIVER_OBJECT,
| | registry_path,
| | // The order of the next two arguements is swapped!
| | // The order of the next two arguments is swapped!
| | &mut driver_config,
| | ------------------ expected `*mut _WDF_OBJECT_ATTRIBUTES`, found `&mut _WDF_DRIVER_CONFIG`
| | WDF_NO_OBJECT_ATTRIBUTES,
Expand All @@ -21,7 +21,7 @@ help: swap these arguments
29 + WdfDriverCreate,
30 + driver as PDRIVER_OBJECT,
31 + registry_path,
32 + // The order of the next two arguements is swapped!
32 + // The order of the next two arguments is swapped!
33 + &mut driver_config,
34 + WDF_NO_OBJECT_ATTRIBUTES,
35 + driver_handle_output,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub extern "system" fn driver_entry(
WdfDriverCreate,
driver as PDRIVER_OBJECT,
registry_path,
// The order of the next two arguements is swapped!
// The order of the next two arguments is swapped!
&mut driver_config,
WDF_NO_OBJECT_ATTRIBUTES,
driver_handle_output,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ error[E0308]: arguments to this function are incorrect
| | WdfDriverCreate,
| | driver as PDRIVER_OBJECT,
| | registry_path,
| | // The order of the next two arguements is swapped!
| | // The order of the next two arguments is swapped!
| | &mut driver_config,
| | ------------------ expected `*mut _WDF_OBJECT_ATTRIBUTES`, found `&mut _WDF_DRIVER_CONFIG`
| | WDF_NO_OBJECT_ATTRIBUTES,
Expand All @@ -21,7 +21,7 @@ help: swap these arguments
28 + WdfDriverCreate,
29 + driver as PDRIVER_OBJECT,
30 + registry_path,
31 + // The order of the next two arguements is swapped!
31 + // The order of the next two arguments is swapped!
32 + &mut driver_config,
33 + WDF_NO_OBJECT_ATTRIBUTES,
34 + driver_handle_output,
Expand Down
2 changes: 1 addition & 1 deletion crates/wdk-sys/src/test_stubs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License: MIT OR Apache-2.0

//! Any library dependency that depends on `wdk-sys` requires these stubs to
//! provide symobols to sucessfully compile and run tests. They can be brought
//! provide symobols to successfully compile and run tests. They can be brought
//! into scope by introducing `wdk-sys` with the `test-stubs` feature in the
//! `dev-dependencies` of the crate's `Cargo.toml`

Expand Down
Loading