microsoft / win32metadata

Tooling to generate metadata for Win32 APIs in the Windows SDK.
Other
1.32k stars 113 forks source link

`RecompileIdlFilesForScraping` does not run on a clean repo #1871

Closed MarijnS95 closed 6 months ago

MarijnS95 commented 6 months ago

When checking out a clean repo, running .\scripts\RecompileIdlFilesForScraping.ps1 for https://github.com/microsoft/win32metadata/blob/main/CONTRIBUTING.md#direct3d-agility-sdk seems to be missing a call to Install-BuildTools (or another setup utility):

PS C:\Users\Marijn\Code\TraverseResearch\win32metadata> .\scripts\RecompileIdlFilesForScraping.ps1
Select-Xml: C:\Users\Marijn\Code\TraverseResearch\win32metadata\scripts\CommonUtils.ps1:116:13
Line |
 116 |      $item = Select-Xml -Path "$rootDir\obj\$projNameOnly\$projectName …
     |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find path 'C:\Users\Marijn\Code\TraverseResearch\win32metadata\obj\BuildTools\BuildTools.proj.nuget.g.props' because it does not exist.

After running DoAll.ps1 first (without terminating it early which seems to corrupt some .cs files used in subsequent DoAll.ps1 runs, even though it installs BuildTools all the way at the start), the needed file becomes available and the script succeeds correctly.

riverar commented 6 months ago

I don't think that script is designed to be run out of band / outside the order established in DoAll.ps1

MarijnS95 commented 6 months ago

That was my impression too, though it seems trivial to make it work out of the box on a clean repo. Especially as this script is supposed to be run (when updating external bindings) before the DoAll step (and DoAll, unlike the name implies, does not scrape headers for obvious reasons).

mikebattista commented 6 months ago

Adding Install-BuildTools to the script does appear to be the right solution. Thanks for reporting.