codeql/rust
Paolo Tranquilli 9a8d9f857f
Merge pull request #17491 from github/redsun82/rust-integration-test
Rust: add basic integration tests and fix archiving on Windows
2024-09-19 05:25:14 +02:00
..
codegen Rust: first running tests 2024-08-30 17:45:51 +02:00
extractor Rust: log detected manifests 2024-09-17 15:35:26 +02:00
integration-tests Rust: ignore failing DB-CHECK 2024-09-17 15:35:52 +02:00
ql Merge pull request #17508 from paldepind/rust-consistency-queries-pack 2024-09-18 14:17:52 +02:00
tools Rust: add windows tools 2024-09-17 11:22:32 +02:00
BUILD.bazel Rust: add `experimental` bazel target 2024-09-06 09:29:54 +02:00
README.md Rust: Update example path. 2024-09-10 17:09:51 +01:00
codegen.conf Rust: Use `elements/internal/generated` instead of `internal/generated` 2024-09-18 10:44:20 +02:00
codeql-extractor.yml Fix definition of trap compression option 2024-09-10 17:13:49 +02:00
lint.py Rust: use shared path utilities 2024-09-17 12:27:57 +02:00
prefix.dbscheme Rust: integrate into standard files+location library 2024-09-12 13:17:10 +02:00
schema.py Rust: Use ```rust for code block examples 2024-09-18 13:47:45 +02:00

README.md

Rust on CodeQL

[!WARNING] Rust support for CodeQL is experimental. No support is offered. QL and database interfaces will change and break without notice or deprecation periods.

Development

Dependencies

If you don't have the semmle-code repo you may need to install Bazel manually, e.g. from https://github.com/bazelbuild/bazelisk.

Building the Rust Extractor

This approach uses a released codeql version and is simpler to use for QL development. From your semmle-code directory run:

bazel run @codeql//rust:rust-installer

You now need to create a per-user CodeQL configuration file and specify the option:

--search-path PATH/TO/semmle-code/ql

(wherever the codeql checkout is on your system)

You can now use the Rust extractor e.g. to run Rust tests from the command line or in VSCode.

Building the Rust Extractor (as a sembuild target)

This approach allows you to build a Rust extractor with a CLI built from source. From your semmle-code directory run:

./build target/intree/codeql-rust

You can now invoke it directly, for example to run some tests:

./target/intree/codeql-rust/codeql test run ql/rust/ql/test/PATH/TO/TEST/

Building a Database

TODO

Code Generation

TODO