-
Notifications
You must be signed in to change notification settings - Fork 70
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
feat: enable CI workflows to use NuGet WDK packages #236
Open
svasista-ms
wants to merge
59
commits into
microsoft:main
Choose a base branch
from
svasista-ms:port-pipeline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
36b1d1e
Initial commit: use nuget pkgs
svasista-ms 7e467f6
Initial commit: use nuget pkgs
svasista-ms f04f22f
Merge branch 'microsoft:main' into port-pipeline
svasista-ms b641096
add NugetWDKContentRoot env variable detection to detect_wdk_content_…
svasista-ms 6d024aa
Merge branch 'port-pipeline' of https://github.com/svasista-ms/window…
svasista-ms d901e20
Add steps to install Nuget, move signtool to WDK's bin dir and set Nu…
svasista-ms 3038dc2
Add action to install Nuget
svasista-ms 40441ad
Add action to install Nuget
svasista-ms 80996e1
Add action to install Nuget
svasista-ms ffc24b3
Add action to install Nuget
svasista-ms e86b142
Add action to install Nuget
svasista-ms 3922faf
Fix condition to run Nuget installation
svasista-ms 03f6633
Fix WDK version in the matrix
svasista-ms 7343913
Fix NuGet command
svasista-ms 13fd747
Add command to set NugetWdkContentRoot ENV VAR
svasista-ms 9d1698d
Add command to set NugetWdkContentRoot ENV VAR
svasista-ms 52e0ac7
Add command to set NugetWdkContentRoot ENV VAR
svasista-ms 5e29f19
Add command to set NugetWdkContentRoot ENV VAR
svasista-ms 1046cbf
Add command to set NugetWdkContentRoot ENV VAR
svasista-ms 3b39c40
Add command to set NugetWdkContentRoot ENV VAR
svasista-ms dbc2f27
Replace x64 with ARM64 contents
svasista-ms edcbec9
Replace x64 with ARM64 contents
svasista-ms c0eeeb8
List contents of WDK Root Dir
svasista-ms 9b9bb08
List contents of WDK Root Dir
svasista-ms 4c5cb6e
Add print stmts for debugging
svasista-ms 2e28af7
Add print stmts for debugging
svasista-ms 860b337
Add print stmts for debugging
svasista-ms 02e3fbd
Reduce matrix options for faster workflow exec
svasista-ms abd946e
Fix wdk tool root for nuget package - tools instead of Tools
svasista-ms a656057
Replace ARM64 with x64 to match the host arch
svasista-ms 7692e01
Add command to move ARM64 headers to NuGet's x64 root
svasista-ms 70c7b6b
Add command to move ARM64 headers to NuGet's x64 root
svasista-ms a7a2fe8
Add debug print to copy to package function
svasista-ms 3c51e27
Latest WDK, LLVM 17.0.6, stable, dev, x86_64-pc-windows-msvc
svasista-ms 17e02da
Latest WDK, LLVM 17.0.6, stable, dev, x86_64-pc-windows-msvc
svasista-ms 72e518d
Move certmgr to WDK bin directories
svasista-ms efcb4db
Move MakeCert to respective WDK bin directories
svasista-ms 2e3024f
Move nuget-install-wdk to separate script
svasista-ms 98df970
Move nuget-install-wdk to separate script
svasista-ms 30f4fa6
Move nuget-install-wdk to separate script
svasista-ms e156edd
Enable WDK NI in the matrix
svasista-ms bf6203c
Remove debug print stmts, Enable target triple, Use Tools/ instead of…
svasista-ms d3c0fad
Enable all profiles, toolchains, targets in the matrix; complete matr…
svasista-ms 4df4330
Enable other workflows
svasista-ms a421cd7
Merge branch 'microsoft:main' into port-pipeline
svasista-ms b8fdb0d
Enable Latest WDK (uses NuGet) in all workflows
svasista-ms 41a7b7e
Revert to error handling using '?' for canonicalize and strip_extende…
svasista-ms ccdb96a
Merge branch 'main' into port-pipeline
svasista-ms f632131
Merge branch 'main' of https://github.com/microsoft/windows-drivers-r…
svasista-ms d2e3a61
Remove NugetWdkContentRoot env var, add logic in nuget-install-wdk.ps…
svasista-ms beedcb0
Merge branch 'port-pipeline' of https://github.com/svasista-ms/window…
svasista-ms 37b4bd6
Update Install WDK (NuGet) step in other workflows
svasista-ms f4087df
Fix Install WDK (NuGet) script's condition in accordance to the power…
svasista-ms a559f6d
Fix Install WDK (NuGet) script's condition in codeql.yml; Fix is_none…
svasista-ms a350aa5
change output directory of NuGet restore to C:\WDK
svasista-ms 5868673
fix packagesConfigPath in nuget-install-wdk.ps1
svasista-ms a422a4c
use is_none_or() for clippy::nominal_bool
svasista-ms 0256275
remove unnecessary hashes around raw string literal
svasista-ms 058b784
Merge branch 'main' into port-pipeline
NateD-MSFT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
param ( | ||
[string]$wdkVersion | ||
) | ||
|
||
# Extract the first three parts of the version | ||
$majorVersionNum = ($wdkVersion -split '\.')[0..2] -join '.' | ||
|
||
Write-Host "Installing WDK version $wdkVersion" | ||
Write-Host "Major version number: $majorVersionNum" | ||
|
||
# Update the packages.config file with the version passed as parameter | ||
$packagesConfigPath = ".\packages.config" | ||
|
||
if (Test-Path $packagesConfigPath) { | ||
[xml]$packagesConfig = Get-Content $packagesConfigPath | ||
|
||
foreach ($package in $packagesConfig.packages.package) { | ||
if ($package.id -like "Microsoft.Windows.*") { | ||
$package.version = $wdkVersion | ||
} | ||
} | ||
|
||
$packagesConfig.Save($packagesConfigPath) | ||
Write-Host "Updated packages.config with version $wdkVersion" | ||
} else { | ||
Write-Error "packages.config file not found" | ||
} | ||
|
||
# Install WDK using NuGet | ||
try { | ||
nuget restore .\packages.config -PackagesDirectory C:\WDK | ||
Write-Host "WDK installed at C:\WDK" | ||
} catch { | ||
Write-Error "Failed to restore packages using NuGet. Error: $_" | ||
exit 1 | ||
} | ||
|
||
$folders = @( | ||
"C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion", | ||
"C:\WDK\Microsoft.Windows.SDK.CPP.x64.$wdkVersion", | ||
"C:\WDK\Microsoft.Windows.SDK.CPP.arm64.$wdkVersion", | ||
"C:\WDK\Microsoft.Windows.WDK.ARM64.$wdkVersion", | ||
"C:\WDK\Microsoft.Windows.SDK.CPP.$wdkVersion" | ||
) | ||
foreach ($folder in $folders) { | ||
if (-Not (Test-Path $folder)) { | ||
Write-Error "Required folder $folder is missing." | ||
exit 1 | ||
} | ||
} | ||
function Copy-File { | ||
param ( | ||
[string]$sourcePath, | ||
[string]$destinationPath, | ||
[string]$fileName | ||
) | ||
|
||
if (Test-Path $sourcePath) { | ||
Copy-Item -Path $sourcePath -Destination $destinationPath -Force | ||
Write-Host "Copied $fileName to $destinationPath" | ||
} else { | ||
Write-Error "$fileName not found at $sourcePath" | ||
} | ||
} | ||
|
||
# Copying signtool to WDK bin folder | ||
$signtoolx64 = "C:\WDK\Microsoft.Windows.SDK.CPP.$wdkVersion\c\bin\$majorVersionNum.0\x64\signtool.exe" | ||
$signtoolX86 = "C:\WDK\Microsoft.Windows.SDK.CPP.$wdkVersion\c\bin\$majorVersionNum.0\x86\signtool.exe" | ||
$destinationx64 = "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\bin\$majorVersionNum.0\x64" | ||
$destinationX86 = "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\bin\$majorVersionNum.0\x86" | ||
|
||
Copy-File -sourcePath $signtoolX64 -destinationPath $destinationX64 -fileName "signtool.exe" | ||
Copy-File -sourcePath $signtoolX86 -destinationPath $destinationX86 -fileName "signtool.exe" | ||
|
||
# Copying certmgr to WDK bin folder | ||
$certmgrx86 = "C:\WDK\Microsoft.Windows.SDK.CPP.$wdkVersion\c\bin\$majorVersionNum.0\x86\certmgr.exe" | ||
$certmgrX64 = "C:\WDK\Microsoft.Windows.SDK.CPP.$wdkVersion\c\bin\$majorVersionNum.0\x64\certmgr.exe" | ||
$certmgrARM64 = "C:\WDK\Microsoft.Windows.SDK.CPP.$wdkVersion\c\bin\$majorVersionNum.0\arm64\certmgr.exe" | ||
$destinationx86 = "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\bin\$majorVersionNum.0\x86" | ||
$destinationx64 = "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\bin\$majorVersionNum.0\x64" | ||
$destinationARM64 = "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\bin\$majorVersionNum.0\ARM64" | ||
|
||
Copy-File -sourcePath $certmgrx86 -destinationPath $destinationx86 -fileName "certmgr.exe" | ||
Copy-File -sourcePath $certmgrX64 -destinationPath $destinationx64 -fileName "certmgr.exe" | ||
Copy-File -sourcePath $certmgrARM64 -destinationPath $destinationARM64 -fileName "certmgr.exe" | ||
|
||
# Copying makecert to WDK bin folder | ||
$makecertx86 = "C:\WDK\Microsoft.Windows.SDK.CPP.$wdkVersion\c\bin\$majorVersionNum.0\x86\MakeCert.exe" | ||
$makecertX64 = "C:\WDK\Microsoft.Windows.SDK.CPP.$wdkVersion\c\bin\$majorVersionNum.0\x64\MakeCert.exe" | ||
$makecertARM64 = "C:\WDK\Microsoft.Windows.SDK.CPP.$wdkVersion\c\bin\$majorVersionNum.0\arm64\MakeCert.exe" | ||
$destinationx86 = "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\bin\$majorVersionNum.0\x86" | ||
$destinationx64 = "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\bin\$majorVersionNum.0\x64" | ||
$destinationARM64 = "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\bin\$majorVersionNum.0\ARM64" | ||
|
||
Copy-File -sourcePath $makecertx86 -destinationPath $destinationx86 -fileName "MakeCert.exe" | ||
Copy-File -sourcePath $makecertX64 -destinationPath $destinationx64 -fileName "MakeCert.exe" | ||
Copy-File -sourcePath $makecertARM64 -destinationPath $destinationARM64 -fileName "MakeCert.exe" | ||
|
||
function Copy-Folder { | ||
param ( | ||
[string]$sourceFolder, | ||
[string]$destinationFolder | ||
) | ||
|
||
if (Test-Path $sourceFolder) { | ||
Copy-Item -Path $sourceFolder -Destination $destinationFolder -Recurse -Force | ||
Write-Host "Copied $sourceFolder to $destinationFolder" | ||
} else { | ||
Write-Error "Source folder $sourceFolder not found" | ||
} | ||
} | ||
|
||
# Copying km, um, kmdf, umdf ARM64 headers to x64 folders | ||
Copy-Folder -sourceFolder "C:\WDK\Microsoft.Windows.WDK.ARM64.$wdkVersion\c\Lib\$majorVersionNum.0\km\arm64" -destinationFolder "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\Lib\$majorVersionNum.0\km" | ||
Copy-Folder -sourceFolder "C:\WDK\Microsoft.Windows.WDK.ARM64.$wdkVersion\c\Lib\$majorVersionNum.0\um\arm64" -destinationFolder "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\Lib\$majorVersionNum.0\um" | ||
Copy-Folder -sourceFolder "C:\WDK\Microsoft.Windows.WDK.ARM64.$wdkVersion\c\Lib\wdf\kmdf\ARM64" -destinationFolder "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\Lib\wdf\kmdf" | ||
Copy-Folder -sourceFolder "C:\WDK\Microsoft.Windows.WDK.ARM64.$wdkVersion\c\Lib\wdf\umdf\ARM64" -destinationFolder "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c\Lib\wdf\umdf" | ||
|
||
# Set WDKContentRoot environment variable | ||
$NugetWdkContentRoot = "C:\WDK\Microsoft.Windows.WDK.x64.$wdkVersion\c" | ||
Write-Output "WDKContentRoot=$NugetWdkContentRoot" >> $env:GITHUB_ENV |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Microsoft.Windows.SDK.CPP" version="10.0.26100.1591" targetFramework="native" /> | ||
<package id="Microsoft.Windows.SDK.CPP.x64" version="10.0.26100.1591" targetFramework="native" /> | ||
<package id="Microsoft.Windows.SDK.CPP.arm64" version="10.0.26100.1591" targetFramework="native" /> | ||
<package id="Microsoft.Windows.WDK.x64" version="10.0.26100.1591" targetFramework="native" /> | ||
<package id="Microsoft.Windows.WDK.arm64" version="10.0.26100.1591" targetFramework="native" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker, but I am curious how this reformat wasn't caught sooner by CI/other pipeline checkins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change actually needs to be reverted? I suspect that whats going on is that:
There are some gaps in the top-level examples and tests folders where certain pipelines are not fully covering them. spent some time figuring out what gaps there are (mostly due to changes related to #186 ) and will be adding the rundown to github in a pr