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

Query compilation fails for ruby and go with error 'codeql/suite-helpers' not found. #7193

Closed
jacobmsft opened this issue Nov 19, 2021 · 7 comments
Labels
question Further information is requested

Comments

@jacobmsft
Copy link

I follow the codeql getting started guide to clone the repos locally, and then I try to compile the queries. For ruby and go, it gives me error below. For the rest of the languages, the compilation works fine.

/usr/local/codeql-home#> codeql query compile --threads=0 /usr/local/codeql-home/codeql-go-repo/ql/src/codeql-suites/*.qls
ERROR: Referenced pack 'codeql/suite-helpers' not found. (/usr/local/codeql-home/codeql-go-repo/ql/src/qlpack.yml:1,1-1)
A fatal error occurred: Could not resolve library path for /usr/local/codeql-home/codeql-go-repo/ql/src

/usr/local/codeql-home#> codeql query compile --threads=0 /usr/local/codeql-home/codeql-repo/ruby/ql/src/codeql-suites/*.qls
ERROR: Referenced pack 'codeql/suite-helpers' not found. (/usr/local/codeql-home/codeql-repo/ruby/ql/src/qlpack.yml:1,1-1)
A fatal error occurred: Could not resolve library path for /usr/local/codeql-home/codeql-repo/ruby/ql/src

the paths are set properly and qlpack resolution works just fine:

/usr/local/codeql-home#> codeql resolve qlpacks
codeql-csharp-tests (/usr/local/codeql-home/codeql-repo/csharp/ql/test)
codeql/cpp-all (/usr/local/codeql-home/codeql-repo/cpp/ql/lib)
codeql/cpp-examples (/usr/local/codeql-home/codeql-repo/cpp/ql/examples)
codeql/cpp-queries (/usr/local/codeql-home/codeql-repo/cpp/ql/src)
codeql/cpp-tests (/usr/local/codeql-home/codeql-repo/cpp/ql/test)
codeql/cpp-tests-cwe-190-tainted (/usr/local/codeql-home/codeql-repo/cpp/ql/test/query-tests/Security/CWE/CWE-190/semmle/tainted)
codeql/cpp-upgrades (/usr/local/codeql-home/codeql-repo/cpp/upgrades)
codeql/csharp-all (/usr/local/codeql-home/codeql-repo/csharp/ql/lib)
codeql/csharp-examples (/usr/local/codeql-home/codeql-repo/csharp/ql/examples)
codeql/csharp-queries (/usr/local/codeql-home/codeql-repo/csharp/ql/src)
codeql/csharp-upgrades (/usr/local/codeql-home/codeql-repo/csharp/upgrades)
codeql/go-all (/usr/local/codeql-home/codeql-go-repo/ql/lib)
codeql/go-examples (/usr/local/codeql-home/codeql-go-repo/ql/examples)
codeql/go-queries (/usr/local/codeql-home/codeql-go-repo/ql/src)
codeql/go-tests (/usr/local/codeql-home/codeql-go-repo/ql/test)
codeql/go-upgrades (/usr/local/codeql-home/codeql-go-repo/upgrades)
codeql/java-all (/usr/local/codeql-home/codeql-repo/java/ql/lib)
codeql/java-examples (/usr/local/codeql-home/codeql-repo/java/ql/examples)
codeql/java-queries (/usr/local/codeql-home/codeql-repo/java/ql/src)
codeql/java-tests (/usr/local/codeql-home/codeql-repo/java/ql/test)
codeql/java-upgrades (/usr/local/codeql-home/codeql-repo/java/upgrades)
codeql/javascript-all (/usr/local/codeql-home/codeql-repo/javascript/ql/lib)
codeql/javascript-examples (/usr/local/codeql-home/codeql-repo/javascript/ql/examples)
codeql/javascript-experimental-atm-lib (/usr/local/codeql-home/codeql-repo/javascript/ql/experimental/adaptivethreatmodeling/lib)
codeql/javascript-experimental-atm-queries (/usr/local/codeql-home/codeql-repo/javascript/ql/experimental/adaptivethreatmodeling/src)
codeql/javascript-queries (/usr/local/codeql-home/codeql-repo/javascript/ql/src)
codeql/javascript-tests (/usr/local/codeql-home/codeql-repo/javascript/ql/test)
codeql/javascript-upgrades (/usr/local/codeql-home/codeql-repo/javascript/upgrades)
codeql/python-all (/usr/local/codeql-home/codeql-repo/python/ql/lib)
codeql/python-examples (/usr/local/codeql-home/codeql-repo/python/ql/examples)
codeql/python-queries (/usr/local/codeql-home/codeql-repo/python/ql/src)
codeql/python-tests (/usr/local/codeql-home/codeql-repo/python/ql/test)
codeql/python-upgrades (/usr/local/codeql-home/codeql-repo/python/upgrades)
codeql/ruby-all (/usr/local/codeql-home/codeql-repo/ruby/ql/lib)
codeql/ruby-consistency-queries (/usr/local/codeql-home/codeql-repo/ruby/ql/consistency-queries)
codeql/ruby-examples (/usr/local/codeql-home/codeql-repo/ruby/ql/examples)
codeql/ruby-queries (/usr/local/codeql-home/codeql-repo/ruby/ql/src)
codeql/ruby-tests (/usr/local/codeql-home/codeql-repo/ruby/ql/test)
codeql/suite-helpers (/usr/local/codeql-home/codeql-repo/misc/suite-helpers)
legacy-libraries-cpp (/usr/local/codeql-home/codeql-repo/misc/legacy-support/cpp)
legacy-libraries-csharp (/usr/local/codeql-home/codeql-repo/misc/legacy-support/csharp)
legacy-libraries-go (/usr/local/codeql-home/codeql-go-repo/ql/config/legacy-support)
legacy-libraries-java (/usr/local/codeql-home/codeql-repo/misc/legacy-support/java)
legacy-libraries-javascript (/usr/local/codeql-home/codeql-repo/misc/legacy-support/javascript)
legacy-libraries-python (/usr/local/codeql-home/codeql-repo/misc/legacy-support/python)
legacy-upgrades (/usr/local/codeql-home/codeql/legacy-upgrades)

