codeql/rust
Paolo Tranquilli f7ee5f4bf5
Merge pull request #18003 from github/redsun82/rust-qltest
Rust: only accept `options.yml` in QL tests
2024-11-18 17:24:57 +01:00
..
ast-generator Rust: Vendor 3rdparty dependencies. 2024-11-13 13:22:14 +01:00
codegen Rust: Vendor 3rdparty dependencies. 2024-11-13 13:22:14 +01:00
extractor Revert "Rust: allow to specify more cargo configuration options" 2024-11-18 15:36:06 +01:00
ql Merge pull request #18003 from github/redsun82/rust-qltest 2024-11-18 17:24:57 +01:00
schema Rust: extract some resolved paths 2024-10-31 14:19:15 +01:00
tools Rust: fix qltest on macOS, and add CI cross-platform testing of it 2024-10-25 12:19:46 +02:00
BUILD.bazel Codegen/Rust: allow breaking up schema file 2024-09-19 15:57:42 +02:00
README.md
codegen.conf Codegen/Rust: allow breaking up schema file 2024-09-19 15:57:42 +02:00
codeql-extractor.yml Revert "Rust: allow to specify more cargo configuration options" 2024-11-18 15:36:06 +01:00
lint.py Rust: use shared path utilities 2024-09-17 12:27:57 +02:00
prefix.dbscheme

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