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

CodeQL configuration steps for Windows driver testing is giving an error #16837

Open
shravan-ltts opened this issue Jun 25, 2024 · 2 comments
Open
Labels
question Further information is requested

Comments

@shravan-ltts
Copy link

I am trying to configure the CodeQL for WHQL testing, followed the steps mentioned in the link:
static-tools-and-codeql

I have ended up with below error.
C:\codeql-home\codeql>codeql --version
CodeQL command-line toolchain release 2.6.3.
Copyright (C) 2019-2021 GitHub, Inc.
Unpacked in: C:\codeql-home\codeql
Analysis results depend critically on separately distributed query and
extractor modules. To list modules that are visible to the toolchain,
use 'codeql resolve qlpacks' and 'codeql resolve languages'.

C:\codeql-home\codeql>*codeql pack install ..\Windows-Driver-Developer-Supplemental-Tools\src*
Dependencies resolved. Installing packages...
Install location: C:\Users\admin.codeql\packages
{
"packs" : [
{
"name" : "codeql/cpp-all",
"version" : "0.12.1",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/dataflow",
"version" : "0.1.4",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/ssa",
"version" : "0.2.4",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/util",
"version" : "0.2.4",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/typetracking",
"version" : "0.2.4",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/rangeanalysis",
"version" : "0.0.3",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/tutorial",
"version" : "0.2.4",
"library" : true,
"result" : "INSTALLED"
}
]
}

C:\codeql-home\codeql>codeql database analyze C:\codeql-home\databases\Database --format=sarifv2.1.0 --output=C:\codeql-home\USBDriverProjectResults-mustfix.sarif C:\codeql-home\Windows-Driver-Developer-Supplemental-Tools\suites\windows_driver_mustfix.qls --download
{
"packs" : [
{
"name" : "codeql/cpp-queries",
"version" : "0.9.0",
"library" : false,
"result" : "INSTALLED"
},
{
"name" : "microsoft/windows-drivers",
"version" : "1.1.0",
"library" : false,
"result" : "INSTALLED"
}
]
}
Running queries.
ERROR: Referenced pack 'codeql/cpp-all' not found. (C:\Users\admin.codeql\packages\codeql\cpp-queries\0.9.0\qlpack.yml:1,1-1)
ERROR: Referenced pack 'codeql/suite-helpers' not found. (C:\Users\admin.codeql\packages\codeql\cpp-queries\0.9.0\qlpack.yml:1,1-1)
ERROR: Referenced pack 'codeql/util' not found. (C:\Users\admin.codeql\packages\codeql\cpp-queries\0.9.0\qlpack.yml:1,1-1)
A fatal error occurred: Could not resolve library path for C:\Users\admin.codeql\packages\codeql\cpp-queries\0.9.0

C:\codeql-home\codeql>codeql pack download codeql/[email protected] codeql/[email protected] codeql/[email protected]
Package installation location: C:\Users\DTMLLUAdminUser.codeql\packages
Already installed codeql/[email protected]
Installed fresh codeql/[email protected]
Already installed codeql/[email protected]

C:\codeql-home\codeql>codeql database analyze C:\codeql-home\databases\WAGUSBDatabase --format=sarifv2.1.0 --output=C:\codeql-home\WAGUSBDriverProjectResults-mustfix.sarif C:\codeql-home\Windows-Driver-Developer-Supplemental-Tools\suites\windows_driver_mustfix.qls --download
{
"packs" : [
{
"name" : "codeql/cpp-queries",
"version" : "0.9.0",
"library" : false,
"result" : "IGNORED"
},
{
"name" : "microsoft/windows-drivers",
"version" : "1.1.0",
"library" : false,
"result" : "IGNORED"
}
]
}
Running queries.
ERROR: Referenced pack 'codeql/cpp-all' not found. (C:\Users\DTMLLUAdminUser.codeql\packages\codeql\cpp-queries\0.9.0\qlpack.yml:1,1-1)
ERROR: Referenced pack 'codeql/suite-helpers' not found. (C:\Users\DTMLLUAdminUser.codeql\packages\codeql\cpp-queries\0.9.0\qlpack.yml:1,1-1)
ERROR: Referenced pack 'codeql/util' not found. (C:\Users\DTMLLUAdminUser.codeql\packages\codeql\cpp-queries\0.9.0\qlpack.yml:1,1-1)
A fatal error occurred: Could not resolve library path for C:\Users\DTMLLUAdminUser.codeql\packages\codeql\cpp-queries\0.9.0

Can anyone help me resolving this issue.

@shravan-ltts shravan-ltts added the question Further information is requested label Jun 25, 2024
@shravan-ltts
Copy link
Author

shravan-ltts commented Jun 25, 2024

After installing the dependency packages, I am getting a big list of errors (attached the log file codeql-error.txt).

What is that I am missing here?

C:\codeql-home\codeql>codeql pack install C:\Users\admin.codeql\packages\codeql\cpp-queries\1.0.1
Dependencies resolved. Installing packages...
Install location: C:\Users\admin.codeql\packages
{
"packs" : [
{
"name" : "codeql/cpp-all",
"version" : "1.1.0",
"library" : true,
"result" : "IGNORED"
},
{
"name" : "codeql/dataflow",
"version" : "1.0.1",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/ssa",
"version" : "1.0.1",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/util",
"version" : "1.0.1",
"library" : true,
"result" : "IGNORED"
},
{
"name" : "codeql/typetracking",
"version" : "1.0.1",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/mad",
"version" : "1.0.1",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/rangeanalysis",
"version" : "1.0.1",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/tutorial",
"version" : "1.0.1",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/typeflow",
"version" : "1.0.1",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/xml",
"version" : "1.0.1",
"library" : true,
"result" : "INSTALLED"
},
{
"name" : "codeql/suite-helpers",
"version" : "1.0.1",
"library" : false,
"result" : "IGNORED"
}
]
}

@jketema
Copy link
Contributor

jketema commented Jun 25, 2024

You've all kind of version mismatches it seems. Note that the page you linked specifies specific versions of the packages you will need to install, and you're installing much newer versions. For example, you're installing codeql/cpp-all version 1.1.0, while you need version 0.9.0 (if using CodeQL 2.15.4).

It's probably best to use 2.15.4, because we do not really support version 2.6.3 anymore. Alternatively you could ask at https://github.com/microsoft/Windows-Driver-Developer-Supplemental-Tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants