LoginSignup
3
0

More than 3 years have passed since last update.

GitHub Actions v2 で Windows Driver Kit を使ったビルドをする

Posted at

はじめに

Windows Driver Kit (WDK) を使ったビルドをしようとしたときにはまったのでその回避方法です。

エラー内容

MSBuild.exe を使ってビルドしようとすると以下のエラーになります。

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(379,5): 
error MSB8020: 
The build tools for WindowsUserModeDriver10.0 (Platform Toolset = 'WindowsUserModeDriver10.0') cannot be found. 
To build using the WindowsUserModeDriver10.0 build tools, please install WindowsUserModeDriver10.0 build tools.  
Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu 
or right-click the solution, and then selecting "Retarget solution". [D:\a\user\user\repository\example.vcxproj]

どうするか

runs-on: で指定しているイメージに windows-latestwindows-2019 を指定している場合は windows-2016 に変更します。

なぜこれで回避できるのか

GitHub Actions は Azure Pipelines と同じイメージを使っているようで1 microsoft/azure-pipelines-image-generation リポジトリにヒントがあります。

https://github.com/microsoft/azure-pipelines-image-generation/blob/568bfe035a0583e89ac3f27e1fd2b3be93caa42f/images/win/scripts/Installers/Vs2019/Install-WDK.ps1#L33-L54
VS 2019 のインストールスクリプトで WDK.vsix のインストールがコメントアウトされており、当然使えるわけがありません。
これは Update Windows Driver Kit to 1903 に起因する問題のようです。
なので VS 2017 を使っている windows-2016 のイメージではこの問題は起こりません。

windows-2019 でも動かしたい

windows-2019 で解決するには WDK.vsix をインストールできれば良いと思うのですがうまくいきませんでした。
Visual Studio 2019 - WDK for Windows 10, version 1903 · Issue #2994 · appveyor/ci を参考に以下のコマンドを実行させてみましたが、エラーが発生します。

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\VSIXInstaller.exe" /a /f /sp /q /skuName:Enterprise /skuVersion:16.3.29318.209 "C:\Program Files (x86)\Windows Kits\10\Vsix\WDK.vsix"
Process completed with exit code 2003.

vsix - VSIXInstaller.exe exit code documentation - Stack Overflow によるとエラーコード 2003NoApplicableSKUsException とのことです。

おわりに

問題は認識されているようなのでそのうち解決するとは思いますが、インストールの方法をご存知の方がいればここなり Microsoft のリポジトリなりにフィードバックお願いします。


  1. GitHub Actions は Azure Pipelines のフォーク 

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0