GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — codeql/rust at codeql-cli/latest · github/codeql

Expand file tree

/

rust

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

rust

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
ast-generator
ast-generator
 
 
autobuild
autobuild
 
 
codegen
codegen
 
 
downgrades
downgrades
 
 
extractor
extractor
 
 
ql
ql
 
 
schema
schema
 
 
scripts
scripts
 
 
tools
tools
 
 
BUILD.bazel
BUILD.bazel
 
 
README.md
README.md
 
 
bulk_generation_targets.yml
bulk_generation_targets.yml
 
 
codegen.conf
codegen.conf
 
 
codeql-extractor.yml
codeql-extractor.yml
 
 
lint.py
lint.py
 
 
prefix.dbscheme
prefix.dbscheme
 
 
update_cargo_deps.sh
update_cargo_deps.sh
 
 
updating-rust-analyzer.md
updating-rust-analyzer.md
 
 

README.md

Outline

Rust on CodeQL

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 anywhere under your semmle-code or codeql directory you can run:

bazel run @codeql//rust:install

You can use shorter versions of the above command:

bazel run //rust:install  # if under the `codeql` checkout
bazel run rust:install  # if at the root of the `codeql` checkout
bazel run :install  # if at the `rust` directory of the `codeql` checkout

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

If you make changes to either

  • ast-generator/, or
  • schema/*.py

you'll need to regenerate code. You can do so running

bazel run @codeql//rust/codegen

Sometimes, especially if resolving conflicts on generated files, you might need to run

bazel run @codeql//rust/codegen -- --force

for code generation to succeed.

Updating rust-analyzer

See Updating rust-analyzer.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.