Could not resolve type ...

See original GitHub issue

Hi, The following command failed to generate harness.

python3 harness.py -L /local/codeql-home/nginx-1.21.1/objs/ -C /local/codeql-home/codeql/ -M 1 -O /local/nginx/autoharness/ -D nginx -G 1 -Y 1 -F "-I /local/codeql-home/nginx-1.21.1/objs -I /local/codeql-home/nginx-1.21.1/src/core -I /local/codeql-home/nginx-1.21.1/src/event -I /local/codeql-home/nginx-1.21.1/src/http -I /local/codeql-home/nginx-1.21.1/src/mail -I /local/codeql-home/nginx-1.21.1/src/misc -I /local/codeql-home/nginx-1.21.1/src/os -I /local/codeql-home/nginx-1.21.1/src/stream -I /local/codeql-home/nginx-1.21.1/src/os/unix" -X ngx_config.h,ngx_core.h

Error messages:

Compiling query plan for /local/codeql-home/codeql/multiargfunc.ql.
ERROR: Could not resolve module cpp. There should probably be a qlpack.yml file declaring dependencies in /local/codeql-home/codeql or an enclosing directory. (/local/codeql-home/codeql/multiargfunc.ql:1,8-11)
ERROR: Could not resolve type Type (/local/codeql-home/codeql/multiargfunc.ql:3,1-5)
ERROR: Could not resolve type Parameter (/local/codeql-home/codeql/multiargfunc.ql:3,30-39)
ERROR: Could not resolve type PointerType (/local/codeql-home/codeql/multiargfunc.ql:6,40-51)
ERROR: Could not resolve type Type (/local/codeql-home/codeql/multiargfunc.ql:9,1-5)
ERROR: Could not resolve type Parameter (/local/codeql-home/codeql/multiargfunc.ql:9,27-36)
ERROR: Could not resolve type PointerType (/local/codeql-home/codeql/multiargfunc.ql:10,65-76)
ERROR: Could not resolve type Function (/local/codeql-home/codeql/multiargfunc.ql:13,6-14)
ERROR: Could not resolve type Type (/local/codeql-home/codeql/multiargfunc.ql:13,18-22)
ERROR: Could not resolve type Parameter (/local/codeql-home/codeql/multiargfunc.ql:14,18-27)
ERROR: Could not resolve type Struct (/local/codeql-home/codeql/multiargfunc.ql:14,91-97)
ERROR: 'result' cannot be used in this context (/local/codeql-home/codeql/multiargfunc.ql:4,3-9)
ERROR: 'result' cannot be used in this context (/local/codeql-home/codeql/multiargfunc.ql:6,3-9)
ERROR: 'result' cannot be used in this context (/local/codeql-home/codeql/multiargfunc.ql:10,3-9)
ERROR: 'result' cannot be used in this context (/local/codeql-home/codeql/multiargfunc.ql:10,47-53)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
0romancommented, Aug 20, 2021

okay, thank you @parikhakshat that makes it more clear now. I think it would be great to have a flag to specify the codeql library separately. For some one who has no experience with codeql your documentation is really hard to follow. I was able to solve the issue by copying the the cpp library from inside the codeql-lgtm-v1.27.0 under /cpp/ql/src/ to the codeql CLI binaries folder:

cp -R /home/roman/git/codeql-home/codeql-lgtm-v1.27.0/cpp/ql/src/* /home/roman/git/codeql-home/codeql
0reactions
SmllXzBZcommented, Jan 1, 2022

@0roman Hello, I follow your comment but still have some problems. After copying the cpp/ql/src/*, I run harness.py gives the following error

python3 harness.py -L /home/test/nginx-1.21.0/objs/ -C /home/test/codeql-h/codeql/ -M 1 -O /home/test/autoharness/ -D nginx -G 1 -Y 1 -F "-I /home/test/nginx-1.21.0/objs -I /home/test/nginx-1.21.0/src/core -I /home/test/nginx-1.21.0/src/event -I /home/test/nginx-1.21.0/src/http -I /home/test/nginx-1.21.0/src/mail -I /home/test/nginx-1.21.0/src/misc -I /home/test/nginx-1.21.0/src/os -I /home/test/nginx-1.21.0/src/stream -I /home/test/nginx-1.21.0/src/os/unix" -X ngx_config.h,ngx_core.h

ERROR: Referenced pack 'codeql/cpp-all' not found. (/home/test/codeql-h/codeql/qlpack.yml:1,1-1)
ERROR: Referenced pack 'codeql/suite-helpers' not found. (/home/test/codeql-h/codeql/qlpack.yml:1,1-1)
A fatal error occurred: Could not resolve library path for /home/test/codeql-h/codeql
A fatal error occurred: Could not read BQRS file at /home/test/autoharness/multiarg.bqrs: java.io.FileNotFoundException: /home/test/autoharness/multiarg.bqrs (No such file or directory)
(eventual cause: FileNotFoundException "/home/test/autoharness/multiarg.bqrs (No such file or directory)")
Traceback (most recent call last):
  File "harness.py", line 160, in <module>
    subprocess.check_output("cd "+ args.ql + ";" +args.ql+ "codeql query run multiargfunc.ql -o " + args.output + "multiarg.bqrs -d " + args.ql + args.database +";" + args.ql + "codeql bqrs decode --format=csv " + args.output + "multiarg.bqrs -o " + args.output + "multiarg.csv", shell=True)
  File "/usr/lib/python3.6/subprocess.py", line 356, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command 'cd /home/test/codeql-h/codeql/;/home/test/codeql-h/codeql/codeql query run multiargfunc.ql -o /home/test/autoharness/multiarg.bqrs -d /home/test/codeql-h/codeql/nginx;/home/test/codeql-h/codeql/codeql bqrs decode --format=csv /home/test/autoharness/multiarg.bqrs -o /home/test/autoharness/multiarg.csv' returned non-zero exit status 2.

where is everything stored: CLI binaries: /home/test/codeql-h/codeql codeql Libraries: /home/test/codeql-h/codeql-repo autoharness: /home/test/autoharness nginx-source-code: /home/test/nginx-1.21.0 nginx-database: /home/test/codeql-h/codeql/nginx

multiargfunc.ql location after executing unsuccessful harness.py /home/test/codeql-h/codeql/multiargfunc.ql /home/test/autoharness/multiargfunc.ql

Read more comments on GitHub >

github_iconTop Results From Across the Web

xcode 8 Debugger 'Could not resolve type' - ios - Stack Overflow
In Xcode 8, When any break point is hit, and I try to print any object in the Xcode debugger, it always prints...
Read more >
Error: Could not resolve type CallAllocationExpr · Issue #4836
Hi @Phantomn,. The CallAllocationExpr class is a private class found in semmle.code.cpp.models.implementations.Allocation .
Read more >
Could not resolve type with token 0100004a from typeref ...
getting this error while i compile the project. Error Mono.Linker.MarkException: Error processing method: 'System.Byte[] HeavenTaste.
Read more >
Cannot resolve type in UI for .NET MAUI | Telerik Forums
Hi,. I'm having issues using Telerik MAUI controls in my project. (in this case the chart controls but it's also happened with others)....
Read more >
Could not resolve type with token 01000008
A fix for this issue has been released! Install the most recent release from https://visualstudio.microsoft.com/downloads/. Thank you for providing valuable ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found