diff --git a/.github/actions/install-winget/action.yaml b/.github/actions/install-winget/action.yaml deleted file mode 100644 index 5591288c0..000000000 --- a/.github/actions/install-winget/action.yaml +++ /dev/null @@ -1,78 +0,0 @@ -name: "Install Winget" -description: "Install winget on windows runners since its not installed by default: https://github.com/actions/runner-images/issues/6472" -inputs: - GITHUB_TOKEN: - description: "GitHub token to execute authenticated Github API requests (for higher rate limit)" - required: true -runs: - using: "composite" - steps: - - name: Get URIs for Winget v1.11.400 assets - shell: pwsh - run: | - $AuthenticatedHeaders = @{ "Authorization" = "Bearer ${{ inputs.GITHUB_TOKEN }}" } - - # Detect runner architecture - $Architecture = if ($env:RUNNER_ARCH -eq "ARM64") { "arm64" } else { "x64" } - Write-Host "Runner architecture: $Architecture" - - # winget-cli release v1.11.400 - # Define the winget-cli release tag to use - $WingetReleaseTag = "v1.11.400" - # Fetch release info by tag instead of magic number release ID - $ReleaseInfo = Invoke-RestMethod -Headers $AuthenticatedHeaders "https://api.github.com/repos/microsoft/winget-cli/releases/tags/$WingetReleaseTag" - $WingetDownloadUri = $ReleaseInfo.assets.browser_download_url | Where-Object { $_.EndsWith('.msixbundle') } - $WingetLicenseDownloadUri = $ReleaseInfo.assets.browser_download_url | Where-Object { $_.EndsWith('License1.xml') } - $WingetDependenciesZipDownloadUri = $ReleaseInfo.assets.browser_download_url | Where-Object { $_.EndsWith('DesktopAppInstaller_Dependencies.zip') } - - # Print to logs - Write-Host "WingetDownloadUri=$WingetDownloadUri" - Write-Host "WingetLicenseDownloadUri=$WingetLicenseDownloadUri" - Write-Host "WingetDependenciesZipDownloadUri=$WingetDependenciesZipDownloadUri" - - # Save output for next step - Write-Output "WingetDownloadUri=$WingetDownloadUri" >> $env:GITHUB_ENV - Write-Output "WingetLicenseDownloadUri=$WingetLicenseDownloadUri" >> $env:GITHUB_ENV - Write-Output "Architecture=$Architecture" >> $env:GITHUB_ENV - Write-Output "WingetDependenciesZipDownloadUri=$WingetDependenciesZipDownloadUri" >> $env:GITHUB_ENV - Write-Output "InstallWingetTempDir=$env:RUNNER_TEMP/install-winget" >> $env:GITHUB_ENV - - - name: Download Winget Assets and Dependencies - shell: pwsh - run: | - $AuthenticatedHeaders = @{ "Authorization" = "Bearer ${{ inputs.GITHUB_TOKEN }}" } - New-Item -Type Directory $env:InstallWingetTempDir - - # Download winget and license (architecture-agnostic) - Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri $env:WingetDownloadUri -OutFile $env:InstallWingetTempDir/winget.msixbundle - Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri $env:WingetLicenseDownloadUri -OutFile $env:InstallWingetTempDir/license.xml - Invoke-WebRequest -Headers $AuthenticatedHeaders -Uri $env:WingetDependenciesZipDownloadUri -OutFile $env:InstallWingetTempDir/DesktopAppInstaller_Dependencies.zip - - Expand-Archive -Path "$env:InstallWingetTempDir/DesktopAppInstaller_Dependencies.zip" -DestinationPath $env:InstallWingetTempDir/ -Force - - - name: Start Winget Installation for all Users - shell: pwsh - run: | - # Use architecture-specific dependency paths - [string[]]$DependencyPaths = (Get-ChildItem -Path "$env:InstallWingetTempDir/$env:Architecture" -Filter '*.appx' -File -Force).FullName - - $MicrosoftUIXamlDep = $($DependencyPaths[0]) - $MicrosoftVCLibsDep = $($DependencyPaths[1]) - - Write-Host "Found Dependency $MicrosoftUIXamlDep" - Write-Host "Found Dependency $MicrosoftVCLibsDep" - - Add-AppxProvisionedPackage -Online -PackagePath $env:InstallWingetTempDir/winget.msixbundle -LicensePath $env:InstallWingetTempDir/license.xml -DependencyPackagePath "$MicrosoftUIXamlDep", "$MicrosoftVCLibsDep" - - - name: Install Winget for Current User (for better install diagnostics) - shell: pwsh - run: | - Add-AppxPackage $env:InstallWingetTempDir/winget.msixbundle - - - name: Wait for Completion of Winget Installation - shell: pwsh - run: | - while ((Get-Command * | Select-String winget)?.ToString() -ne "winget.exe") { - Start-Sleep -Seconds 1 - } - Write-Output "Winget Version: $(winget --version)" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 098bfd791..90056dd50 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -60,16 +60,18 @@ jobs: - name: Checkout Repository uses: actions/checkout@v5 - - name: Install Winget - if: matrix.runner.name == 'windows-11-arm' - uses: ./.github/actions/install-winget - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Install Winget PowerShell Module shell: pwsh run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force + - name: Install Winget + if: matrix.runner.name == 'windows-11-arm' + shell: pwsh + run: | + Repair-WinGetPackageManager -Latest -Force + Write-Output "Winget Version: $(winget --version)" + - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm with: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index fcf0385c4..5968833de 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -58,16 +58,17 @@ jobs: - name: Checkout Repository uses: actions/checkout@v5 - - name: Install Winget - if: matrix.runner.name == 'windows-11-arm' - uses: ./.github/actions/install-winget - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Winget PowerShell Module shell: pwsh run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force + - name: Install Winget + if: matrix.runner.name == 'windows-11-arm' + shell: pwsh + run: | + Repair-WinGetPackageManager -Latest -Force + Write-Output "Winget Version: $(winget --version)" + - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b0d158291..a143e57db 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -61,16 +61,17 @@ jobs: - name: Checkout Repository uses: actions/checkout@v5 - - name: Install Winget - if: matrix.runner.name == 'windows-11-arm' - uses: ./.github/actions/install-winget - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Winget PowerShell Module shell: pwsh run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force + - name: Install Winget + if: matrix.runner.name == 'windows-11-arm' + shell: pwsh + run: | + Repair-WinGetPackageManager -Latest -Force + Write-Output "Winget Version: $(winget --version)" + - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm with: diff --git a/.github/workflows/local-development-makefile.yaml b/.github/workflows/local-development-makefile.yaml index 1f7170f87..7e7d1d202 100644 --- a/.github/workflows/local-development-makefile.yaml +++ b/.github/workflows/local-development-makefile.yaml @@ -43,16 +43,17 @@ jobs: - name: Checkout Repository uses: actions/checkout@v5 - - name: Install Winget - if: matrix.runner.name == 'windows-11-arm' - uses: ./.github/actions/install-winget - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Winget PowerShell Module shell: pwsh run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force + - name: Install Winget + if: matrix.runner.name == 'windows-11-arm' + shell: pwsh + run: | + Repair-WinGetPackageManager -Latest -Force + Write-Output "Winget Version: $(winget --version)" + - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm with: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2d245d923..e034d3709 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -37,8 +37,7 @@ jobs: rust_toolchain: - stable - beta - # Pin nightly version temporarily due to bug in macrotest: https://github.com/eupn/macrotest/issues/131 - - nightly-2025-11-20 + - nightly cargo_profile: - dev @@ -50,16 +49,17 @@ jobs: - name: Checkout Repository uses: actions/checkout@v5 - - name: Install Winget - if: matrix.runner.arch == 'arm64' - uses: ./.github/actions/install-winget - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install Winget PowerShell Module shell: pwsh run: Install-Module -Name Microsoft.WinGet.Client -Repository PSGallery -Force + - name: Install Winget + if: matrix.runner.arch == 'arm64' + shell: pwsh + run: | + Repair-WinGetPackageManager -Latest -Force + Write-Output "Winget Version: $(winget --version)" + - name: Install LLVM ${{ matrix.llvm }} uses: ./.github/actions/install-llvm with: @@ -88,7 +88,7 @@ jobs: - name: Install Cargo Expand uses: taiki-e/install-action@v2 with: - tool: cargo-expand@1.0.85 + tool: cargo-expand@1.0.119 - name: Install Cargo Make uses: taiki-e/install-action@v2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 287e49bec..c2aa328a8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -88,7 +88,7 @@ That's it! Thank you for your contribution! The following tools should be installed as a part of the `windows-drivers-rs` developer workflow: * `cargo-audit`: `cargo install --locked cargo-audit` -* `cargo-expand`: `cargo install --locked cargo-expand --version 1.0.85` +* `cargo-expand`: `cargo install --locked cargo-expand --version 1.0.119` * `cargo-machete`: `cargo install --locked cargo-machete` * `cargo-sort`: `cargo install --locked cargo-sort` * `taplo-cli`: `cargo install --locked taplo-cli` diff --git a/Makefile.toml b/Makefile.toml index a2bcf46e6..a42c36614 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -54,7 +54,7 @@ assert ${success} "Failed to delete tests directory" install_crate = { crate_name = "cargo-expand", binary = "cargo", test_arg = [ "expand", "--version", -], version = "1.0.85" } +], version = "1.0.119" } [tasks.audit] args = ["audit", "--deny", "warnings"] diff --git a/tests/wdk-macros-tests/tests/outputs/beta/macrotest/bug_unused_imports.expanded.rs b/tests/wdk-macros-tests/tests/outputs/beta/macrotest/bug_unused_imports.expanded.rs index 634a9719f..b1451a812 100644 --- a/tests/wdk-macros-tests/tests/outputs/beta/macrotest/bug_unused_imports.expanded.rs +++ b/tests/wdk-macros-tests/tests/outputs/beta/macrotest/bug_unused_imports.expanded.rs @@ -86,7 +86,7 @@ pub extern "system" fn driver_entry( ::core::panicking::panic_fmt( format_args!( "internal error: entered unreachable code: {0}", - format_args!("Option should never be None") + format_args!("Option should never be None"), ), ); }; diff --git a/tests/wdk-macros-tests/tests/outputs/beta/macrotest/wdf_driver_create.expanded.rs b/tests/wdk-macros-tests/tests/outputs/beta/macrotest/wdf_driver_create.expanded.rs index 0049301cf..d99bbb959 100644 --- a/tests/wdk-macros-tests/tests/outputs/beta/macrotest/wdf_driver_create.expanded.rs +++ b/tests/wdk-macros-tests/tests/outputs/beta/macrotest/wdf_driver_create.expanded.rs @@ -63,7 +63,7 @@ pub extern "system" fn driver_entry( ::core::panicking::panic_fmt( format_args!( "internal error: entered unreachable code: {0}", - format_args!("Option should never be None") + format_args!("Option should never be None"), ), ); }; diff --git a/tests/wdk-macros-tests/tests/outputs/nightly/macrotest/bug_unused_imports.expanded.rs b/tests/wdk-macros-tests/tests/outputs/nightly/macrotest/bug_unused_imports.expanded.rs index 634a9719f..b1451a812 100644 --- a/tests/wdk-macros-tests/tests/outputs/nightly/macrotest/bug_unused_imports.expanded.rs +++ b/tests/wdk-macros-tests/tests/outputs/nightly/macrotest/bug_unused_imports.expanded.rs @@ -86,7 +86,7 @@ pub extern "system" fn driver_entry( ::core::panicking::panic_fmt( format_args!( "internal error: entered unreachable code: {0}", - format_args!("Option should never be None") + format_args!("Option should never be None"), ), ); }; diff --git a/tests/wdk-macros-tests/tests/outputs/nightly/macrotest/wdf_driver_create.expanded.rs b/tests/wdk-macros-tests/tests/outputs/nightly/macrotest/wdf_driver_create.expanded.rs index 0049301cf..d99bbb959 100644 --- a/tests/wdk-macros-tests/tests/outputs/nightly/macrotest/wdf_driver_create.expanded.rs +++ b/tests/wdk-macros-tests/tests/outputs/nightly/macrotest/wdf_driver_create.expanded.rs @@ -63,7 +63,7 @@ pub extern "system" fn driver_entry( ::core::panicking::panic_fmt( format_args!( "internal error: entered unreachable code: {0}", - format_args!("Option should never be None") + format_args!("Option should never be None"), ), ); }; diff --git a/tests/wdk-macros-tests/tests/outputs/stable/macrotest/bug_unused_imports.expanded.rs b/tests/wdk-macros-tests/tests/outputs/stable/macrotest/bug_unused_imports.expanded.rs index 634a9719f..b1451a812 100644 --- a/tests/wdk-macros-tests/tests/outputs/stable/macrotest/bug_unused_imports.expanded.rs +++ b/tests/wdk-macros-tests/tests/outputs/stable/macrotest/bug_unused_imports.expanded.rs @@ -86,7 +86,7 @@ pub extern "system" fn driver_entry( ::core::panicking::panic_fmt( format_args!( "internal error: entered unreachable code: {0}", - format_args!("Option should never be None") + format_args!("Option should never be None"), ), ); }; diff --git a/tests/wdk-macros-tests/tests/outputs/stable/macrotest/wdf_driver_create.expanded.rs b/tests/wdk-macros-tests/tests/outputs/stable/macrotest/wdf_driver_create.expanded.rs index 0049301cf..d99bbb959 100644 --- a/tests/wdk-macros-tests/tests/outputs/stable/macrotest/wdf_driver_create.expanded.rs +++ b/tests/wdk-macros-tests/tests/outputs/stable/macrotest/wdf_driver_create.expanded.rs @@ -63,7 +63,7 @@ pub extern "system" fn driver_entry( ::core::panicking::panic_fmt( format_args!( "internal error: entered unreachable code: {0}", - format_args!("Option should never be None") + format_args!("Option should never be None"), ), ); };