codeql/rust
Paolo Tranquilli 28d517da59 Rust: fix regression in `getFormat` indexing 2024-11-22 14:13:15 +01:00
..
ast-generator Rust: add rust-specific deps updater script 2024-11-18 16:16:54 +01:00
codegen Rust: Vendor 3rdparty dependencies. 2024-11-13 13:22:14 +01:00
extractor Merge pull request #18012 from github/revert-18011-revert-17937-redsun82/rust-cargo-options 2024-11-19 09:03:52 +01:00
ql Rust: fix regression in `getFormat` indexing 2024-11-22 14:13:15 +01:00
schema Rust: fix parent/child relationship for format entities 2024-11-22 12:20:49 +01:00
tools
BUILD.bazel Bazel: add `experimental` to `codeql_pack` 2024-11-19 12:48:36 +01:00
README.md Bazel: rename shortcut to `install` 2024-11-19 10:34:40 +01:00
codegen.conf Rust: Auto-generate `CfgNodes.qll` 2024-11-21 10:21:11 +01:00
codeql-extractor.yml Revert "Revert "Rust: allow to specify more cargo configuration options"" 2024-11-18 15:52:03 +01:00
lint.py
prefix.dbscheme
update_cargo_deps.sh Rust: add rust-specific deps updater script 2024-11-18 16:16:54 +01: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:install

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