@MathiasVP
Copy link
Contributor

MathiasVP commented Nov 22, 2021

Hi @jacobmsft,

Thank you for opening an issue! We're currently looking into the problem. As a workaround for Ruby, can you check if it works if you add an --additional-packs argument like this:

/usr/local/codeql-home#> codeql query compile --threads=0 /usr/local/codeql-home/codeql-go-repo/ql/src/codeql-suites/*.qls --additional-packs .

For go, make sure you've run the scripts/install-deps.sh script as specified in the README of the codeql-go repository.

@jacobmsft
Copy link
Author

Hi @jacobmsft,

Thank you for opening an issue! We're currently looking into the problem. As a workaround for Ruby, can you check if it works if you add an --additional-packs argument like this:

/usr/local/codeql-home#> codeql query compile --threads=0 /usr/local/codeql-home/codeql-go-repo/ql/src/codeql-suites/*.qls --additional-packs .

For go, make sure you've run the scripts/install-deps.sh script as specified in the README of the codeql-go repository.

Yes, that worked for both Ruby and Go...Thanks!

@MathiasVP
Copy link
Contributor

Great! Sounds like the issue is resolved. Closing this issue. Feel free to open another one if you hit any other issues :)

@jacobmsft
Copy link
Author

Great! Sounds like the issue is resolved. Closing this issue. Feel free to open another one if you hit any other issues :)

The workaround works, but its still a workaround...we shouldn't be specifying the --additional-packs for compiling.

@MathiasVP
Copy link
Contributor

MathiasVP commented Nov 24, 2021

The workaround works, but its still a workaround...we shouldn't be specifying the --additional-packs for compiling.

I agree. We're working on an actual solution. In fact, we probably have a solution, but we're still discussing which release to ship it in.

@jacobmsft
Copy link
Author

The workaround works, but its still a workaround...we shouldn't be specifying the --additional-packs for compiling.

I agree. We're working on an actual solution. In fact, we probably have a solution, but we're still discussing which release to ship it in.

That's great, thanks MathaisVP!

@GleasonK
Copy link
Contributor

Having the same issue, workaround of adding --additional-packs <codeql-home> worked as well.

Running Windows 11 using Linux on WSL if relevant.

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

3 participants