Go: Unified handling of in-tree extractor packs.

This commit is contained in:
Cornelius Riemenschneider
2024-06-03 16:06:44 +02:00
parent 5c77b8708c
commit 57f7602126
3 changed files with 5 additions and 6 deletions

View File

@@ -65,5 +65,4 @@ codeql_pack(
"//go/downgrades",
"//go/extractor:tokenizer",
],
install_dest = "build/codeql-extractor-pack",
)

View File

@@ -1,6 +1,6 @@
all: gen extractor
EXTRACTOR_PACK_OUT = build/codeql-extractor-go
EXTRACTOR_PACK_OUT = extractor-pack
.PHONY: extractor gen clean autoformat check-formatting
@@ -45,9 +45,9 @@ ql/lib/go.dbscheme.stats: ql/lib/go.dbscheme build/stats/src.stamp extractor
codeql dataset measure -o $@ build/stats/database/db-go
test: all build/testdb/check-upgrade-path
codeql test run -j0 ql/test --search-path build/codeql-extractor-go --consistency-queries ql/test/consistency --compilation-cache=$(cache)
codeql test run -j0 ql/test --consistency-queries ql/test/consistency --compilation-cache=$(cache)
# use GOOS=linux because GOOS=darwin GOARCH=386 is no longer supported
env GOOS=linux GOARCH=386 codeql$(EXE) test run -j0 ql/test/query-tests/Security/CWE-681 --search-path build/codeql-extractor-go --consistency-queries ql/test/consistency --compilation-cache=$(cache)
env GOOS=linux GOARCH=386 codeql$(EXE) test run -j0 ql/test/query-tests/Security/CWE-681 --consistency-queries ql/test/consistency --compilation-cache=$(cache)
cd extractor; bazel test ...
bash extractor-smoke-test/test.sh || (echo "Extractor smoke test FAILED"; exit 1)

View File

@@ -7,7 +7,7 @@ cd $DIR
rm -rf testdb
codeql database create --language=go testdb --search-path ../build/codeql-extractor-go
codeql database create --language=go testdb
codeql dataset check testdb/db-go
codeql query run ../ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/ControlFlowNode_getASuccessor.ql --database=testdb --output=notracing-out.bqrs --search-path ..
codeql bqrs decode notracing-out.bqrs --format=csv --output=notracing-out.csv
@@ -19,7 +19,7 @@ export CODEQL_EXTRACTOR_GO_BUILD_TRACING=on
rm -rf testdb
codeql database create --language=go testdb --search-path ../build/codeql-extractor-go
codeql database create --language=go testdb
codeql dataset check testdb/db-go
codeql query run ../ql/test/library-tests/semmle/go/controlflow/ControlFlowGraph/ControlFlowNode_getASuccessor.ql --database=testdb --output=tracing-out.bqrs --search-path ..
codeql bqrs decode tracing-out.bqrs --format=csv --output=tracing-out.csv